summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-03-27 15:21:27 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-03-27 15:21:27 -0300
commita6f3bc7c696af03e3875f78e098d2476e409d15e (patch)
treefc1bb58e900436c48c03c52106eb57250442ae35
parent307b1b3a5835ecdb477859785c673a07e248f904 (diff)
Renaming of servers for coherency.
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
-rw-r--r--core/debugger/debugger_marshalls.cpp2
-rw-r--r--core/debugger/debugger_marshalls.h4
-rw-r--r--core/debugger/remote_debugger.cpp18
-rw-r--r--drivers/dummy/rasterizer_dummy.h122
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp216
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.h2
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp4
-rw-r--r--drivers/gles2/rasterizer_gles2.h2
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp304
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.h32
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp548
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.h118
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp346
-rw-r--r--drivers/gles2/shader_compiler_gles2.h10
-rw-r--r--drivers/gles2/shader_gles2.h2
-rw-r--r--drivers/gles2/shaders/blend_shape.glsl2
-rw-r--r--drivers/unix/os_unix.cpp2
-rw-r--r--drivers/vulkan/rendering_device_vulkan.h2
-rw-r--r--editor/animation_track_editor_plugins.cpp8
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/editor_node.cpp34
-rw-r--r--editor/editor_plugin.cpp62
-rw-r--r--editor/editor_resource_preview.cpp2
-rw-r--r--editor/import/editor_import_collada.cpp8
-rw-r--r--editor/import/resource_importer_texture.cpp2
-rw-r--r--editor/import/resource_importer_texture.h8
-rw-r--r--editor/node_3d_editor_gizmos.cpp42
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp70
-rw-r--r--editor/plugins/audio_stream_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp18
-rw-r--r--editor/plugins/editor_preview_plugins.cpp194
-rw-r--r--editor/plugins/material_editor_plugin.cpp36
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp198
-rw-r--r--editor/plugins/node_3d_editor_plugin.h2
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp4
-rw-r--r--editor/plugins/shader_editor_plugin.cpp12
-rw-r--r--editor/plugins/shader_editor_plugin.h2
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp4
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp6
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp4
-rw-r--r--editor/property_editor.cpp2
-rw-r--r--editor/scene_tree_dock.cpp2
-rw-r--r--gles_builders.py2
-rw-r--r--main/main.cpp84
-rw-r--r--main/performance.cpp38
-rw-r--r--main/tests/test_math.cpp2
-rw-r--r--main/tests/test_physics.cpp130
-rw-r--r--main/tests/test_physics_2d.cpp86
-rw-r--r--main/tests/test_render.cpp24
-rw-r--r--main/tests/test_shader_lang.cpp2
-rw-r--r--modules/assimp/editor_scene_importer_assimp.cpp20
-rw-r--r--modules/basis_universal/register_types.cpp22
-rw-r--r--modules/basis_universal/texture_basisu.cpp10
-rw-r--r--modules/bullet/area_bullet.cpp48
-rw-r--r--modules/bullet/area_bullet.h14
-rw-r--r--modules/bullet/bullet_physics_server.cpp384
-rw-r--r--modules/bullet/bullet_physics_server.h18
-rw-r--r--modules/bullet/collision_object_bullet.cpp2
-rw-r--r--modules/bullet/cone_twist_joint_bullet.cpp28
-rw-r--r--modules/bullet/cone_twist_joint_bullet.h6
-rw-r--r--modules/bullet/generic_6dof_joint_bullet.cpp98
-rw-r--r--modules/bullet/generic_6dof_joint_bullet.h12
-rw-r--r--modules/bullet/godot_result_callbacks.cpp4
-rw-r--r--modules/bullet/godot_result_callbacks.h14
-rw-r--r--modules/bullet/hinge_joint_bullet.cpp54
-rw-r--r--modules/bullet/hinge_joint_bullet.h10
-rw-r--r--modules/bullet/joint_bullet.h4
-rw-r--r--modules/bullet/pin_joint_bullet.cpp16
-rw-r--r--modules/bullet/pin_joint_bullet.h6
-rw-r--r--modules/bullet/register_types.cpp8
-rw-r--r--modules/bullet/rid_bullet.h8
-rw-r--r--modules/bullet/rigid_body_bullet.cpp126
-rw-r--r--modules/bullet/rigid_body_bullet.h26
-rw-r--r--modules/bullet/shape_bullet.cpp38
-rw-r--r--modules/bullet/shape_bullet.h22
-rw-r--r--modules/bullet/slider_joint_bullet.cpp94
-rw-r--r--modules/bullet/slider_joint_bullet.h6
-rw-r--r--modules/bullet/soft_body_bullet.cpp16
-rw-r--r--modules/bullet/soft_body_bullet.h4
-rw-r--r--modules/bullet/space_bullet.cpp86
-rw-r--r--modules/bullet/space_bullet.h22
-rw-r--r--modules/csg/csg_shape.cpp28
-rw-r--r--modules/gdnative/arvr/arvr_interface_gdnative.cpp8
-rw-r--r--modules/gdnavigation/gd_navigation_server.cpp2
-rw-r--r--modules/gdnavigation/gd_navigation_server.h4
-rw-r--r--modules/gdnavigation/register_types.cpp6
-rw-r--r--modules/glslang/register_types.cpp2
-rw-r--r--modules/gridmap/grid_map.cpp146
-rw-r--r--modules/gridmap/grid_map.h4
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp128
-rw-r--r--modules/mobile_vr/mobile_vr_interface.cpp2
-rw-r--r--modules/opensimplex/noise_texture.cpp10
-rw-r--r--platform/android/os_android.cpp12
-rw-r--r--platform/android/os_android.h4
-rw-r--r--platform/haiku/os_haiku.cpp20
-rw-r--r--platform/haiku/os_haiku.h4
-rw-r--r--platform/iphone/os_iphone.cpp22
-rw-r--r--platform/iphone/os_iphone.h6
-rw-r--r--platform/javascript/os_javascript.cpp6
-rw-r--r--platform/javascript/os_javascript.h2
-rw-r--r--platform/linuxbsd/display_server_x11.cpp6
-rw-r--r--platform/linuxbsd/display_server_x11.h4
-rw-r--r--platform/linuxbsd/os_linuxbsd.h4
-rw-r--r--platform/server/os_server.cpp10
-rw-r--r--platform/server/os_server.h6
-rw-r--r--platform/uwp/os_uwp.cpp14
-rw-r--r--platform/uwp/os_uwp.h6
-rw-r--r--platform/windows/display_server_windows.h6
-rw-r--r--platform/windows/os_windows.cpp4
-rw-r--r--platform/windows/os_windows.h4
-rw-r--r--scene/2d/area_2d.cpp40
-rw-r--r--scene/2d/audio_stream_player_2d.cpp4
-rw-r--r--scene/2d/back_buffer_copy.cpp6
-rw-r--r--scene/2d/camera_2d.cpp2
-rw-r--r--scene/2d/canvas_modulate.cpp10
-rw-r--r--scene/2d/collision_object_2d.cpp56
-rw-r--r--scene/2d/collision_polygon_2d.cpp2
-rw-r--r--scene/2d/collision_shape_2d.cpp2
-rw-r--r--scene/2d/cpu_particles_2d.cpp46
-rw-r--r--scene/2d/gpu_particles_2d.cpp52
-rw-r--r--scene/2d/joints_2d.cpp34
-rw-r--r--scene/2d/light_2d.cpp56
-rw-r--r--scene/2d/light_occluder_2d.cpp32
-rw-r--r--scene/2d/line_2d.cpp2
-rw-r--r--scene/2d/navigation_2d.cpp20
-rw-r--r--scene/2d/navigation_agent_2d.cpp30
-rw-r--r--scene/2d/navigation_obstacle_2d.cpp20
-rw-r--r--scene/2d/navigation_region_2d.cpp20
-rw-r--r--scene/2d/node_2d.cpp16
-rw-r--r--scene/2d/parallax_layer.cpp2
-rw-r--r--scene/2d/physics_body_2d.cpp128
-rw-r--r--scene/2d/physics_body_2d.h8
-rw-r--r--scene/2d/polygon_2d.cpp8
-rw-r--r--scene/2d/ray_cast_2d.cpp6
-rw-r--r--scene/2d/skeleton_2d.cpp10
-rw-r--r--scene/2d/sprite_2d.cpp2
-rw-r--r--scene/2d/tile_map.cpp96
-rw-r--r--scene/2d/y_sort.cpp4
-rw-r--r--scene/3d/area_3d.cpp40
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
-rw-r--r--scene/3d/baked_lightmap.cpp30
-rw-r--r--scene/3d/camera_3d.cpp38
-rw-r--r--scene/3d/collision_object_3d.cpp44
-rw-r--r--scene/3d/collision_shape_3d.cpp6
-rw-r--r--scene/3d/cpu_particles_3d.cpp30
-rw-r--r--scene/3d/gi_probe.cpp44
-rw-r--r--scene/3d/gpu_particles_3d.cpp58
-rw-r--r--scene/3d/immediate_geometry_3d.cpp22
-rw-r--r--scene/3d/immediate_geometry_3d.h2
-rw-r--r--scene/3d/light_3d.cpp56
-rw-r--r--scene/3d/light_3d.h48
-rw-r--r--scene/3d/mesh_instance_3d.cpp10
-rw-r--r--scene/3d/navigation_3d.cpp26
-rw-r--r--scene/3d/navigation_agent_3d.cpp32
-rw-r--r--scene/3d/navigation_obstacle_3d.cpp24
-rw-r--r--scene/3d/navigation_region_3d.cpp20
-rw-r--r--scene/3d/physics_body_3d.cpp376
-rw-r--r--scene/3d/physics_body_3d.h18
-rw-r--r--scene/3d/physics_joint_3d.cpp66
-rw-r--r--scene/3d/physics_joint_3d.h138
-rw-r--r--scene/3d/ray_cast_3d.cpp6
-rw-r--r--scene/3d/reflection_probe.cpp34
-rw-r--r--scene/3d/reflection_probe.h2
-rw-r--r--scene/3d/skeleton_3d.cpp12
-rw-r--r--scene/3d/soft_body_3d.cpp148
-rw-r--r--scene/3d/soft_body_3d.h6
-rw-r--r--scene/3d/spring_arm_3d.cpp4
-rw-r--r--scene/3d/sprite_3d.cpp40
-rw-r--r--scene/3d/vehicle_body_3d.cpp24
-rw-r--r--scene/3d/vehicle_body_3d.h18
-rw-r--r--scene/3d/visual_instance_3d.cpp46
-rw-r--r--scene/3d/visual_instance_3d.h16
-rw-r--r--scene/animation/root_motion_view.cpp28
-rw-r--r--scene/gui/button.cpp2
-rw-r--r--scene/gui/check_box.cpp2
-rw-r--r--scene/gui/check_button.cpp2
-rw-r--r--scene/gui/control.cpp8
-rw-r--r--scene/gui/item_list.cpp4
-rw-r--r--scene/gui/label.cpp4
-rw-r--r--scene/gui/line_edit.cpp18
-rw-r--r--scene/gui/nine_patch_rect.cpp4
-rw-r--r--scene/gui/rich_text_label.cpp8
-rw-r--r--scene/gui/text_edit.cpp78
-rw-r--r--scene/gui/texture_progress.cpp2
-rw-r--r--scene/gui/texture_rect.cpp2
-rw-r--r--scene/gui/tree.cpp28
-rw-r--r--scene/main/canvas_item.cpp127
-rw-r--r--scene/main/canvas_item.h4
-rw-r--r--scene/main/canvas_layer.cpp32
-rw-r--r--scene/main/scene_tree.cpp14
-rw-r--r--scene/main/viewport.cpp184
-rw-r--r--scene/main/viewport.h2
-rw-r--r--scene/main/window.cpp34
-rw-r--r--scene/resources/box_shape_3d.cpp6
-rw-r--r--scene/resources/capsule_shape_2d.cpp10
-rw-r--r--scene/resources/capsule_shape_3d.cpp6
-rw-r--r--scene/resources/circle_shape_2d.cpp10
-rw-r--r--scene/resources/concave_polygon_shape_2d.cpp12
-rw-r--r--scene/resources/concave_polygon_shape_3d.cpp8
-rw-r--r--scene/resources/convex_polygon_shape_2d.cpp10
-rw-r--r--scene/resources/convex_polygon_shape_3d.cpp6
-rw-r--r--scene/resources/cylinder_shape_3d.cpp6
-rw-r--r--scene/resources/dynamic_font.cpp2
-rw-r--r--scene/resources/environment.cpp166
-rw-r--r--scene/resources/environment.h2
-rw-r--r--scene/resources/font.cpp2
-rw-r--r--scene/resources/height_map_shape_3d.cpp6
-rw-r--r--scene/resources/line_shape_2d.cpp12
-rw-r--r--scene/resources/material.cpp120
-rw-r--r--scene/resources/material.h8
-rw-r--r--scene/resources/mesh.cpp66
-rw-r--r--scene/resources/mesh.h44
-rw-r--r--scene/resources/multimesh.cpp36
-rw-r--r--scene/resources/multimesh.h6
-rw-r--r--scene/resources/particles_material.cpp116
-rw-r--r--scene/resources/physics_material.h2
-rw-r--r--scene/resources/primitive_meshes.cpp102
-rw-r--r--scene/resources/ray_shape_3d.cpp6
-rw-r--r--scene/resources/rectangle_shape_2d.cpp10
-rw-r--r--scene/resources/segment_shape_2d.cpp18
-rw-r--r--scene/resources/shader.cpp18
-rw-r--r--scene/resources/shader.h2
-rw-r--r--scene/resources/shape_2d.cpp14
-rw-r--r--scene/resources/shape_3d.cpp6
-rw-r--r--scene/resources/sky.cpp10
-rw-r--r--scene/resources/sky_material.cpp74
-rw-r--r--scene/resources/sphere_shape_3d.cpp6
-rw-r--r--scene/resources/style_box.cpp6
-rw-r--r--scene/resources/style_box.h2
-rw-r--r--scene/resources/surface_tool.cpp108
-rw-r--r--scene/resources/texture.cpp206
-rw-r--r--scene/resources/texture.h52
-rw-r--r--scene/resources/tile_set.cpp2
-rw-r--r--scene/resources/visual_shader.cpp20
-rw-r--r--scene/resources/world_2d.cpp26
-rw-r--r--scene/resources/world_2d.h4
-rw-r--r--scene/resources/world_3d.cpp34
-rw-r--r--scene/resources/world_3d.h6
-rw-r--r--scene/resources/world_margin_shape_3d.cpp6
-rw-r--r--servers/SCsub4
-rw-r--r--servers/arvr_server.cpp2
-rw-r--r--servers/camera/camera_feed.cpp28
-rw-r--r--servers/camera/camera_feed.h4
-rw-r--r--servers/camera_server.cpp2
-rw-r--r--servers/display_server.h2
-rw-r--r--servers/navigation_server_2d.cpp (renamed from servers/navigation_2d_server.cpp)164
-rw-r--r--servers/navigation_server_2d.h (renamed from servers/navigation_2d_server.h)14
-rw-r--r--servers/navigation_server_3d.cpp (renamed from servers/navigation_server.cpp)102
-rw-r--r--servers/navigation_server_3d.h (renamed from servers/navigation_server.h)24
-rw-r--r--servers/physics/physics_server_sw.cpp1589
-rw-r--r--servers/physics_2d/area_2d_sw.cpp48
-rw-r--r--servers/physics_2d/area_2d_sw.h14
-rw-r--r--servers/physics_2d/area_pair_2d_sw.cpp8
-rw-r--r--servers/physics_2d/body_2d_sw.cpp148
-rw-r--r--servers/physics_2d/body_2d_sw.h36
-rw-r--r--servers/physics_2d/body_pair_2d_sw.cpp12
-rw-r--r--servers/physics_2d/collision_object_2d_sw.cpp14
-rw-r--r--servers/physics_2d/collision_object_2d_sw.h2
-rw-r--r--servers/physics_2d/collision_solver_2d_sat.cpp12
-rw-r--r--servers/physics_2d/collision_solver_2d_sw.cpp16
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp24
-rw-r--r--servers/physics_2d/joints_2d_sw.h16
-rw-r--r--servers/physics_2d/physics_server_2d_sw.cpp (renamed from servers/physics_2d/physics_2d_server_sw.cpp)272
-rw-r--r--servers/physics_2d/physics_server_2d_sw.h (renamed from servers/physics_2d/physics_2d_server_sw.h)16
-rw-r--r--servers/physics_2d/physics_server_2d_wrap_mt.cpp (renamed from servers/physics_2d/physics_2d_server_wrap_mt.cpp)32
-rw-r--r--servers/physics_2d/physics_server_2d_wrap_mt.h (renamed from servers/physics_2d/physics_2d_server_wrap_mt.h)24
-rw-r--r--servers/physics_2d/shape_2d_sw.h20
-rw-r--r--servers/physics_2d/space_2d_sw.cpp98
-rw-r--r--servers/physics_2d/space_2d_sw.h12
-rw-r--r--servers/physics_2d/step_2d_sw.cpp6
-rw-r--r--servers/physics_3d/SCsub (renamed from servers/physics/SCsub)0
-rw-r--r--servers/physics_3d/area_3d_sw.cpp (renamed from servers/physics/area_sw.cpp)80
-rw-r--r--servers/physics_3d/area_3d_sw.h (renamed from servers/physics/area_sw.h)62
-rw-r--r--servers/physics_3d/area_pair_3d_sw.cpp (renamed from servers/physics/area_pair_sw.cpp)32
-rw-r--r--servers/physics_3d/area_pair_3d_sw.h (renamed from servers/physics/area_pair_sw.h)26
-rw-r--r--servers/physics_3d/body_3d_sw.cpp (renamed from servers/physics/body_sw.cpp)192
-rw-r--r--servers/physics_3d/body_3d_sw.h (renamed from servers/physics/body_sw.h)90
-rw-r--r--servers/physics_3d/body_pair_3d_sw.cpp (renamed from servers/physics/body_pair_sw.cpp)42
-rw-r--r--servers/physics_3d/body_pair_3d_sw.h (renamed from servers/physics/body_pair_sw.h)20
-rw-r--r--servers/physics_3d/broad_phase_3d_basic.cpp (renamed from servers/physics/broad_phase_basic.cpp)34
-rw-r--r--servers/physics_3d/broad_phase_3d_basic.h (renamed from servers/physics/broad_phase_basic.h)20
-rw-r--r--servers/physics_3d/broad_phase_3d_sw.cpp (renamed from servers/physics/broad_phase_sw.cpp)6
-rw-r--r--servers/physics_3d/broad_phase_3d_sw.h (renamed from servers/physics/broad_phase_sw.h)22
-rw-r--r--servers/physics_3d/broad_phase_octree.cpp (renamed from servers/physics/broad_phase_octree.cpp)22
-rw-r--r--servers/physics_3d/broad_phase_octree.h (renamed from servers/physics/broad_phase_octree.h)22
-rw-r--r--servers/physics_3d/collision_object_3d_sw.cpp (renamed from servers/physics/collision_object_sw.cpp)42
-rw-r--r--servers/physics_3d/collision_object_3d_sw.h (renamed from servers/physics/collision_object_sw.h)38
-rw-r--r--servers/physics_3d/collision_solver_3d_sat.cpp (renamed from servers/physics/collision_solver_sat.cpp)148
-rw-r--r--servers/physics_3d/collision_solver_3d_sat.h (renamed from servers/physics/collision_solver_sat.h)4
-rw-r--r--servers/physics_3d/collision_solver_3d_sw.cpp (renamed from servers/physics/collision_solver_sw.cpp)54
-rw-r--r--servers/physics_3d/collision_solver_3d_sw.h (renamed from servers/physics/collision_solver_sw.h)20
-rw-r--r--servers/physics_3d/constraint_3d_sw.h (renamed from servers/physics/constraint_sw.h)24
-rw-r--r--servers/physics_3d/gjk_epa.cpp (renamed from servers/physics/gjk_epa.cpp)18
-rw-r--r--servers/physics_3d/gjk_epa.h (renamed from servers/physics/gjk_epa.h)8
-rw-r--r--servers/physics_3d/joints/SCsub (renamed from servers/physics/joints/SCsub)0
-rw-r--r--servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp (renamed from servers/physics/joints/cone_twist_joint_sw.cpp)40
-rw-r--r--servers/physics_3d/joints/cone_twist_joint_3d_sw.h (renamed from servers/physics/joints/cone_twist_joint_sw.h)22
-rw-r--r--servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp (renamed from servers/physics/joints/generic_6dof_joint_sw.cpp)176
-rw-r--r--servers/physics_3d/joints/generic_6dof_joint_3d_sw.h (renamed from servers/physics/joints/generic_6dof_joint_sw.h)64
-rw-r--r--servers/physics_3d/joints/hinge_joint_3d_sw.cpp (renamed from servers/physics/joints/hinge_joint_sw.cpp)80
-rw-r--r--servers/physics_3d/joints/hinge_joint_3d_sw.h (renamed from servers/physics/joints/hinge_joint_sw.h)30
-rw-r--r--servers/physics_3d/joints/jacobian_entry_3d_sw.h (renamed from servers/physics/joints/jacobian_entry_sw.h)20
-rw-r--r--servers/physics_3d/joints/pin_joint_3d_sw.cpp (renamed from servers/physics/joints/pin_joint_sw.cpp)30
-rw-r--r--servers/physics_3d/joints/pin_joint_3d_sw.h (renamed from servers/physics/joints/pin_joint_sw.h)24
-rw-r--r--servers/physics_3d/joints/slider_joint_3d_sw.cpp (renamed from servers/physics/joints/slider_joint_sw.cpp)130
-rw-r--r--servers/physics_3d/joints/slider_joint_3d_sw.h (renamed from servers/physics/joints/slider_joint_sw.h)28
-rw-r--r--servers/physics_3d/joints_3d_sw.h (renamed from servers/physics/joints_sw.h)12
-rw-r--r--servers/physics_3d/physics_server_3d_sw.cpp1589
-rw-r--r--servers/physics_3d/physics_server_3d_sw.h (renamed from servers/physics/physics_server_sw.h)48
-rw-r--r--servers/physics_3d/shape_3d_sw.cpp (renamed from servers/physics/shape_sw.cpp)244
-rw-r--r--servers/physics_3d/shape_3d_sw.h (renamed from servers/physics/shape_sw.h)100
-rw-r--r--servers/physics_3d/space_3d_sw.cpp (renamed from servers/physics/space_sw.cpp)310
-rw-r--r--servers/physics_3d/space_3d_sw.h (renamed from servers/physics/space_sw.h)100
-rw-r--r--servers/physics_3d/step_3d_sw.cpp (renamed from servers/physics/step_sw.cpp)78
-rw-r--r--servers/physics_3d/step_3d_sw.h (renamed from servers/physics/step_sw.h)16
-rw-r--r--servers/physics_server_2d.cpp (renamed from servers/physics_2d_server.cpp)446
-rw-r--r--servers/physics_server_2d.h (renamed from servers/physics_2d_server.h)108
-rw-r--r--servers/physics_server_3d.cpp (renamed from servers/physics_server.cpp)452
-rw-r--r--servers/physics_server_3d.h (renamed from servers/physics_server.h)112
-rw-r--r--servers/register_server_types.cpp78
-rw-r--r--servers/rendering/SCsub (renamed from servers/visual/SCsub)0
-rw-r--r--servers/rendering/rasterizer.cpp (renamed from servers/visual/rasterizer.cpp)0
-rw-r--r--servers/rendering/rasterizer.h (renamed from servers/visual/rasterizer.h)132
-rw-r--r--servers/rendering/rasterizer_rd/SCsub (renamed from servers/visual/rasterizer_rd/SCsub)0
-rw-r--r--servers/rendering/rasterizer_rd/cubemap_coeffs.h (renamed from servers/visual/rasterizer_rd/cubemap_coeffs.h)0
-rw-r--r--servers/rendering/rasterizer_rd/light_cluster_builder.cpp (renamed from servers/visual/rasterizer_rd/light_cluster_builder.cpp)0
-rw-r--r--servers/rendering/rasterizer_rd/light_cluster_builder.h (renamed from servers/visual/rasterizer_rd/light_cluster_builder.h)2
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_canvas_rd.cpp (renamed from servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp)90
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_canvas_rd.h (renamed from servers/visual/rasterizer_rd/rasterizer_canvas_rd.h)30
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp (renamed from servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp)16
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_effects_rd.h (renamed from servers/visual/rasterizer_rd/rasterizer_effects_rd.h)36
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_rd.cpp (renamed from servers/visual/rasterizer_rd/rasterizer_rd.cpp)0
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_rd.h (renamed from servers/visual/rasterizer_rd/rasterizer_rd.h)8
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.cpp (renamed from servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp)172
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.h (renamed from servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.h)14
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp (renamed from servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp)166
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_scene_rd.h (renamed from servers/visual/rasterizer_rd/rasterizer_scene_rd.h)72
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp (renamed from servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp)248
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_storage_rd.h (renamed from servers/visual/rasterizer_rd/rasterizer_storage_rd.h)112
-rw-r--r--servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.cpp (renamed from servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.cpp)0
-rw-r--r--servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h (renamed from servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h)2
-rw-r--r--servers/rendering/rasterizer_rd/shader_compiler_rd.cpp (renamed from servers/visual/rasterizer_rd/shader_compiler_rd.cpp)240
-rw-r--r--servers/rendering/rasterizer_rd/shader_compiler_rd.h (renamed from servers/visual/rasterizer_rd/shader_compiler_rd.h)8
-rw-r--r--servers/rendering/rasterizer_rd/shader_rd.cpp (renamed from servers/visual/rasterizer_rd/shader_rd.cpp)2
-rw-r--r--servers/rendering/rasterizer_rd/shader_rd.h (renamed from servers/visual/rasterizer_rd/shader_rd.h)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/SCsub (renamed from servers/visual/rasterizer_rd/shaders/SCsub)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/blur.glsl (renamed from servers/visual/rasterizer_rd/shaders/blur.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/blur_inc.glsl (renamed from servers/visual/rasterizer_rd/shaders/blur_inc.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/bokeh_dof.glsl (renamed from servers/visual/rasterizer_rd/shaders/bokeh_dof.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/canvas.glsl (renamed from servers/visual/rasterizer_rd/shaders/canvas.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/canvas_occlusion.glsl (renamed from servers/visual/rasterizer_rd/shaders/canvas_occlusion.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/canvas_uniforms_inc.glsl (renamed from servers/visual/rasterizer_rd/shaders/canvas_uniforms_inc.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/copy.glsl (renamed from servers/visual/rasterizer_rd/shaders/copy.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/cubemap_downsampler.glsl (renamed from servers/visual/rasterizer_rd/shaders/cubemap_downsampler.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/cubemap_filter.glsl (renamed from servers/visual/rasterizer_rd/shaders/cubemap_filter.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/cubemap_roughness.glsl (renamed from servers/visual/rasterizer_rd/shaders/cubemap_roughness.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/giprobe.glsl (renamed from servers/visual/rasterizer_rd/shaders/giprobe.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/giprobe_debug.glsl (renamed from servers/visual/rasterizer_rd/shaders/giprobe_debug.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/giprobe_sdf.glsl (renamed from servers/visual/rasterizer_rd/shaders/giprobe_sdf.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/giprobe_write.glsl (renamed from servers/visual/rasterizer_rd/shaders/giprobe_write.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/luminance_reduce.glsl (renamed from servers/visual/rasterizer_rd/shaders/luminance_reduce.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/roughness_limiter.glsl (renamed from servers/visual/rasterizer_rd/shaders/roughness_limiter.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/scene_high_end.glsl (renamed from servers/visual/rasterizer_rd/shaders/scene_high_end.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/scene_high_end_inc.glsl (renamed from servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/sky.glsl (renamed from servers/visual/rasterizer_rd/shaders/sky.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/ssao.glsl (renamed from servers/visual/rasterizer_rd/shaders/ssao.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/ssao_blur.glsl (renamed from servers/visual/rasterizer_rd/shaders/ssao_blur.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/ssao_minify.glsl (renamed from servers/visual/rasterizer_rd/shaders/ssao_minify.glsl)0
-rw-r--r--servers/rendering/rasterizer_rd/shaders/tonemap.glsl (renamed from servers/visual/rasterizer_rd/shaders/tonemap.glsl)0
-rw-r--r--servers/rendering/rendering_device.cpp (renamed from servers/visual/rendering_device.cpp)0
-rw-r--r--servers/rendering/rendering_device.h (renamed from servers/visual/rendering_device.h)0
-rw-r--r--servers/rendering/rendering_server_canvas.cpp (renamed from servers/visual/visual_server_canvas.cpp)230
-rw-r--r--servers/rendering/rendering_server_canvas.h (renamed from servers/visual/visual_server_canvas.h)52
-rw-r--r--servers/rendering/rendering_server_globals.cpp (renamed from servers/visual/visual_server_globals.cpp)18
-rw-r--r--servers/rendering/rendering_server_globals.h (renamed from servers/visual/visual_server_globals.h)24
-rw-r--r--servers/rendering/rendering_server_raster.cpp (renamed from servers/visual/visual_server_raster.cpp)156
-rw-r--r--servers/rendering/rendering_server_raster.h (renamed from servers/visual/visual_server_raster.h)38
-rw-r--r--servers/rendering/rendering_server_scene.cpp (renamed from servers/visual/visual_server_scene.cpp)654
-rw-r--r--servers/rendering/rendering_server_scene.h (renamed from servers/visual/visual_server_scene.h)24
-rw-r--r--servers/rendering/rendering_server_viewport.cpp (renamed from servers/visual/visual_server_viewport.cpp)248
-rw-r--r--servers/rendering/rendering_server_viewport.h (renamed from servers/visual/visual_server_viewport.h)40
-rw-r--r--servers/rendering/rendering_server_wrap_mt.cpp (renamed from servers/visual/visual_server_wrap_mt.cpp)60
-rw-r--r--servers/rendering/rendering_server_wrap_mt.h (renamed from servers/visual/visual_server_wrap_mt.h)64
-rw-r--r--servers/rendering/shader_language.cpp (renamed from servers/visual/shader_language.cpp)18
-rw-r--r--servers/rendering/shader_language.h (renamed from servers/visual/shader_language.h)0
-rw-r--r--servers/rendering/shader_types.cpp328
-rw-r--r--servers/rendering/shader_types.h (renamed from servers/visual/shader_types.h)8
-rw-r--r--servers/rendering_server.cpp (renamed from servers/visual_server.cpp)924
-rw-r--r--servers/rendering_server.h (renamed from servers/visual_server.h)112
-rw-r--r--servers/visual/shader_types.cpp328
390 files changed, 10763 insertions, 10764 deletions
diff --git a/core/debugger/debugger_marshalls.cpp b/core/debugger/debugger_marshalls.cpp
index eb3a19506a..427c005b60 100644
--- a/core/debugger/debugger_marshalls.cpp
+++ b/core/debugger/debugger_marshalls.cpp
@@ -317,7 +317,7 @@ bool DebuggerMarshalls::VisualProfilerFrame::deserialize(const Array &p_arr) {
CHECK_SIZE(p_arr, size, "VisualProfilerFrame");
int idx = 2;
areas.resize(size / 3);
- VS::FrameProfileArea *w = areas.ptrw();
+ RS::FrameProfileArea *w = areas.ptrw();
for (int i = 0; i < size / 3; i++) {
w[i].name = p_arr[idx];
w[i].cpu_msec = p_arr[idx + 1];
diff --git a/core/debugger/debugger_marshalls.h b/core/debugger/debugger_marshalls.h
index 4c15adc555..04229c0afc 100644
--- a/core/debugger/debugger_marshalls.h
+++ b/core/debugger/debugger_marshalls.h
@@ -32,7 +32,7 @@
#define DEBUGGER_MARSHARLLS_H
#include "core/script_language.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
struct DebuggerMarshalls {
@@ -165,7 +165,7 @@ struct DebuggerMarshalls {
// Visual Profiler
struct VisualProfilerFrame {
uint64_t frame_number;
- Vector<VS::FrameProfileArea> areas;
+ Vector<RS::FrameProfileArea> areas;
Array serialize();
bool deserialize(const Array &p_arr);
diff --git a/core/debugger/remote_debugger.cpp b/core/debugger/remote_debugger.cpp
index b9db8ab1b0..66b890be23 100644
--- a/core/debugger/remote_debugger.cpp
+++ b/core/debugger/remote_debugger.cpp
@@ -354,18 +354,18 @@ struct RemoteDebugger::VisualProfiler {
Map<StringName, ServerInfo> server_data;
void toggle(bool p_enable, const Array &p_opts) {
- VS::get_singleton()->set_frame_profiling_enabled(p_enable);
+ RS::get_singleton()->set_frame_profiling_enabled(p_enable);
}
void add(const Array &p_data) {}
void tick(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) {
- Vector<VS::FrameProfileArea> profile_areas = VS::get_singleton()->get_frame_profile();
+ Vector<RS::FrameProfileArea> profile_areas = RS::get_singleton()->get_frame_profile();
DebuggerMarshalls::VisualProfilerFrame frame;
if (!profile_areas.size())
return;
- frame.frame_number = VS::get_singleton()->get_frame_profile_frame();
+ frame.frame_number = RS::get_singleton()->get_frame_profile_frame();
frame.areas.append_array(profile_areas);
EngineDebugger::get_singleton()->send_message("visual:profile_frame", frame.serialize());
}
@@ -404,10 +404,10 @@ void RemoteDebugger::_send_resource_usage() {
DebuggerMarshalls::ResourceUsage usage;
- List<VS::TextureInfo> tinfo;
- VS::get_singleton()->texture_debug_usage(&tinfo);
+ List<RS::TextureInfo> tinfo;
+ RS::get_singleton()->texture_debug_usage(&tinfo);
- for (List<VS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) {
+ for (List<RS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) {
DebuggerMarshalls::ResourceInfo info;
info.path = E->get().path;
@@ -771,9 +771,9 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
// This is for the camera override to stay live even when the game is paused from the editor
loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f;
- VisualServer::get_singleton()->sync();
- if (VisualServer::get_singleton()->has_changed()) {
- VisualServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
+ RenderingServer::get_singleton()->sync();
+ if (RenderingServer::get_singleton()->has_changed()) {
+ RenderingServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
}
}
diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h
index b446828128..a503492595 100644
--- a/drivers/dummy/rasterizer_dummy.h
+++ b/drivers/dummy/rasterizer_dummy.h
@@ -35,8 +35,8 @@
#include "core/rid_owner.h"
#include "core/self_list.h"
#include "scene/resources/mesh.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
class RasterizerSceneDummy : public RasterizerScene {
public:
@@ -55,7 +55,7 @@ public:
RID sky_create() { return RID(); }
void sky_set_radiance_size(RID p_sky, int p_radiance_size) {}
- void sky_set_mode(RID p_sky, VS::SkyMode p_samples) {}
+ void sky_set_mode(RID p_sky, RS::SkyMode p_samples) {}
void sky_set_texture(RID p_sky, RID p_panorama) {}
void sky_set_texture(RID p_sky, RID p_cube_map, int p_radiance_size) {}
void sky_set_material(RID p_sky, RID p_material) {}
@@ -64,28 +64,28 @@ public:
RID environment_create() { return RID(); }
- void environment_set_background(RID p_env, VS::EnvironmentBG p_bg) {}
+ void environment_set_background(RID p_env, RS::EnvironmentBG p_bg) {}
void environment_set_sky(RID p_env, RID p_sky) {}
void environment_set_sky_custom_fov(RID p_env, float p_scale) {}
void environment_set_sky_orientation(RID p_env, const Basis &p_orientation) {}
void environment_set_bg_color(RID p_env, const Color &p_color) {}
void environment_set_bg_energy(RID p_env, float p_energy) {}
void environment_set_canvas_max_layer(RID p_env, int p_max_layer) {}
- void environment_set_ambient_light(RID p_env, const Color &p_color, VS::EnvironmentAmbientSource p_ambient = VS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, VS::EnvironmentReflectionSource p_reflection_source = VS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) {}
+ void environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient = RS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, RS::EnvironmentReflectionSource p_reflection_source = RS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) {}
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
void environment_set_camera_feed_id(RID p_env, int p_camera_feed_id) {}
#endif
- void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {}
+ void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {}
void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) {}
void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) {}
- virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {}
- virtual void environment_set_ssao_quality(VS::EnvironmentSSAOQuality p_quality, bool p_half_size) {}
+ virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {}
+ virtual void environment_set_ssao_quality(RS::EnvironmentSSAOQuality p_quality, bool p_half_size) {}
- void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {}
+ void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {}
void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) {}
@@ -94,13 +94,13 @@ public:
void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) {}
bool is_environment(RID p_env) const { return false; }
- VS::EnvironmentBG environment_get_background(RID p_env) const { return VS::ENV_BG_KEEP; }
+ RS::EnvironmentBG environment_get_background(RID p_env) const { return RS::ENV_BG_KEEP; }
int environment_get_canvas_max_layer(RID p_env) const { return 0; }
virtual RID camera_effects_create() { return RID(); }
- virtual void camera_effects_set_dof_blur_quality(VS::DOFBlurQuality p_quality, bool p_use_jitter) {}
- virtual void camera_effects_set_dof_blur_bokeh_shape(VS::DOFBokehShape p_shape) {}
+ virtual void camera_effects_set_dof_blur_quality(RS::DOFBlurQuality p_quality, bool p_use_jitter) {}
+ virtual void camera_effects_set_dof_blur_bokeh_shape(RS::DOFBokehShape p_shape) {}
virtual void camera_effects_set_dof_blur(RID p_camera_effects, bool p_far_enable, float p_far_distance, float p_far_transition, bool p_near_enable, float p_near_distance, float p_near_transition, float p_amount) {}
virtual void camera_effects_set_custom_exposure(RID p_camera_effects, bool p_enable, float p_exposure) {}
@@ -133,10 +133,10 @@ public:
void set_scene_pass(uint64_t p_pass) {}
virtual void set_time(double p_time, double p_step) {}
- void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) {}
+ void set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw) {}
virtual RID render_buffers_create() { return RID(); }
- virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, VS::ViewportMSAA p_msaa) {}
+ virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa) {}
virtual void screen_space_roughness_limiter_set_active(bool p_enable, float p_curve) {}
virtual bool screen_space_roughness_limiter_is_active() const { return false; }
@@ -162,7 +162,7 @@ public:
struct DummySurface {
uint32_t format;
- VS::PrimitiveType primitive;
+ RS::PrimitiveType primitive;
Vector<uint8_t> array;
int vertex_count;
Vector<uint8_t> index_array;
@@ -175,14 +175,14 @@ public:
struct DummyMesh {
Vector<DummySurface> surfaces;
int blend_shape_count;
- VS::BlendShapeMode blend_shape_mode;
+ RS::BlendShapeMode blend_shape_mode;
};
mutable RID_PtrOwner<DummyTexture> texture_owner;
mutable RID_PtrOwner<DummyMesh> mesh_owner;
virtual RID texture_2d_create(const Ref<Image> &p_image) { return RID(); }
- virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, VS::TextureLayeredType p_layered_type) { return RID(); }
+ virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type) { return RID(); }
virtual RID texture_3d_create(const Vector<Ref<Image>> &p_slices) { return RID(); }
virtual RID texture_proxy_create(RID p_base) { return RID(); }
@@ -209,11 +209,11 @@ public:
virtual void texture_set_path(RID p_texture, const String &p_path) {}
virtual String texture_get_path(RID p_texture) const { return String(); }
- virtual void texture_set_detect_3d_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) {}
- virtual void texture_set_detect_normal_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) {}
- virtual void texture_set_detect_roughness_callback(RID p_texture, VS::TextureDetectRoughnessCallback p_callback, void *p_userdata) {}
+ virtual void texture_set_detect_3d_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) {}
+ virtual void texture_set_detect_normal_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) {}
+ virtual void texture_set_detect_roughness_callback(RID p_texture, RS::TextureDetectRoughnessCallback p_callback, void *p_userdata) {}
- virtual void texture_debug_usage(List<VS::TextureInfo> *r_info) {}
+ virtual void texture_debug_usage(List<RS::TextureInfo> *r_info) {}
virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) {}
virtual Size2 texture_size_with_proxy(RID p_proxy) { return Size2(); }
@@ -225,7 +225,7 @@ public:
return texture_owner.make_rid(texture);
}
- void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, VisualServer::TextureType p_type = VS::TEXTURE_TYPE_2D, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT) {
+ void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, RenderingServer::TextureType p_type = RS::TEXTURE_TYPE_2D, uint32_t p_flags = RS::TEXTURE_FLAGS_DEFAULT) {
DummyTexture *t = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!t);
t->width = p_width;
@@ -278,7 +278,7 @@ public:
return t->format;
}
- VisualServer::TextureType texture_get_type(RID p_texture) const { return VS::TEXTURE_TYPE_2D; }
+ RenderingServer::TextureType texture_get_type(RID p_texture) const { return RS::TEXTURE_TYPE_2D; }
uint32_t texture_get_texid(RID p_texture) const { return 0; }
uint32_t texture_get_width(RID p_texture) const { return 0; }
uint32_t texture_get_height(RID p_texture) const { return 0; }
@@ -299,13 +299,13 @@ public:
void texture_set_shrink_all_x2_on_set_data(bool p_enable) {}
- void texture_debug_usage(List<VS::TextureInfo> *r_info) {}
+ void texture_debug_usage(List<RS::TextureInfo> *r_info) {}
RID texture_create_radiance_cubemap(RID p_source, int p_resolution = -1) const { return RID(); }
- void texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {}
- void texture_set_detect_srgb_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {}
- void texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {}
+ void texture_set_detect_3d_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata) {}
+ void texture_set_detect_srgb_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata) {}
+ void texture_set_detect_normal_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata) {}
void textures_keep_original(bool p_enable) {}
@@ -353,14 +353,14 @@ public:
DummyMesh *mesh = memnew(DummyMesh);
ERR_FAIL_COND_V(!mesh, RID());
mesh->blend_shape_count = 0;
- mesh->blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED;
+ mesh->blend_shape_mode = RS::BLEND_SHAPE_MODE_NORMALIZED;
return mesh_owner.make_rid(mesh);
}
- void mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_surface) {}
+ void mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) {}
#if 0
- void mesh_add_surface(RID p_mesh, uint32_t p_format, VS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t> > &p_blend_shapes = Vector<Vector<uint8_t> >(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>()) {
+ void mesh_add_surface(RID p_mesh, uint32_t p_format, RS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t> > &p_blend_shapes = Vector<Vector<uint8_t> >(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>()) {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!m);
@@ -390,14 +390,14 @@ public:
return m->blend_shape_count;
}
- void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) {
+ void mesh_set_blend_shape_mode(RID p_mesh, RS::BlendShapeMode p_mode) {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!m);
m->blend_shape_mode = p_mode;
}
- VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const {
+ RS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const {
DummyMesh *m = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!m, VS::BLEND_SHAPE_MODE_NORMALIZED);
+ ERR_FAIL_COND_V(!m, RS::BLEND_SHAPE_MODE_NORMALIZED);
return m->blend_shape_mode;
}
@@ -439,9 +439,9 @@ public:
return m->surfaces[p_surface].format;
}
- VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const {
+ RS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const {
DummyMesh *m = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!m, VS::PRIMITIVE_POINTS);
+ ERR_FAIL_COND_V(!m, RS::PRIMITIVE_POINTS);
return m->surfaces[p_surface].primitive;
}
@@ -474,7 +474,7 @@ public:
}
#endif
- VS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const { return VS::SurfaceData(); }
+ RS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const { return RS::SurfaceData(); }
int mesh_get_surface_count(RID p_mesh) const {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND_V(!m, 0);
@@ -491,7 +491,7 @@ public:
virtual RID multimesh_create() { return RID(); }
- virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false) {}
+ virtual void multimesh_allocate(RID p_multimesh, int p_instances, RS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false) {}
int multimesh_get_instance_count(RID p_multimesh) const { return 0; }
void multimesh_set_mesh(RID p_multimesh, RID p_mesh) {}
@@ -516,7 +516,7 @@ public:
/* IMMEDIATE API */
RID immediate_create() { return RID(); }
- void immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture = RID()) {}
+ void immediate_begin(RID p_immediate, RS::PrimitiveType p_rimitive, RID p_texture = RID()) {}
void immediate_vertex(RID p_immediate, const Vector3 &p_vertex) {}
void immediate_normal(RID p_immediate, const Vector3 &p_normal) {}
void immediate_tangent(RID p_immediate, const Plane &p_tangent) {}
@@ -543,14 +543,14 @@ public:
/* Light API */
- RID light_create(VS::LightType p_type) { return RID(); }
+ RID light_create(RS::LightType p_type) { return RID(); }
- RID directional_light_create() { return light_create(VS::LIGHT_DIRECTIONAL); }
- RID omni_light_create() { return light_create(VS::LIGHT_OMNI); }
- RID spot_light_create() { return light_create(VS::LIGHT_SPOT); }
+ RID directional_light_create() { return light_create(RS::LIGHT_DIRECTIONAL); }
+ RID omni_light_create() { return light_create(RS::LIGHT_OMNI); }
+ RID spot_light_create() { return light_create(RS::LIGHT_SPOT); }
void light_set_color(RID p_light, const Color &p_color) {}
- void light_set_param(RID p_light, VS::LightParam p_param, float p_value) {}
+ void light_set_param(RID p_light, RS::LightParam p_param, float p_value) {}
void light_set_shadow(RID p_light, bool p_enabled) {}
void light_set_shadow_color(RID p_light, const Color &p_color) {}
void light_set_projector(RID p_light, RID p_texture) {}
@@ -559,22 +559,22 @@ public:
void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) {}
void light_set_use_gi(RID p_light, bool p_enabled) {}
- void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {}
+ void light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode) {}
- void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) {}
+ void light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode) {}
void light_directional_set_blend_splits(RID p_light, bool p_enable) {}
bool light_directional_get_blend_splits(RID p_light) const { return false; }
- void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode) {}
- VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const { return VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE; }
+ void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) {}
+ RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const { return RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE; }
- VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) { return VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL; }
- VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) { return VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID; }
+ RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) { return RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL; }
+ RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) { return RS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID; }
bool light_has_shadow(RID p_light) const { return false; }
- VS::LightType light_get_type(RID p_light) const { return VS::LIGHT_OMNI; }
+ RS::LightType light_get_type(RID p_light) const { return RS::LIGHT_OMNI; }
AABB light_get_aabb(RID p_light) const { return AABB(); }
- float light_get_param(RID p_light, VS::LightParam p_param) { return 0.0; }
+ float light_get_param(RID p_light, RS::LightParam p_param) { return 0.0; }
Color light_get_color(RID p_light) { return Color(); }
bool light_get_use_gi(RID p_light) { return false; }
uint64_t light_get_version(RID p_light) const { return 0; }
@@ -583,7 +583,7 @@ public:
RID reflection_probe_create() { return RID(); }
- void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode) {}
+ void reflection_probe_set_update_mode(RID p_probe, RS::ReflectionProbeUpdateMode p_mode) {}
void reflection_probe_set_intensity(RID p_probe, float p_intensity) {}
void reflection_probe_set_interior_ambient(RID p_probe, const Color &p_ambient) {}
void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy) {}
@@ -598,7 +598,7 @@ public:
void reflection_probe_set_resolution(RID p_probe, int p_resolution) {}
AABB reflection_probe_get_aabb(RID p_probe) const { return AABB(); }
- VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const { return VisualServer::REFLECTION_PROBE_UPDATE_ONCE; }
+ RS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const { return RenderingServer::REFLECTION_PROBE_UPDATE_ONCE; }
uint32_t reflection_probe_get_cull_mask(RID p_probe) const { return 0; }
Vector3 reflection_probe_get_extents(RID p_probe) const { return Vector3(); }
Vector3 reflection_probe_get_origin_offset(RID p_probe) const { return Vector3(); }
@@ -742,7 +742,7 @@ public:
void particles_set_fractional_delta(RID p_particles, bool p_enable) {}
void particles_restart(RID p_particles) {}
- void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) {}
+ void particles_set_draw_order(RID p_particles, RS::ParticlesDrawOrder p_order) {}
void particles_set_draw_passes(RID p_particles, int p_count) {}
void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) {}
@@ -776,12 +776,12 @@ public:
virtual void render_target_disable_clear_request(RID p_render_target) {}
virtual void render_target_do_clear_request(RID p_render_target) {}
- VS::InstanceType get_base_type(RID p_rid) const {
+ RS::InstanceType get_base_type(RID p_rid) const {
if (mesh_owner.owns(p_rid)) {
- return VS::INSTANCE_MESH;
+ return RS::INSTANCE_MESH;
}
- return VS::INSTANCE_NONE;
+ return RS::INSTANCE_NONE;
}
bool free(RID p_rid) {
@@ -803,9 +803,9 @@ public:
void render_info_begin_capture() {}
void render_info_end_capture() {}
- int get_captured_render_info(VS::RenderInfo p_info) { return 0; }
+ int get_captured_render_info(RS::RenderInfo p_info) { return 0; }
- int get_render_info(VS::RenderInfo p_info) { return 0; }
+ int get_render_info(RS::RenderInfo p_info) { return 0; }
String get_video_adapter_name() const { return String(); }
String get_video_adapter_vendor() const { return String(); }
@@ -825,7 +825,7 @@ public:
class RasterizerCanvasDummy : public RasterizerCanvas {
public:
- virtual TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VS::CanvasItemTextureFilter p_filter, VS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) { return 0; }
+ virtual TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, RS::CanvasItemTextureFilter p_filter, RS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) { return 0; }
virtual void free_texture_binding(TextureBindingID p_binding) {}
virtual PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()) { return 0; }
@@ -841,7 +841,7 @@ public:
virtual RID occluder_polygon_create() { return RID(); }
virtual void occluder_polygon_set_shape_as_lines(RID p_occluder, const Vector<Vector2> &p_lines) {}
- virtual void occluder_polygon_set_cull_mode(RID p_occluder, VS::CanvasOccluderPolygonCullMode p_mode) {}
+ virtual void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) {}
void draw_window_margins(int *p_margins, RID *p_margin_textures) {}
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index 5e8948e9c4..734b4463ff 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -33,7 +33,7 @@
#include "core/os/os.h"
#include "core/project_settings.h"
#include "rasterizer_scene_gles2.h"
-#include "servers/visual/visual_server_raster.h"
+#include "servers/rendering/rendering_server_raster.h"
#ifndef GLES_OVER_GL
#define glClearDepth glClearDepthf
@@ -85,7 +85,7 @@ void RasterizerCanvasGLES2::_set_uniforms() {
state.canvas_shader.set_uniform(CanvasShaderGLES2::LIGHT_COLOR, light->color * light->energy);
state.canvas_shader.set_uniform(CanvasShaderGLES2::LIGHT_POS, light->light_shader_pos);
state.canvas_shader.set_uniform(CanvasShaderGLES2::LIGHT_HEIGHT, light->height);
- state.canvas_shader.set_uniform(CanvasShaderGLES2::LIGHT_OUTSIDE_ALPHA, light->mode == VS::CANVAS_LIGHT_MODE_MASK ? 1.0 : 0.0);
+ state.canvas_shader.set_uniform(CanvasShaderGLES2::LIGHT_OUTSIDE_ALPHA, light->mode == RS::CANVAS_LIGHT_MODE_MASK ? 1.0 : 0.0);
if (state.using_shadow) {
RasterizerStorageGLES2::CanvasLightShadow *cls = storage->canvas_light_shadow_owner.getornull(light->shadow_buffer);
@@ -152,8 +152,8 @@ void RasterizerCanvasGLES2::canvas_begin() {
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
// set up default uniforms
@@ -188,7 +188,7 @@ void RasterizerCanvasGLES2::canvas_end() {
glBindBuffer(GL_ARRAY_BUFFER, 0);
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
glDisableVertexAttribArray(i);
}
@@ -224,7 +224,7 @@ RasterizerStorageGLES2::Texture *RasterizerCanvasGLES2::_bind_canvas_texture(con
} else {
if (texture->redraw_if_visible) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
texture = texture->get_ptr();
@@ -266,7 +266,7 @@ RasterizerStorageGLES2::Texture *RasterizerCanvasGLES2::_bind_canvas_texture(con
} else {
if (normal_map->redraw_if_visible) { //check before proxy, because this is usually used with proxies
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
normal_map = normal_map->get_ptr();
@@ -299,47 +299,47 @@ void RasterizerCanvasGLES2::_draw_polygon(const int *p_indices, int p_index_coun
uint32_t buffer_ofs = 0;
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector2) * p_vertex_count, p_vertices);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
buffer_ofs += sizeof(Vector2) * p_vertex_count;
if (p_singlecolor) {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
Color m = *p_colors;
- glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
+ glVertexAttrib4f(RS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
} else if (!p_colors) {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} else {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
- glEnableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttribPointer(RS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(Color) * p_vertex_count;
}
if (p_uvs) {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(Vector2) * p_vertex_count;
} else {
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV);
}
if (p_weights && p_bones) {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(float) * 4 * p_vertex_count, p_weights);
- glEnableVertexAttribArray(VS::ARRAY_WEIGHTS);
- glVertexAttribPointer(VS::ARRAY_WEIGHTS, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4, CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_WEIGHTS);
+ glVertexAttribPointer(RS::ARRAY_WEIGHTS, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4, CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(float) * 4 * p_vertex_count;
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(int) * 4 * p_vertex_count, p_bones);
- glEnableVertexAttribArray(VS::ARRAY_BONES);
- glVertexAttribPointer(VS::ARRAY_BONES, 4, GL_UNSIGNED_INT, GL_FALSE, sizeof(int) * 4, CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_BONES);
+ glVertexAttribPointer(RS::ARRAY_BONES, 4, GL_UNSIGNED_INT, GL_FALSE, sizeof(int) * 4, CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(int) * 4 * p_vertex_count;
} else {
- glDisableVertexAttribArray(VS::ARRAY_WEIGHTS);
- glDisableVertexAttribArray(VS::ARRAY_BONES);
+ glDisableVertexAttribArray(RS::ARRAY_WEIGHTS);
+ glDisableVertexAttribArray(RS::ARRAY_BONES);
}
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
@@ -375,30 +375,30 @@ void RasterizerCanvasGLES2::_draw_generic(GLuint p_primitive, int p_vertex_count
uint32_t buffer_ofs = 0;
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector2) * p_vertex_count, p_vertices);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
buffer_ofs += sizeof(Vector2) * p_vertex_count;
if (p_singlecolor) {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
Color m = *p_colors;
- glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
+ glVertexAttrib4f(RS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
} else if (!p_colors) {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} else {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
- glEnableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttribPointer(RS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(Color) * p_vertex_count;
}
if (p_uvs) {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
} else {
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV);
}
glDrawArrays(p_primitive, 0, p_vertex_count);
@@ -417,31 +417,31 @@ void RasterizerCanvasGLES2::_draw_generic_indices(GLuint p_primitive, const int
uint32_t buffer_ofs = 0;
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector2) * p_vertex_count, p_vertices);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
buffer_ofs += sizeof(Vector2) * p_vertex_count;
if (p_singlecolor) {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
Color m = *p_colors;
- glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
+ glVertexAttrib4f(RS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
} else if (!p_colors) {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} else {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
- glEnableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttribPointer(RS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(Color) * p_vertex_count;
}
if (p_uvs) {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
buffer_ofs += sizeof(Vector2) * p_vertex_count;
} else {
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV);
}
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
@@ -514,16 +514,16 @@ void RasterizerCanvasGLES2::_draw_gui_primitive(int p_points, const Vector2 *p_v
#endif
glBufferSubData(GL_ARRAY_BUFFER, 0, p_points * stride * 4 * sizeof(float), buffer_data);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), NULL);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), NULL);
if (p_colors) {
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, stride * sizeof(float), CAST_INT_TO_UCHAR_PTR(color_offset * sizeof(float)));
- glEnableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttribPointer(RS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, stride * sizeof(float), CAST_INT_TO_UCHAR_PTR(color_offset * sizeof(float)));
+ glEnableVertexAttribArray(RS::ARRAY_COLOR);
}
if (p_uvs) {
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), CAST_INT_TO_UCHAR_PTR(uv_offset * sizeof(float)));
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), CAST_INT_TO_UCHAR_PTR(uv_offset * sizeof(float)));
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
}
glDrawArrays(prim[p_points], 0, p_points);
@@ -564,8 +564,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
_bind_canvas_texture(RID(), RID());
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttrib4fv(VS::ARRAY_COLOR, line->color.components);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttrib4fv(RS::ARRAY_COLOR, line->color.components);
state.canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX, state.uniforms.modelview_matrix);
@@ -616,8 +616,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
Item::CommandRect *r = static_cast<Item::CommandRect *>(command);
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttrib4fv(VS::ARRAY_COLOR, r->modulate.components);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttrib4fv(RS::ARRAY_COLOR, r->modulate.components);
bool can_tile = true;
if (r->texture.is_valid() && r->flags & CANVAS_RECT_TILE && !storage->config.support_npot_repeat_mipmap) {
@@ -696,7 +696,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
bool untile = false;
- if (can_tile && r->flags & CANVAS_RECT_TILE && !(texture->flags & VS::TEXTURE_FLAG_REPEAT)) {
+ if (can_tile && r->flags & CANVAS_RECT_TILE && !(texture->flags & RS::TEXTURE_FLAG_REPEAT)) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
untile = true;
@@ -753,7 +753,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
bool untile = false;
- if (can_tile && r->flags & CANVAS_RECT_TILE && !(tex->flags & VS::TEXTURE_FLAG_REPEAT)) {
+ if (can_tile && r->flags & CANVAS_RECT_TILE && !(tex->flags & RS::TEXTURE_FLAG_REPEAT)) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
untile = true;
@@ -816,8 +816,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
state.canvas_shader.use_material((void *)p_material);
}
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
- glVertexAttrib4fv(VS::ARRAY_COLOR, np->color.components);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
+ glVertexAttrib4fv(RS::ARRAY_COLOR, np->color.components);
RasterizerStorageGLES2::Texture *tex = _bind_canvas_texture(np->texture, np->normal_map);
@@ -968,11 +968,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.ninepatch_elements);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), NULL);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), CAST_INT_TO_UCHAR_PTR((sizeof(float) * 2)));
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), NULL);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), CAST_INT_TO_UCHAR_PTR((sizeof(float) * 2)));
glDrawElements(GL_TRIANGLES, 18 * 3 - (np->draw_center ? 0 : 6), GL_UNSIGNED_BYTE, NULL);
@@ -1072,18 +1072,18 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int k = 0; k < VS::ARRAY_MAX - 1; k++) {
+ for (int k = 0; k < RS::ARRAY_MAX - 1; k++) {
if (s->attribs[k].enabled) {
glEnableVertexAttribArray(k);
glVertexAttribPointer(s->attribs[k].index, s->attribs[k].size, s->attribs[k].type, s->attribs[k].normalized, s->attribs[k].stride, CAST_INT_TO_UCHAR_PTR(s->attribs[k].offset));
} else {
glDisableVertexAttribArray(k);
switch (k) {
- case VS::ARRAY_NORMAL: {
- glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
+ case RS::ARRAY_NORMAL: {
+ glVertexAttrib4f(RS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
- case VS::ARRAY_COLOR: {
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ case RS::ARRAY_COLOR: {
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} break;
default: {
@@ -1099,7 +1099,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
}
- for (int j = 1; j < VS::ARRAY_MAX - 1; j++) {
+ for (int j = 1; j < RS::ARRAY_MAX - 1; j++) {
glDisableVertexAttribArray(j);
}
}
@@ -1118,7 +1118,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
if (!mesh_data)
break;
- state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_INSTANCE_CUSTOM, multi_mesh->custom_data_format != VS::MULTIMESH_CUSTOM_DATA_NONE);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_INSTANCE_CUSTOM, multi_mesh->custom_data_format != RS::MULTIMESH_CUSTOM_DATA_NONE);
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_INSTANCING, true);
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_TEXTURE_RECT, false);
@@ -1162,18 +1162,18 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int k = 0; k < VS::ARRAY_MAX - 1; k++) {
+ for (int k = 0; k < RS::ARRAY_MAX - 1; k++) {
if (s->attribs[k].enabled) {
glEnableVertexAttribArray(k);
glVertexAttribPointer(s->attribs[k].index, s->attribs[k].size, s->attribs[k].type, s->attribs[k].normalized, s->attribs[k].stride, CAST_INT_TO_UCHAR_PTR(s->attribs[k].offset));
} else {
glDisableVertexAttribArray(k);
switch (k) {
- case VS::ARRAY_NORMAL: {
- glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
+ case RS::ARRAY_NORMAL: {
+ glVertexAttrib4f(RS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
- case VS::ARRAY_COLOR: {
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ case RS::ARRAY_COLOR: {
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} break;
default: {
@@ -1189,7 +1189,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glVertexAttrib4fv(INSTANCE_ATTRIB_BASE + 0, &buffer[0]);
glVertexAttrib4fv(INSTANCE_ATTRIB_BASE + 1, &buffer[4]);
- if (multi_mesh->transform_format == VS::MULTIMESH_TRANSFORM_3D) {
+ if (multi_mesh->transform_format == RS::MULTIMESH_TRANSFORM_3D) {
glVertexAttrib4fv(INSTANCE_ATTRIB_BASE + 2, &buffer[8]);
} else {
glVertexAttrib4f(INSTANCE_ATTRIB_BASE + 2, 0.0, 0.0, 1.0, 0.0);
@@ -1197,7 +1197,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
if (multi_mesh->color_floats) {
- if (multi_mesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
+ if (multi_mesh->color_format == RS::MULTIMESH_COLOR_8BIT) {
uint8_t *color_data = (uint8_t *)(buffer + color_ofs);
glVertexAttrib4f(INSTANCE_ATTRIB_BASE + 3, color_data[0] / 255.0, color_data[1] / 255.0, color_data[2] / 255.0, color_data[3] / 255.0);
} else {
@@ -1208,7 +1208,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
if (multi_mesh->custom_data_floats) {
- if (multi_mesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_8BIT) {
+ if (multi_mesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_8BIT) {
uint8_t *custom_data = (uint8_t *)(buffer + custom_data_ofs);
glVertexAttrib4f(INSTANCE_ATTRIB_BASE + 4, custom_data[0] / 255.0, custom_data[1] / 255.0, custom_data[2] / 255.0, custom_data[3] / 255.0);
} else {
@@ -1301,9 +1301,9 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
if (primitive->colors.size() == 1 && primitive->points.size() > 1) {
Color c = primitive->colors[0];
- glVertexAttrib4f(VS::ARRAY_COLOR, c.r, c.g, c.b, c.a);
+ glVertexAttrib4f(RS::ARRAY_COLOR, c.r, c.g, c.b, c.a);
} else if (primitive->colors.empty()) {
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
}
_draw_gui_primitive(primitive->points.size(), primitive->points.ptr(), primitive->colors.ptr(), primitive->uvs.ptr());
@@ -1518,7 +1518,7 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
if (material_ptr) {
shader_ptr = material_ptr->shader;
- if (shader_ptr && shader_ptr->mode != VS::SHADER_CANVAS_ITEM) {
+ if (shader_ptr && shader_ptr->mode != RS::SHADER_CANVAS_ITEM) {
shader_ptr = NULL; // not a canvas item shader, don't use.
}
}
@@ -1542,7 +1542,7 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
if (shader_ptr != shader_cache) {
if (shader_ptr->canvas_item.uses_time) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id);
@@ -1582,7 +1582,7 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
}
if (t->redraw_if_visible) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
t = t->get_ptr();
@@ -1682,7 +1682,7 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
Light *light = p_light;
bool light_used = false;
- VS::CanvasLightMode mode = VS::CANVAS_LIGHT_MODE_ADD;
+ RS::CanvasLightMode mode = RS::CANVAS_LIGHT_MODE_ADD;
state.uniforms.final_modulate = ci->final_modulate; // remove the canvas modulate
while (light) {
@@ -1697,17 +1697,17 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
switch (mode) {
- case VS::CANVAS_LIGHT_MODE_ADD: {
+ case RS::CANVAS_LIGHT_MODE_ADD: {
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
} break;
- case VS::CANVAS_LIGHT_MODE_SUB: {
+ case RS::CANVAS_LIGHT_MODE_SUB: {
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
} break;
- case VS::CANVAS_LIGHT_MODE_MIX:
- case VS::CANVAS_LIGHT_MODE_MASK: {
+ case RS::CANVAS_LIGHT_MODE_MIX:
+ case RS::CANVAS_LIGHT_MODE_MASK: {
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1726,12 +1726,12 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_SHADOWS, has_shadow);
if (has_shadow) {
state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_USE_GRADIENT, light->shadow_gradient_length > 0);
- state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_NEAREST, light->shadow_filter == VS::CANVAS_LIGHT_FILTER_NONE);
- state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF3, light->shadow_filter == VS::CANVAS_LIGHT_FILTER_PCF3);
- state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF5, light->shadow_filter == VS::CANVAS_LIGHT_FILTER_PCF5);
- state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF7, light->shadow_filter == VS::CANVAS_LIGHT_FILTER_PCF7);
- state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF9, light->shadow_filter == VS::CANVAS_LIGHT_FILTER_PCF9);
- state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF13, light->shadow_filter == VS::CANVAS_LIGHT_FILTER_PCF13);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_NEAREST, light->shadow_filter == RS::CANVAS_LIGHT_FILTER_NONE);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF3, light->shadow_filter == RS::CANVAS_LIGHT_FILTER_PCF3);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF5, light->shadow_filter == RS::CANVAS_LIGHT_FILTER_PCF5);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF7, light->shadow_filter == RS::CANVAS_LIGHT_FILTER_PCF7);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF9, light->shadow_filter == RS::CANVAS_LIGHT_FILTER_PCF9);
+ state.canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_FILTER_PCF13, light->shadow_filter == RS::CANVAS_LIGHT_FILTER_PCF13);
}
state.canvas_shader.bind();
@@ -1846,7 +1846,7 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons
glClearColor(1, 1, 1, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- VS::CanvasOccluderPolygonCullMode cull = VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
+ RS::CanvasOccluderPolygonCullMode cull = RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
for (int i = 0; i < 4; i++) {
@@ -1903,31 +1903,31 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons
state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES2::WORLD_MATRIX, instance->xform_cache);
- VS::CanvasOccluderPolygonCullMode transformed_cull_cache = instance->cull_cache;
+ RS::CanvasOccluderPolygonCullMode transformed_cull_cache = instance->cull_cache;
- if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
+ if (transformed_cull_cache != RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
(p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
transformed_cull_cache =
- transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
- VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
- VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
+ transformed_cull_cache == RS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
+ RS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
+ RS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
}
if (cull != transformed_cull_cache) {
cull = transformed_cull_cache;
switch (cull) {
- case VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: {
+ case RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: {
glDisable(GL_CULL_FACE);
} break;
- case VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE: {
+ case RS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE: {
glEnable(GL_CULL_FACE);
glCullFace(GL_FRONT);
} break;
- case VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE: {
+ case RS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE: {
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
@@ -1937,8 +1937,8 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons
}
glBindBuffer(GL_ARRAY_BUFFER, cc->vertex_id);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cc->index_id);
glDrawElements(GL_TRIANGLES, cc->len * 3, GL_UNSIGNED_SHORT, 0);
@@ -1979,8 +1979,8 @@ void RasterizerCanvasGLES2::reset_canvas() {
void RasterizerCanvasGLES2::_bind_quad_buffer() {
glBindBuffer(GL_ARRAY_BUFFER, data.canvas_quad_vertices);
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, 0, NULL);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, 0, NULL);
}
void RasterizerCanvasGLES2::draw_generic_textured_rect(const Rect2 &p_rect, const Rect2 &p_src) {
@@ -2022,7 +2022,7 @@ void RasterizerCanvasGLES2::draw_lens_distortion_rect(const Rect2 &p_rect, float
// and cleanup
glBindBuffer(GL_ARRAY_BUFFER, 0);
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
glDisableVertexAttribArray(i);
}
}
diff --git a/drivers/gles2/rasterizer_canvas_gles2.h b/drivers/gles2/rasterizer_canvas_gles2.h
index f6ae6a60c0..4e4db98c25 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.h
+++ b/drivers/gles2/rasterizer_canvas_gles2.h
@@ -32,7 +32,7 @@
#define RASTERIZERCANVASGLES2_H
#include "rasterizer_storage_gles2.h"
-#include "servers/visual/rasterizer.h"
+#include "servers/rendering/rasterizer.h"
#include "shaders/canvas.glsl.gen.h"
#include "shaders/lens_distorted.glsl.gen.h"
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index f14c5f9406..cc17af171e 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -263,7 +263,7 @@ void RasterizerGLES2::initialize() {
#endif // GLES_OVER_GL
#endif // CAN_DEBUG
- print_line("OpenGL ES 2.0 Renderer: " + VisualServer::get_singleton()->get_video_adapter_name());
+ print_line("OpenGL ES 2.0 Renderer: " + RenderingServer::get_singleton()->get_video_adapter_name());
storage->initialize();
canvas->initialize();
scene->initialize();
@@ -359,7 +359,7 @@ void RasterizerGLES2::set_boot_image(const Ref<Image> &p_image, const Color &p_c
canvas->canvas_begin();
RID texture = storage->texture_create();
- storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), VS::TEXTURE_TYPE_2D, p_use_filter ? VS::TEXTURE_FLAG_FILTER : 0);
+ storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), RS::TEXTURE_TYPE_2D, p_use_filter ? RS::TEXTURE_FLAG_FILTER : 0);
storage->texture_set_data(texture, p_image);
Rect2 imgrect(0, 0, p_image->get_width(), p_image->get_height());
diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h
index 9a5501f13d..027a634ae8 100644
--- a/drivers/gles2/rasterizer_gles2.h
+++ b/drivers/gles2/rasterizer_gles2.h
@@ -34,7 +34,7 @@
#include "rasterizer_canvas_gles2.h"
#include "rasterizer_scene_gles2.h"
#include "rasterizer_storage_gles2.h"
-#include "servers/visual/rasterizer.h"
+#include "servers/rendering/rasterizer.h"
class RasterizerGLES2 : public Rasterizer {
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index 8872dde9fc..4bb8d5a16d 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -37,7 +37,7 @@
#include "core/vmap.h"
#include "rasterizer_canvas_gles2.h"
#include "servers/camera/camera_feed.h"
-#include "servers/visual/visual_server_raster.h"
+#include "servers/rendering/rendering_server_raster.h"
#ifndef GLES_OVER_GL
#define glClearDepth glClearDepthf
@@ -456,10 +456,10 @@ int RasterizerSceneGLES2::get_directional_light_shadow_size(RID p_light_intance)
ERR_FAIL_COND_V(!light_instance, 0);
switch (light_instance->light_ptr->directional_shadow_mode) {
- case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL:
+ case RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL:
break; //none
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS:
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS:
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS:
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS:
shadow_size /= 2;
break;
}
@@ -525,7 +525,7 @@ bool RasterizerSceneGLES2::reflection_probe_instance_needs_redraw(RID p_instance
const ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance);
ERR_FAIL_COND_V(!rpi, false);
- bool need_redraw = rpi->probe_ptr->resolution != rpi->current_resolution || rpi->dirty || rpi->probe_ptr->update_mode == VS::REFLECTION_PROBE_UPDATE_ALWAYS;
+ bool need_redraw = rpi->probe_ptr->resolution != rpi->current_resolution || rpi->dirty || rpi->probe_ptr->update_mode == RS::REFLECTION_PROBE_UPDATE_ALWAYS;
rpi->dirty = false;
return need_redraw;
}
@@ -610,7 +610,7 @@ bool RasterizerSceneGLES2::reflection_probe_instance_postprocess_step(RID p_inst
glDisable(GL_BLEND);
glDepthMask(GL_FALSE);
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX - 1; i++) {
glDisableVertexAttribArray(i);
}
}
@@ -690,7 +690,7 @@ RID RasterizerSceneGLES2::environment_create() {
return environment_owner.make_rid(env);
}
-void RasterizerSceneGLES2::environment_set_background(RID p_env, VS::EnvironmentBG p_bg) {
+void RasterizerSceneGLES2::environment_set_background(RID p_env, RS::EnvironmentBG p_bg) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -755,7 +755,7 @@ void RasterizerSceneGLES2::environment_set_camera_feed_id(RID p_env, int p_camer
env->camera_feed_id = p_camera_feed_id;
}
-void RasterizerSceneGLES2::environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality) {
+void RasterizerSceneGLES2::environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -767,7 +767,7 @@ void RasterizerSceneGLES2::environment_set_dof_blur_far(RID p_env, bool p_enable
env->dof_blur_far_quality = p_quality;
}
-void RasterizerSceneGLES2::environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality) {
+void RasterizerSceneGLES2::environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -779,7 +779,7 @@ void RasterizerSceneGLES2::environment_set_dof_blur_near(RID p_env, bool p_enabl
env->dof_blur_near_quality = p_quality;
}
-void RasterizerSceneGLES2::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {
+void RasterizerSceneGLES2::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -806,12 +806,12 @@ void RasterizerSceneGLES2::environment_set_ssr(RID p_env, bool p_enable, int p_m
ERR_FAIL_COND(!env);
}
-void RasterizerSceneGLES2::environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, VS::EnvironmentSSAOQuality p_quality, VisualServer::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {
+void RasterizerSceneGLES2::environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::EnvironmentSSAOQuality p_quality, RenderingServer::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
}
-void RasterizerSceneGLES2::environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {
+void RasterizerSceneGLES2::environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {
Environment *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
}
@@ -866,9 +866,9 @@ bool RasterizerSceneGLES2::is_environment(RID p_env) {
return environment_owner.owns(p_env);
}
-VS::EnvironmentBG RasterizerSceneGLES2::environment_get_background(RID p_env) {
+RS::EnvironmentBG RasterizerSceneGLES2::environment_get_background(RID p_env) {
const Environment *env = environment_owner.getornull(p_env);
- ERR_FAIL_COND_V(!env, VS::ENV_BG_MAX);
+ ERR_FAIL_COND_V(!env, RS::ENV_BG_MAX);
return env->bg_mode;
}
@@ -914,7 +914,7 @@ void RasterizerSceneGLES2::light_instance_set_shadow_transform(RID p_light_insta
LightInstance *light_instance = light_instance_owner.getornull(p_light_instance);
ERR_FAIL_COND(!light_instance);
- if (light_instance->light_ptr->type != VS::LIGHT_DIRECTIONAL) {
+ if (light_instance->light_ptr->type != RS::LIGHT_DIRECTIONAL) {
p_pass = 0;
}
@@ -1022,7 +1022,7 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
if (!p_material->shader->spatial.uses_alpha_scissor && !p_material->shader->spatial.writes_modelview_or_projection && !p_material->shader->spatial.uses_vertex && !p_material->shader->spatial.uses_discard && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES2::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) {
//shader does not use discard and does not write a vertex position, use generic material
- if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
+ if (p_instance->cast_shadows == RS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
p_material = storage->material_owner.getornull(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material_twosided : default_material_twosided);
mirror = false;
} else {
@@ -1048,7 +1048,7 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
e->use_accum = false;
e->light_index = RenderList::MAX_LIGHTS;
e->use_accum_ptr = &e->use_accum;
- e->instancing = (e->instance->base_type == VS::INSTANCE_MULTIMESH) ? 1 : 0;
+ e->instancing = (e->instance->base_type == RS::INSTANCE_MULTIMESH) ? 1 : 0;
e->front_facing = false;
if (e->geometry->last_pass != render_pass) {
@@ -1162,7 +1162,7 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
//directional sort key
e->light_type1 = 1;
- e->light_type2 = li->light_ptr->type == VisualServer::LIGHT_OMNI ? 0 : 1;
+ e->light_type2 = li->light_ptr->type == RenderingServer::LIGHT_OMNI ? 0 : 1;
e->light_index = li->light_index;
copy = true;
@@ -1181,7 +1181,7 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
// do not add anything here, as lights are duplicated elements..
if (p_material->shader->spatial.uses_time) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
}
@@ -1224,7 +1224,7 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
switch (instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
RasterizerStorageGLES2::Mesh *mesh = storage->mesh_owner.getornull(instance->base);
ERR_CONTINUE(!mesh);
@@ -1241,7 +1241,7 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
RasterizerStorageGLES2::MultiMesh *multi_mesh = storage->multimesh_owner.getornull(instance->base);
ERR_CONTINUE(!multi_mesh);
@@ -1260,7 +1260,7 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
}
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
RasterizerStorageGLES2::Immediate *im = storage->immediate_owner.getornull(instance->base);
ERR_CONTINUE(!im);
@@ -1426,7 +1426,7 @@ bool RasterizerSceneGLES2::_setup_material(RasterizerStorageGLES2::Material *p_m
}
if (t->redraw_if_visible) { //must check before proxy because this is often used with proxies
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
t = t->get_ptr();
@@ -1459,7 +1459,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
switch (p_element->instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
RasterizerStorageGLES2::Surface *s = static_cast<RasterizerStorageGLES2::Surface *>(p_element->geometry);
glBindBuffer(GL_ARRAY_BUFFER, s->vertex_id);
@@ -1468,18 +1468,18 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX - 1; i++) {
if (s->attribs[i].enabled) {
glEnableVertexAttribArray(i);
glVertexAttribPointer(s->attribs[i].index, s->attribs[i].size, s->attribs[i].type, s->attribs[i].normalized, s->attribs[i].stride, CAST_INT_TO_UCHAR_PTR(s->attribs[i].offset));
} else {
glDisableVertexAttribArray(i);
switch (i) {
- case VS::ARRAY_NORMAL: {
- glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
+ case RS::ARRAY_NORMAL: {
+ glVertexAttrib4f(RS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
- case VS::ARRAY_COLOR: {
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ case RS::ARRAY_COLOR: {
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} break;
default: {
@@ -1502,7 +1502,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
Vector<float> &transform_buffer = storage->resources.skeleton_transform_cpu_buffer;
- if (!s->attribs[VS::ARRAY_BONES].enabled || !s->attribs[VS::ARRAY_WEIGHTS].enabled) {
+ if (!s->attribs[RS::ARRAY_BONES].enabled || !s->attribs[RS::ARRAY_WEIGHTS].enabled) {
break; // the whole instance has a skeleton, but this surface is not affected by it.
}
@@ -1511,10 +1511,10 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
transform_buffer.resize(s->array_len * 12);
}
- const size_t bones_offset = s->attribs[VS::ARRAY_BONES].offset;
- const size_t bones_stride = s->attribs[VS::ARRAY_BONES].stride;
- const size_t bone_weight_offset = s->attribs[VS::ARRAY_WEIGHTS].offset;
- const size_t bone_weight_stride = s->attribs[VS::ARRAY_WEIGHTS].stride;
+ const size_t bones_offset = s->attribs[RS::ARRAY_BONES].offset;
+ const size_t bones_stride = s->attribs[RS::ARRAY_BONES].stride;
+ const size_t bone_weight_offset = s->attribs[RS::ARRAY_WEIGHTS].offset;
+ const size_t bone_weight_stride = s->attribs[RS::ARRAY_WEIGHTS].stride;
{
float *write = transform_buffer.ptrw();
@@ -1530,7 +1530,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
size_t bones[4];
float bone_weight[4];
- if (s->attribs[VS::ARRAY_BONES].type == GL_UNSIGNED_BYTE) {
+ if (s->attribs[RS::ARRAY_BONES].type == GL_UNSIGNED_BYTE) {
// read as byte
const uint8_t *bones_ptr = vertex_data + bones_offset + (i * bones_stride);
bones[0] = bones_ptr[0];
@@ -1546,7 +1546,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
bones[3] = bones_ptr[3];
}
- if (s->attribs[VS::ARRAY_WEIGHTS].type == GL_FLOAT) {
+ if (s->attribs[RS::ARRAY_WEIGHTS].type == GL_FLOAT) {
// read as float
const float *weight_ptr = (const float *)(vertex_data + bone_weight_offset + (i * bone_weight_stride));
bone_weight[0] = weight_ptr[0];
@@ -1621,7 +1621,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
RasterizerStorageGLES2::Surface *s = static_cast<RasterizerStorageGLES2::Surface *>(p_element->geometry);
glBindBuffer(GL_ARRAY_BUFFER, s->vertex_id);
@@ -1630,18 +1630,18 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX - 1; i++) {
if (s->attribs[i].enabled) {
glEnableVertexAttribArray(i);
glVertexAttribPointer(s->attribs[i].index, s->attribs[i].size, s->attribs[i].type, s->attribs[i].normalized, s->attribs[i].stride, CAST_INT_TO_UCHAR_PTR(s->attribs[i].offset));
} else {
glDisableVertexAttribArray(i);
switch (i) {
- case VS::ARRAY_NORMAL: {
- glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
+ case RS::ARRAY_NORMAL: {
+ glVertexAttrib4f(RS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
- case VS::ARRAY_COLOR: {
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ case RS::ARRAY_COLOR: {
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
} break;
default: {
@@ -1662,7 +1662,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
} break;
default: {
@@ -1674,7 +1674,7 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
switch (p_element->instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
RasterizerStorageGLES2::Surface *s = static_cast<RasterizerStorageGLES2::Surface *>(p_element->geometry);
@@ -1688,22 +1688,22 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
storage->info.render.vertices_count += s->array_len;
}
/*
- if (p_element->instance->skeleton.is_valid() && s->attribs[VS::ARRAY_BONES].enabled && s->attribs[VS::ARRAY_WEIGHTS].enabled) {
+ if (p_element->instance->skeleton.is_valid() && s->attribs[RS::ARRAY_BONES].enabled && s->attribs[RS::ARRAY_WEIGHTS].enabled) {
//clean up after skeleton
glBindBuffer(GL_ARRAY_BUFFER, storage->resources.skeleton_transform_buffer);
- glDisableVertexAttribArray(VS::ARRAY_MAX + 0);
- glDisableVertexAttribArray(VS::ARRAY_MAX + 1);
- glDisableVertexAttribArray(VS::ARRAY_MAX + 2);
+ glDisableVertexAttribArray(RS::ARRAY_MAX + 0);
+ glDisableVertexAttribArray(RS::ARRAY_MAX + 1);
+ glDisableVertexAttribArray(RS::ARRAY_MAX + 2);
- glVertexAttrib4f(VS::ARRAY_MAX + 0, 1, 0, 0, 0);
- glVertexAttrib4f(VS::ARRAY_MAX + 1, 0, 1, 0, 0);
- glVertexAttrib4f(VS::ARRAY_MAX + 2, 0, 0, 1, 0);
+ glVertexAttrib4f(RS::ARRAY_MAX + 0, 1, 0, 0, 0);
+ glVertexAttrib4f(RS::ARRAY_MAX + 1, 0, 1, 0, 0);
+ glVertexAttrib4f(RS::ARRAY_MAX + 2, 0, 0, 1, 0);
}
*/
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
RasterizerStorageGLES2::MultiMesh *multi_mesh = static_cast<RasterizerStorageGLES2::MultiMesh *>(p_element->owner);
RasterizerStorageGLES2::Surface *s = static_cast<RasterizerStorageGLES2::Surface *>(p_element->geometry);
@@ -1734,7 +1734,7 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
}
if (multi_mesh->color_floats) {
- if (multi_mesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
+ if (multi_mesh->color_format == RS::MULTIMESH_COLOR_8BIT) {
uint8_t *color_data = (uint8_t *)(buffer + color_ofs);
glVertexAttrib4f(INSTANCE_ATTRIB_BASE + 3, color_data[0] / 255.0, color_data[1] / 255.0, color_data[2] / 255.0, color_data[3] / 255.0);
} else {
@@ -1745,7 +1745,7 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
}
if (multi_mesh->custom_data_floats) {
- if (multi_mesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_8BIT) {
+ if (multi_mesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_8BIT) {
uint8_t *custom_data = (uint8_t *)(buffer + custom_data_ofs);
glVertexAttrib4f(INSTANCE_ATTRIB_BASE + 4, custom_data[0] / 255.0, custom_data[1] / 255.0, custom_data[2] / 255.0, custom_data[3] / 255.0);
} else {
@@ -1764,7 +1764,7 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
const RasterizerStorageGLES2::Immediate *im = static_cast<const RasterizerStorageGLES2::Immediate *>(p_element->geometry);
if (im->building) {
@@ -1792,7 +1792,7 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
RasterizerStorageGLES2::Texture *t = storage->texture_owner.getornull(c.texture);
if (t->redraw_if_visible) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
t = t->get_ptr();
@@ -1816,53 +1816,53 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) {
}
if (!c.normals.empty()) {
- glEnableVertexAttribArray(VS::ARRAY_NORMAL);
+ glEnableVertexAttribArray(RS::ARRAY_NORMAL);
glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector3) * vertices, c.normals.ptr());
- glVertexAttribPointer(VS::ARRAY_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3), CAST_INT_TO_UCHAR_PTR(buf_ofs));
+ glVertexAttribPointer(RS::ARRAY_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3), CAST_INT_TO_UCHAR_PTR(buf_ofs));
buf_ofs += sizeof(Vector3) * vertices;
} else {
- glDisableVertexAttribArray(VS::ARRAY_NORMAL);
+ glDisableVertexAttribArray(RS::ARRAY_NORMAL);
}
if (!c.tangents.empty()) {
- glEnableVertexAttribArray(VS::ARRAY_TANGENT);
+ glEnableVertexAttribArray(RS::ARRAY_TANGENT);
glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Plane) * vertices, c.tangents.ptr());
- glVertexAttribPointer(VS::ARRAY_TANGENT, 4, GL_FLOAT, GL_FALSE, sizeof(Plane), CAST_INT_TO_UCHAR_PTR(buf_ofs));
+ glVertexAttribPointer(RS::ARRAY_TANGENT, 4, GL_FLOAT, GL_FALSE, sizeof(Plane), CAST_INT_TO_UCHAR_PTR(buf_ofs));
buf_ofs += sizeof(Plane) * vertices;
} else {
- glDisableVertexAttribArray(VS::ARRAY_TANGENT);
+ glDisableVertexAttribArray(RS::ARRAY_TANGENT);
}
if (!c.colors.empty()) {
- glEnableVertexAttribArray(VS::ARRAY_COLOR);
+ glEnableVertexAttribArray(RS::ARRAY_COLOR);
glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Color) * vertices, c.colors.ptr());
- glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buf_ofs));
+ glVertexAttribPointer(RS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buf_ofs));
buf_ofs += sizeof(Color) * vertices;
} else {
- glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glDisableVertexAttribArray(RS::ARRAY_COLOR);
}
if (!c.uvs.empty()) {
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector2) * vertices, c.uvs.ptr());
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buf_ofs));
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buf_ofs));
buf_ofs += sizeof(Vector2) * vertices;
} else {
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV);
}
if (!c.uv2s.empty()) {
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV2);
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV2);
glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector2) * vertices, c.uv2s.ptr());
- glVertexAttribPointer(VS::ARRAY_TEX_UV2, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buf_ofs));
+ glVertexAttribPointer(RS::ARRAY_TEX_UV2, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buf_ofs));
buf_ofs += sizeof(Vector2) * vertices;
} else {
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV2);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV2);
}
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
glBufferSubData(GL_ARRAY_BUFFER, buf_ofs, sizeof(Vector3) * vertices, c.vertices.ptr());
- glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3), CAST_INT_TO_UCHAR_PTR(buf_ofs));
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3), CAST_INT_TO_UCHAR_PTR(buf_ofs));
glDrawArrays(gl_primitive[c.primitive], 0, c.vertices.size());
}
@@ -1901,18 +1901,18 @@ void RasterizerSceneGLES2::_setup_light_type(LightInstance *p_light, ShadowAtlas
state.scene_shader.set_conditional(SceneShaderGLES2::USE_LIGHTING, true);
switch (p_light->light_ptr->type) {
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
state.scene_shader.set_conditional(SceneShaderGLES2::LIGHT_MODE_DIRECTIONAL, true);
switch (p_light->light_ptr->directional_shadow_mode) {
- case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: {
//no need
} break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: {
state.scene_shader.set_conditional(SceneShaderGLES2::LIGHT_USE_PSSM2, true);
} break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: {
state.scene_shader.set_conditional(SceneShaderGLES2::LIGHT_USE_PSSM4, true);
} break;
}
@@ -1931,7 +1931,7 @@ void RasterizerSceneGLES2::_setup_light_type(LightInstance *p_light, ShadowAtlas
}
} break;
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_OMNI: {
state.scene_shader.set_conditional(SceneShaderGLES2::LIGHT_MODE_OMNI, true);
if (!state.render_no_shadows && shadow_atlas && p_light->light_ptr->shadow) {
@@ -1946,7 +1946,7 @@ void RasterizerSceneGLES2::_setup_light_type(LightInstance *p_light, ShadowAtlas
state.scene_shader.set_conditional(SceneShaderGLES2::SHADOW_MODE_PCF_13, shadow_filter_mode == SHADOW_FILTER_PCF13);
}
} break;
- case VS::LIGHT_SPOT: {
+ case RS::LIGHT_SPOT: {
state.scene_shader.set_conditional(SceneShaderGLES2::LIGHT_MODE_SPOT, true);
if (!state.render_no_shadows && shadow_atlas && p_light->light_ptr->shadow) {
@@ -1969,8 +1969,8 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
RasterizerStorageGLES2::Light *light_ptr = light->light_ptr;
//common parameters
- float energy = light_ptr->param[VS::LIGHT_PARAM_ENERGY];
- float specular = light_ptr->param[VS::LIGHT_PARAM_SPECULAR];
+ float energy = light_ptr->param[RS::LIGHT_PARAM_ENERGY];
+ float specular = light_ptr->param[RS::LIGHT_PARAM_SPECULAR];
float sign = (light_ptr->negative && !accum_pass) ? -1 : 1; //inverse color for base pass lights only
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_SPECULAR, specular);
@@ -1982,7 +1982,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
//specific parameters
switch (light_ptr->type) {
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
//not using inverse for performance, view should be normalized anyway
Vector3 direction = p_view_transform.basis.xform_inv(light->transform.basis.xform(Vector3(0, 0, -1))).normalized();
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_DIRECTION, direction);
@@ -1995,15 +1995,15 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
Color split_offsets;
switch (light_ptr->directional_shadow_mode) {
- case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: {
shadow_count = 1;
} break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: {
shadow_count = 2;
} break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: {
shadow_count = 4;
} break;
}
@@ -2015,7 +2015,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
uint32_t width = light->directional_rect.size.x;
uint32_t height = light->directional_rect.size.y;
- if (light_ptr->directional_shadow_mode == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) {
+ if (light_ptr->directional_shadow_mode == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) {
width /= 2;
height /= 2;
@@ -2029,7 +2029,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
y += height;
}
- } else if (light_ptr->directional_shadow_mode == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) {
+ } else if (light_ptr->directional_shadow_mode == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) {
height /= 2;
@@ -2067,16 +2067,16 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_SHADOW_MATRIX4, matrices[3]);
}
} break;
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_OMNI: {
Vector3 position = p_view_transform.xform_inv(light->transform.origin);
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_POSITION, position);
- float range = light_ptr->param[VS::LIGHT_PARAM_RANGE];
+ float range = light_ptr->param[RS::LIGHT_PARAM_RANGE];
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_RANGE, range);
- float attenuation = light_ptr->param[VS::LIGHT_PARAM_ATTENUATION];
+ float attenuation = light_ptr->param[RS::LIGHT_PARAM_ATTENUATION];
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_ATTENUATION, attenuation);
if (!state.render_no_shadows && light_ptr->shadow && shadow_atlas && shadow_atlas->shadow_owners.has(light->self)) {
@@ -2101,7 +2101,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
uint32_t width = shadow_size;
uint32_t height = shadow_size;
- if (light->light_ptr->omni_shadow_detail == VS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) {
+ if (light->light_ptr->omni_shadow_detail == RS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) {
height /= 2;
} else {
width /= 2;
@@ -2121,7 +2121,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
}
} break;
- case VS::LIGHT_SPOT: {
+ case RS::LIGHT_SPOT: {
Vector3 position = p_view_transform.xform_inv(light->transform.origin);
@@ -2129,10 +2129,10 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
Vector3 direction = p_view_transform.inverse().basis.xform(light->transform.basis.xform(Vector3(0, 0, -1))).normalized();
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_DIRECTION, direction);
- float attenuation = light_ptr->param[VS::LIGHT_PARAM_ATTENUATION];
- float range = light_ptr->param[VS::LIGHT_PARAM_RANGE];
- float spot_attenuation = light_ptr->param[VS::LIGHT_PARAM_SPOT_ATTENUATION];
- float angle = light_ptr->param[VS::LIGHT_PARAM_SPOT_ANGLE];
+ float attenuation = light_ptr->param[RS::LIGHT_PARAM_ATTENUATION];
+ float range = light_ptr->param[RS::LIGHT_PARAM_RANGE];
+ float spot_attenuation = light_ptr->param[RS::LIGHT_PARAM_SPOT_ATTENUATION];
+ float angle = light_ptr->param[RS::LIGHT_PARAM_SPOT_ANGLE];
angle = Math::cos(Math::deg2rad(angle));
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_ATTENUATION, attenuation);
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_SPOT_ATTENUATION, spot_attenuation);
@@ -2490,7 +2490,7 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements,
rebind = true;
}
- bool instancing = e->instance->base_type == VS::INSTANCE_MULTIMESH;
+ bool instancing = e->instance->base_type == RS::INSTANCE_MULTIMESH;
if (instancing != prev_instancing) {
@@ -2726,10 +2726,10 @@ void RasterizerSceneGLES2::_draw_sky(RasterizerStorageGLES2::Sky *p_sky, const C
glBufferData(GL_ARRAY_BUFFER, sizeof(Vector3) * 8, vertices, GL_DYNAMIC_DRAW);
// bind sky vertex array....
- glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3) * 2, 0);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3) * 2, CAST_INT_TO_UCHAR_PTR(sizeof(Vector3)));
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3) * 2, 0);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 3, GL_FLOAT, GL_FALSE, sizeof(Vector3) * 2, CAST_INT_TO_UCHAR_PTR(sizeof(Vector3)));
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
storage->shaders.copy.set_conditional(CopyShaderGLES2::USE_ASYM_PANO, asymmetrical);
storage->shaders.copy.set_conditional(CopyShaderGLES2::USE_PANORAMA, !asymmetrical);
@@ -2752,8 +2752,8 @@ void RasterizerSceneGLES2::_draw_sky(RasterizerStorageGLES2::Sky *p_sky, const C
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- glDisableVertexAttribArray(VS::ARRAY_VERTEX);
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glDisableVertexAttribArray(RS::ARRAY_VERTEX);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV);
glBindBuffer(GL_ARRAY_BUFFER, 0);
storage->shaders.copy.set_conditional(CopyShaderGLES2::USE_ASYM_PANO, false);
@@ -2845,9 +2845,9 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal());
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_FAR_BLUR, true);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_LOW, env->dof_blur_far_quality == VS::ENV_DOF_BLUR_QUALITY_LOW);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_MEDIUM, env->dof_blur_far_quality == VS::ENV_DOF_BLUR_QUALITY_MEDIUM);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_HIGH, env->dof_blur_far_quality == VS::ENV_DOF_BLUR_QUALITY_HIGH);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_LOW, env->dof_blur_far_quality == RS::ENV_DOF_BLUR_QUALITY_LOW);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_MEDIUM, env->dof_blur_far_quality == RS::ENV_DOF_BLUR_QUALITY_MEDIUM);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_HIGH, env->dof_blur_far_quality == RS::ENV_DOF_BLUR_QUALITY_HIGH);
state.effect_blur_shader.bind();
int qsteps[3] = { 4, 10, 20 };
@@ -2911,9 +2911,9 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_NEAR_BLUR, true);
state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_NEAR_FIRST_TAP, true);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_LOW, env->dof_blur_near_quality == VS::ENV_DOF_BLUR_QUALITY_LOW);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_MEDIUM, env->dof_blur_near_quality == VS::ENV_DOF_BLUR_QUALITY_MEDIUM);
- state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_HIGH, env->dof_blur_near_quality == VS::ENV_DOF_BLUR_QUALITY_HIGH);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_LOW, env->dof_blur_near_quality == RS::ENV_DOF_BLUR_QUALITY_LOW);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_MEDIUM, env->dof_blur_near_quality == RS::ENV_DOF_BLUR_QUALITY_MEDIUM);
+ state.effect_blur_shader.set_conditional(EffectBlurShaderGLES2::DOF_QUALITY_HIGH, env->dof_blur_near_quality == RS::ENV_DOF_BLUR_QUALITY_HIGH);
state.effect_blur_shader.bind();
int qsteps[3] = { 4, 10, 20 };
@@ -3003,7 +3003,7 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
if (env->glow_enabled) {
- for (int i = 0; i < VS::MAX_GLOW_LEVELS; i++) {
+ for (int i = 0; i < RS::MAX_GLOW_LEVELS; i++) {
if (env->glow_levels & (1 << i)) {
if (i >= storage->frame.current_rt->mip_maps[1].sizes.size()) {
@@ -3156,9 +3156,9 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
}
}
- state.tonemap_shader.set_conditional(TonemapShaderGLES2::USE_GLOW_SCREEN, env->glow_blend_mode == VS::ENV_GLOW_BLEND_MODE_SCREEN);
- state.tonemap_shader.set_conditional(TonemapShaderGLES2::USE_GLOW_SOFTLIGHT, env->glow_blend_mode == VS::ENV_GLOW_BLEND_MODE_SOFTLIGHT);
- state.tonemap_shader.set_conditional(TonemapShaderGLES2::USE_GLOW_REPLACE, env->glow_blend_mode == VS::ENV_GLOW_BLEND_MODE_REPLACE);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES2::USE_GLOW_SCREEN, env->glow_blend_mode == RS::ENV_GLOW_BLEND_MODE_SCREEN);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES2::USE_GLOW_SOFTLIGHT, env->glow_blend_mode == RS::ENV_GLOW_BLEND_MODE_SOFTLIGHT);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES2::USE_GLOW_REPLACE, env->glow_blend_mode == RS::ENV_GLOW_BLEND_MODE_REPLACE);
}
//Adjustments
@@ -3288,7 +3288,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
LightInstance *light = light_instance_owner.getornull(light_rid);
- if (light->light_ptr->type == VS::LIGHT_DIRECTIONAL) {
+ if (light->light_ptr->type == RS::LIGHT_DIRECTIONAL) {
render_directional_lights++;
//as going in reverse, directional lights are always first anyway
}
@@ -3322,7 +3322,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
reflection_probe_count = 0;
}
- if (env && env->bg_mode == VS::ENV_BG_CANVAS) {
+ if (env && env->bg_mode == RS::ENV_BG_CANVAS) {
// If using canvas background, copy 2d to screen copy texture
// TODO: When GLES2 renders to current_rt->mip_maps[], this copy will no longer be needed
_copy_texture_to_buffer(storage->frame.current_rt->color, storage->frame.current_rt->copy_screen_effect.fbo);
@@ -3358,22 +3358,22 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
clear_color = Color(0, 0, 0, 0);
storage->frame.clear_request = false;
- } else if (!env || env->bg_mode == VS::ENV_BG_CLEAR_COLOR || env->bg_mode == VS::ENV_BG_SKY) {
+ } else if (!env || env->bg_mode == RS::ENV_BG_CLEAR_COLOR || env->bg_mode == RS::ENV_BG_SKY) {
if (storage->frame.clear_request) {
clear_color = storage->frame.clear_request_color;
storage->frame.clear_request = false;
}
- } else if (env->bg_mode == VS::ENV_BG_CANVAS || env->bg_mode == VS::ENV_BG_COLOR || env->bg_mode == VS::ENV_BG_COLOR_SKY) {
+ } else if (env->bg_mode == RS::ENV_BG_CANVAS || env->bg_mode == RS::ENV_BG_COLOR || env->bg_mode == RS::ENV_BG_COLOR_SKY) {
clear_color = env->bg_color;
storage->frame.clear_request = false;
- } else if (env->bg_mode == VS::ENV_BG_CAMERA_FEED) {
+ } else if (env->bg_mode == RS::ENV_BG_CAMERA_FEED) {
feed = CameraServer::get_singleton()->get_feed_by_id(env->camera_feed_id);
storage->frame.clear_request = false;
} else {
storage->frame.clear_request = false;
}
- if (!env || env->bg_mode != VS::ENV_BG_KEEP) {
+ if (!env || env->bg_mode != RS::ENV_BG_KEEP) {
glClearColor(clear_color.r, clear_color.g, clear_color.b, clear_color.a);
glClear(GL_COLOR_BUFFER_BIT);
}
@@ -3385,7 +3385,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
glDisable(GL_SCISSOR_TEST);
}
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1);
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -3396,15 +3396,15 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
if (env) {
switch (env->bg_mode) {
- case VS::ENV_BG_COLOR_SKY:
- case VS::ENV_BG_SKY: {
+ case RS::ENV_BG_COLOR_SKY:
+ case RS::ENV_BG_SKY: {
sky = storage->sky_owner.getornull(env->sky);
if (sky) {
env_radiance_tex = sky->radiance;
}
} break;
- case VS::ENV_BG_CAMERA_FEED: {
+ case RS::ENV_BG_CAMERA_FEED: {
if (feed.is_valid() && (feed->get_base_width() > 0) && (feed->get_base_height() > 0)) {
// copy our camera feed to our background
@@ -3419,12 +3419,12 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
if (feed->get_datatype() == CameraFeed::FEED_RGB) {
RID camera_RGBA = feed->get_texture(CameraServer::FEED_RGBA_IMAGE);
- VS::get_singleton()->texture_bind(camera_RGBA, 0);
+ RS::get_singleton()->texture_bind(camera_RGBA, 0);
} else if (feed->get_datatype() == CameraFeed::FEED_YCBCR) {
RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCBCR_IMAGE);
- VS::get_singleton()->texture_bind(camera_YCbCr, 0);
+ RS::get_singleton()->texture_bind(camera_YCbCr, 0);
storage->shaders.copy.set_conditional(CopyShaderGLES2::YCBCR_TO_RGB, true);
@@ -3432,8 +3432,8 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
RID camera_Y = feed->get_texture(CameraServer::FEED_Y_IMAGE);
RID camera_CbCr = feed->get_texture(CameraServer::FEED_CBCR_IMAGE);
- VS::get_singleton()->texture_bind(camera_Y, 0);
- VS::get_singleton()->texture_bind(camera_CbCr, 1);
+ RS::get_singleton()->texture_bind(camera_Y, 0);
+ RS::get_singleton()->texture_bind(camera_CbCr, 1);
storage->shaders.copy.set_conditional(CopyShaderGLES2::SEP_CBCR_TEXTURE, true);
storage->shaders.copy.set_conditional(CopyShaderGLES2::YCBCR_TO_RGB, true);
@@ -3444,8 +3444,8 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
storage->bind_quad_array();
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- glDisableVertexAttribArray(VS::ARRAY_VERTEX);
- glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glDisableVertexAttribArray(RS::ARRAY_VERTEX);
+ glDisableVertexAttribArray(RS::ARRAY_TEX_UV);
glBindBuffer(GL_ARRAY_BUFFER, 0);
// turn off everything used
@@ -3464,7 +3464,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
clear_color = Color(0.0, 1.0, 0.0, 1.0);
}
} break;
- case VS::ENV_BG_CANVAS: {
+ case RS::ENV_BG_CANVAS: {
// use screen copy as background
_copy_texture_to_buffer(storage->frame.current_rt->copy_screen_effect.color, current_fb);
} break;
@@ -3484,7 +3484,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
_render_render_list(render_list.elements, render_list.element_count, cam_transform, p_cam_projection, p_shadow_atlas, env, env_radiance_tex, 0.0, 0.0, reverse_cull, false, false);
// then draw the sky after
- if (env && env->bg_mode == VS::ENV_BG_SKY && (!storage->frame.current_rt || !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT])) {
+ if (env && env->bg_mode == RS::ENV_BG_SKY && (!storage->frame.current_rt || !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT])) {
if (sky && sky->panorama.is_valid()) {
_draw_sky(sky, p_cam_projection, cam_transform, false, env->sky_custom_fov, env->bg_energy, env->sky_orientation);
@@ -3616,7 +3616,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
// TODO directional light
- if (light->type == VS::LIGHT_DIRECTIONAL) {
+ if (light->type == RS::LIGHT_DIRECTIONAL) {
// set pssm stuff
// TODO set this only when changed
@@ -3651,7 +3651,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
width = light_instance->directional_rect.size.width;
height = light_instance->directional_rect.size.height;
- if (light->directional_shadow_mode == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) {
+ if (light->directional_shadow_mode == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) {
width /= 2;
height /= 2;
@@ -3665,7 +3665,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
y += height;
}
- } else if (light->directional_shadow_mode == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) {
+ } else if (light->directional_shadow_mode == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) {
height /= 2;
@@ -3676,10 +3676,10 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
}
}
- float bias_mult = Math::lerp(1.0f, light_instance->shadow_transform[p_pass].bias_scale, light->param[VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE]);
- zfar = light->param[VS::LIGHT_PARAM_RANGE];
- bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS] * bias_mult;
- normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
+ float bias_mult = Math::lerp(1.0f, light_instance->shadow_transform[p_pass].bias_scale, light->param[RS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE]);
+ zfar = light->param[RS::LIGHT_PARAM_RANGE];
+ bias = light->param[RS::LIGHT_PARAM_SHADOW_BIAS] * bias_mult;
+ normal_bias = light->param[RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
fbo = directional_shadow.fbo;
} else {
@@ -3708,9 +3708,9 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
width = shadow_size;
height = shadow_size;
- if (light->type == VS::LIGHT_OMNI) {
+ if (light->type == RS::LIGHT_OMNI) {
// cubemap only
- if (light->omni_shadow_mode == VS::LIGHT_OMNI_SHADOW_CUBE && storage->config.support_shadow_cubemaps) {
+ if (light->omni_shadow_mode == RS::LIGHT_OMNI_SHADOW_CUBE && storage->config.support_shadow_cubemaps) {
int cubemap_index = shadow_cubemaps.size() - 1;
// find an appropriate cubemap to render to
@@ -3727,7 +3727,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
light_transform = light_instance->shadow_transform[0].transform;
custom_vp_size = shadow_cubemaps[cubemap_index].size;
- zfar = light->param[VS::LIGHT_PARAM_RANGE];
+ zfar = light->param[RS::LIGHT_PARAM_RANGE];
current_cubemap = cubemap_index;
} else {
@@ -3736,7 +3736,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
light_projection = light_instance->shadow_transform[0].camera;
light_transform = light_instance->shadow_transform[0].transform;
- if (light->omni_shadow_detail == VS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) {
+ if (light->omni_shadow_detail == RS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) {
height /= 2;
y += p_pass * height;
@@ -3747,22 +3747,22 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
state.dual_parbolloid_direction = p_pass == 0 ? 1.0 : -1.0;
flip_facing = (p_pass == 1);
- zfar = light->param[VS::LIGHT_PARAM_RANGE];
- bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS];
+ zfar = light->param[RS::LIGHT_PARAM_RANGE];
+ bias = light->param[RS::LIGHT_PARAM_SHADOW_BIAS];
state.dual_parbolloid_zfar = zfar;
state.scene_shader.set_conditional(SceneShaderGLES2::RENDER_DEPTH_DUAL_PARABOLOID, true);
}
- } else if (light->type == VS::LIGHT_SPOT) {
+ } else if (light->type == RS::LIGHT_SPOT) {
light_projection = light_instance->shadow_transform[0].camera;
light_transform = light_instance->shadow_transform[0].transform;
flip_facing = false;
- zfar = light->param[VS::LIGHT_PARAM_RANGE];
- bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS];
- normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS];
+ zfar = light->param[RS::LIGHT_PARAM_RANGE];
+ bias = light->param[RS::LIGHT_PARAM_SHADOW_BIAS];
+ normal_bias = light->param[RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS];
}
}
@@ -3812,7 +3812,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
state.scene_shader.set_conditional(SceneShaderGLES2::RENDER_DEPTH_DUAL_PARABOLOID, false);
// convert cubemap to dual paraboloid if needed
- if (light->type == VS::LIGHT_OMNI && (light->omni_shadow_mode == VS::LIGHT_OMNI_SHADOW_CUBE && storage->config.support_shadow_cubemaps) && p_pass == 5) {
+ if (light->type == RS::LIGHT_OMNI && (light->omni_shadow_mode == RS::LIGHT_OMNI_SHADOW_CUBE && storage->config.support_shadow_cubemaps) && p_pass == 5) {
ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
glBindFramebuffer(GL_FRAMEBUFFER, shadow_atlas->fbo);
@@ -3827,14 +3827,14 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES2::Z_FLIP, i == 1);
state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES2::Z_NEAR, light_projection.get_z_near());
state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES2::Z_FAR, light_projection.get_z_far());
- state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES2::BIAS, light->param[VS::LIGHT_PARAM_SHADOW_BIAS]);
+ state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES2::BIAS, light->param[RS::LIGHT_PARAM_SHADOW_BIAS]);
uint32_t local_width = width;
uint32_t local_height = height;
uint32_t local_x = x;
uint32_t local_y = y;
- if (light->omni_shadow_detail == VS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) {
+ if (light->omni_shadow_detail == RS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) {
local_height /= 2;
local_y += i * local_height;
} else {
@@ -3922,7 +3922,7 @@ bool RasterizerSceneGLES2::free(RID p_rid) {
return true;
}
-void RasterizerSceneGLES2::set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) {
+void RasterizerSceneGLES2::set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw) {
}
void RasterizerSceneGLES2::initialize() {
diff --git a/drivers/gles2/rasterizer_scene_gles2.h b/drivers/gles2/rasterizer_scene_gles2.h
index 174cdd8e2e..6d0a5a45ca 100644
--- a/drivers/gles2/rasterizer_scene_gles2.h
+++ b/drivers/gles2/rasterizer_scene_gles2.h
@@ -236,7 +236,7 @@ public:
/* ENVIRONMENT API */
struct Environment {
- VS::EnvironmentBG bg_mode;
+ RS::EnvironmentBG bg_mode;
RID sky;
float sky_custom_fov;
@@ -259,7 +259,7 @@ public:
float glow_intensity;
float glow_strength;
float glow_bloom;
- VS::EnvironmentGlowBlendMode glow_blend_mode;
+ RS::EnvironmentGlowBlendMode glow_blend_mode;
float glow_hdr_bleed_threshold;
float glow_hdr_bleed_scale;
float glow_hdr_luminance_cap;
@@ -269,13 +269,13 @@ public:
float dof_blur_far_distance;
float dof_blur_far_transition;
float dof_blur_far_amount;
- VS::EnvironmentDOFBlurQuality dof_blur_far_quality;
+ RS::EnvironmentDOFBlurQuality dof_blur_far_quality;
bool dof_blur_near_enabled;
float dof_blur_near_distance;
float dof_blur_near_transition;
float dof_blur_near_amount;
- VS::EnvironmentDOFBlurQuality dof_blur_near_quality;
+ RS::EnvironmentDOFBlurQuality dof_blur_near_quality;
bool adjustments_enabled;
float adjustments_brightness;
@@ -300,7 +300,7 @@ public:
float fog_height_curve;
Environment() :
- bg_mode(VS::ENV_BG_CLEAR_COLOR),
+ bg_mode(RS::ENV_BG_CLEAR_COLOR),
sky_custom_fov(0.0),
bg_energy(1.0),
sky_ambient(0),
@@ -313,7 +313,7 @@ public:
glow_intensity(0.8),
glow_strength(1.0),
glow_bloom(0.0),
- glow_blend_mode(VS::ENV_GLOW_BLEND_MODE_SOFTLIGHT),
+ glow_blend_mode(RS::ENV_GLOW_BLEND_MODE_SOFTLIGHT),
glow_hdr_bleed_threshold(1.0),
glow_hdr_bleed_scale(2.0),
glow_hdr_luminance_cap(12.0),
@@ -322,12 +322,12 @@ public:
dof_blur_far_distance(10),
dof_blur_far_transition(5),
dof_blur_far_amount(0.1),
- dof_blur_far_quality(VS::ENV_DOF_BLUR_QUALITY_MEDIUM),
+ dof_blur_far_quality(RS::ENV_DOF_BLUR_QUALITY_MEDIUM),
dof_blur_near_enabled(false),
dof_blur_near_distance(2),
dof_blur_near_transition(1),
dof_blur_near_amount(0.1),
- dof_blur_near_quality(VS::ENV_DOF_BLUR_QUALITY_MEDIUM),
+ dof_blur_near_quality(RS::ENV_DOF_BLUR_QUALITY_MEDIUM),
adjustments_enabled(false),
adjustments_brightness(1.0),
adjustments_contrast(1.0),
@@ -353,7 +353,7 @@ public:
virtual RID environment_create();
- virtual void environment_set_background(RID p_env, VS::EnvironmentBG p_bg);
+ virtual void environment_set_background(RID p_env, RS::EnvironmentBG p_bg);
virtual void environment_set_sky(RID p_env, RID p_sky);
virtual void environment_set_sky_custom_fov(RID p_env, float p_scale);
virtual void environment_set_sky_orientation(RID p_env, const Basis &p_orientation);
@@ -363,15 +363,15 @@ public:
virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0);
virtual void environment_set_camera_feed_id(RID p_env, int p_camera_feed_id);
- virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality);
- virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, VS::EnvironmentDOFBlurQuality p_quality);
- virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale);
+ virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality);
+ virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality);
+ virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale);
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture);
virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness);
- virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, VS::EnvironmentSSAOQuality p_quality, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness);
+ virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::EnvironmentSSAOQuality p_quality, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness);
- virtual void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
+ virtual void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp);
@@ -381,7 +381,7 @@ public:
virtual bool is_environment(RID p_env);
- virtual VS::EnvironmentBG environment_get_background(RID p_env);
+ virtual RS::EnvironmentBG environment_get_background(RID p_env);
virtual int environment_get_canvas_max_layer(RID p_env);
/* LIGHT INSTANCE */
@@ -650,7 +650,7 @@ public:
virtual bool free(RID p_rid);
virtual void set_scene_pass(uint64_t p_pass);
- virtual void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw);
+ virtual void set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw);
void iteration();
void initialize();
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index f76c7da8e1..4337d2a833 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -34,7 +34,7 @@
#include "core/project_settings.h"
#include "rasterizer_canvas_gles2.h"
#include "rasterizer_scene_gles2.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
GLuint RasterizerStorageGLES2::system_fbo = 0;
@@ -127,11 +127,11 @@ PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC glCompressedTexSubImage3DOES;
void RasterizerStorageGLES2::bind_quad_array() const {
glBindBuffer(GL_ARRAY_BUFFER, resources.quadie);
- glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
- glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, CAST_INT_TO_UCHAR_PTR(8));
+ glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
+ glVertexAttribPointer(RS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, CAST_INT_TO_UCHAR_PTR(8));
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glEnableVertexAttribArray(RS::ARRAY_VERTEX);
+ glEnableVertexAttribArray(RS::ARRAY_TEX_UV);
}
Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_force_decompress) const {
@@ -549,15 +549,15 @@ RID RasterizerStorageGLES2::texture_create() {
return texture_owner.make_rid(texture);
}
-void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, VisualServer::TextureType p_type, uint32_t p_flags) {
+void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, RenderingServer::TextureType p_type, uint32_t p_flags) {
GLenum format;
GLenum internal_format;
GLenum type;
bool compressed = false;
- if (p_flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING) {
- p_flags &= ~VS::TEXTURE_FLAG_MIPMAPS; // no mipies for video
+ if (p_flags & RS::TEXTURE_FLAG_USED_FOR_STREAMING) {
+ p_flags &= ~RS::TEXTURE_FLAG_MIPMAPS; // no mipies for video
}
Texture *texture = texture_owner.getornull(p_texture);
@@ -570,15 +570,15 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
texture->type = p_type;
switch (p_type) {
- case VS::TEXTURE_TYPE_2D: {
+ case RS::TEXTURE_TYPE_2D: {
texture->target = GL_TEXTURE_2D;
texture->images.resize(1);
} break;
- case VS::TEXTURE_TYPE_CUBEMAP: {
+ case RS::TEXTURE_TYPE_CUBEMAP: {
texture->target = GL_TEXTURE_CUBE_MAP;
texture->images.resize(6);
} break;
- case VS::TEXTURE_TYPE_2D_ARRAY: {
+ case RS::TEXTURE_TYPE_2D_ARRAY: {
if (config.texture_array_supported) {
texture->target = GL_TEXTURE_2D_ARRAY;
texture->images.resize(p_depth_3d);
@@ -587,7 +587,7 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
return;
}
} break;
- case VS::TEXTURE_TYPE_3D: {
+ case RS::TEXTURE_TYPE_3D: {
if (config.texture_3d_supported) {
texture->target = GL_TEXTURE_3D;
texture->images.resize(p_depth_3d);
@@ -611,12 +611,12 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
bool is_po2 = p_width == po2_width && p_height == po2_height;
- if (!is_po2 && (p_flags & VS::TEXTURE_FLAG_REPEAT || p_flags & VS::TEXTURE_FLAG_MIPMAPS)) {
+ if (!is_po2 && (p_flags & RS::TEXTURE_FLAG_REPEAT || p_flags & RS::TEXTURE_FLAG_MIPMAPS)) {
- if (p_flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING) {
+ if (p_flags & RS::TEXTURE_FLAG_USED_FOR_STREAMING) {
//not supported
ERR_PRINT("Streaming texture for non power of 2 or has mipmaps on this hardware: " + texture->path + "'. Mipmaps and repeat disabled.");
- texture->flags &= ~(VS::TEXTURE_FLAG_REPEAT | VS::TEXTURE_FLAG_MIPMAPS);
+ texture->flags &= ~(RS::TEXTURE_FLAG_REPEAT | RS::TEXTURE_FLAG_MIPMAPS);
} else {
texture->alloc_height = po2_height;
texture->alloc_width = po2_width;
@@ -640,7 +640,7 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
glBindTexture(texture->target, texture->tex_id);
#if defined(GLES_OVER_GL) || defined(ANDROID_ENABLED)
- if ((p_type == VS::TEXTURE_TYPE_3D && config.texture_3d_supported) || (p_type == VS::TEXTURE_TYPE_2D_ARRAY && config.texture_array_supported)) {
+ if ((p_type == RS::TEXTURE_TYPE_3D && config.texture_3d_supported) || (p_type == RS::TEXTURE_TYPE_2D_ARRAY && config.texture_array_supported)) {
int width = p_width;
int height = p_height;
@@ -648,7 +648,7 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
int mipmaps = 0;
- while (width > 0 || height > 0 || (p_type == VS::TEXTURE_TYPE_3D && depth > 0)) {
+ while (width > 0 || height > 0 || (p_type == RS::TEXTURE_TYPE_3D && depth > 0)) {
width = MAX(1, width);
height = MAX(1, height);
depth = MAX(1, depth);
@@ -658,13 +658,13 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
width /= 2;
height /= 2;
- if (p_type == VS::TEXTURE_TYPE_3D) {
+ if (p_type == RS::TEXTURE_TYPE_3D) {
depth /= 2;
}
mipmaps++;
- if (!(p_flags & VS::TEXTURE_FLAG_MIPMAPS))
+ if (!(p_flags & RS::TEXTURE_FLAG_MIPMAPS))
break;
}
#ifdef GLES_OVER_GL
@@ -674,7 +674,7 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
} else
#endif
- if (p_flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING) {
+ if (p_flags & RS::TEXTURE_FLAG_USED_FOR_STREAMING) {
//prealloc if video
glTexImage2D(texture->target, 0, internal_format, texture->alloc_width, texture->alloc_height, 0, format, type, NULL);
}
@@ -686,7 +686,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
Texture *texture = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!texture);
- if ((texture->type == VS::TEXTURE_TYPE_2D_ARRAY && !config.texture_array_supported) || (texture->type == VS::TEXTURE_TYPE_3D && !config.texture_3d_supported)) {
+ if ((texture->type == RS::TEXTURE_TYPE_2D_ARRAY && !config.texture_array_supported) || (texture->type == RS::TEXTURE_TYPE_3D && !config.texture_3d_supported)) {
return;
}
ERR_FAIL_COND(!texture->active);
@@ -699,7 +699,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
GLenum internal_format;
bool compressed = false;
- if (config.keep_original_textures && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) {
+ if (config.keep_original_textures && !(texture->flags & RS::TEXTURE_FLAG_USED_FOR_STREAMING)) {
texture->images.write[p_layer] = p_image;
}
@@ -717,7 +717,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
img->resize_to_po2(false);
}
- if (config.shrink_textures_x2 && (p_image->has_mipmaps() || !p_image->is_compressed()) && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) {
+ if (config.shrink_textures_x2 && (p_image->has_mipmaps() || !p_image->is_compressed()) && !(texture->flags & RS::TEXTURE_FLAG_USED_FOR_STREAMING)) {
texture->alloc_height = MAX(1, texture->alloc_height / 2);
texture->alloc_width = MAX(1, texture->alloc_width / 2);
@@ -734,17 +734,17 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
GLenum blit_target = GL_TEXTURE_2D;
switch (texture->type) {
- case VS::TEXTURE_TYPE_2D: {
+ case RS::TEXTURE_TYPE_2D: {
blit_target = GL_TEXTURE_2D;
} break;
- case VS::TEXTURE_TYPE_CUBEMAP: {
+ case RS::TEXTURE_TYPE_CUBEMAP: {
ERR_FAIL_INDEX(p_layer, 6);
blit_target = _cube_side_enum[p_layer];
} break;
- case VS::TEXTURE_TYPE_2D_ARRAY: {
+ case RS::TEXTURE_TYPE_2D_ARRAY: {
blit_target = GL_TEXTURE_2D_ARRAY;
} break;
- case VS::TEXTURE_TYPE_3D: {
+ case RS::TEXTURE_TYPE_3D: {
blit_target = GL_TEXTURE_3D;
} break;
}
@@ -758,17 +758,17 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
texture->ignore_mipmaps = compressed && !img->has_mipmaps();
- if ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && !texture->ignore_mipmaps)
+ if ((texture->flags & RS::TEXTURE_FLAG_MIPMAPS) && !texture->ignore_mipmaps)
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, config.use_fast_texture_filter ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR_MIPMAP_LINEAR);
else {
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
+ if (texture->flags & RS::TEXTURE_FLAG_FILTER) {
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
} else {
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
}
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
+ if (texture->flags & RS::TEXTURE_FLAG_FILTER) {
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering
@@ -777,9 +777,9 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // raw Filtering
}
- if (((texture->flags & VS::TEXTURE_FLAG_REPEAT) || (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT)) && texture->target != GL_TEXTURE_CUBE_MAP) {
+ if (((texture->flags & RS::TEXTURE_FLAG_REPEAT) || (texture->flags & RS::TEXTURE_FLAG_MIRRORED_REPEAT)) && texture->target != GL_TEXTURE_CUBE_MAP) {
- if (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT) {
+ if (texture->flags & RS::TEXTURE_FLAG_MIRRORED_REPEAT) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
} else {
@@ -793,7 +793,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
glTexParameterf(texture->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
- int mipmaps = ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && img->has_mipmaps()) ? img->get_mipmap_count() + 1 : 1;
+ int mipmaps = ((texture->flags & RS::TEXTURE_FLAG_MIPMAPS) && img->has_mipmaps()) ? img->get_mipmap_count() + 1 : 1;
int w = img->get_width();
int h = img->get_height();
@@ -804,7 +804,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
int size, ofs;
img->get_mipmap_offset_and_size(i, ofs, size);
- if (texture->type == VS::TEXTURE_TYPE_2D || texture->type == VS::TEXTURE_TYPE_CUBEMAP) {
+ if (texture->type == RS::TEXTURE_TYPE_2D || texture->type == RS::TEXTURE_TYPE_CUBEMAP) {
if (compressed) {
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
@@ -816,7 +816,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
} else {
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING) {
+ if (texture->flags & RS::TEXTURE_FLAG_USED_FOR_STREAMING) {
glTexSubImage2D(blit_target, i, 0, 0, w, h, format, type, &read[ofs]);
} else {
glTexImage2D(blit_target, i, internal_format, w, h, 0, format, type, &read[ofs]);
@@ -854,7 +854,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
texture->stored_cube_sides |= (1 << p_layer);
- if ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && mipmaps == 1 && !texture->ignore_mipmaps && (texture->type != VS::TEXTURE_TYPE_CUBEMAP || texture->stored_cube_sides == (1 << 6) - 1)) {
+ if ((texture->flags & RS::TEXTURE_FLAG_MIPMAPS) && mipmaps == 1 && !texture->ignore_mipmaps && (texture->type != RS::TEXTURE_TYPE_CUBEMAP || texture->stored_cube_sides == (1 << 6) - 1)) {
//generate mipmaps if they were requested and the image does not contain them
glGenerateMipmap(texture->target);
}
@@ -875,7 +875,7 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer)
ERR_FAIL_COND_V(!texture->active, Ref<Image>());
ERR_FAIL_COND_V(texture->data_size == 0 && !texture->render_target, Ref<Image>());
- if (texture->type == VS::TEXTURE_TYPE_CUBEMAP && p_layer < 6 && p_layer >= 0 && !texture->images[p_layer].is_null()) {
+ if (texture->type == RS::TEXTURE_TYPE_CUBEMAP && p_layer < 6 && p_layer >= 0 && !texture->images[p_layer].is_null()) {
return texture->images[p_layer];
}
@@ -997,16 +997,16 @@ void RasterizerStorageGLES2::texture_set_flags(RID p_texture, uint32_t p_flags)
Texture *texture = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!texture);
- bool had_mipmaps = texture->flags & VS::TEXTURE_FLAG_MIPMAPS;
+ bool had_mipmaps = texture->flags & RS::TEXTURE_FLAG_MIPMAPS;
texture->flags = p_flags;
glActiveTexture(GL_TEXTURE0);
glBindTexture(texture->target, texture->tex_id);
- if (((texture->flags & VS::TEXTURE_FLAG_REPEAT) || (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT)) && texture->target != GL_TEXTURE_CUBE_MAP) {
+ if (((texture->flags & RS::TEXTURE_FLAG_REPEAT) || (texture->flags & RS::TEXTURE_FLAG_MIRRORED_REPEAT)) && texture->target != GL_TEXTURE_CUBE_MAP) {
- if (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT) {
+ if (texture->flags & RS::TEXTURE_FLAG_MIRRORED_REPEAT) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
} else {
@@ -1019,21 +1019,21 @@ void RasterizerStorageGLES2::texture_set_flags(RID p_texture, uint32_t p_flags)
glTexParameterf(texture->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
- if ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && !texture->ignore_mipmaps) {
+ if ((texture->flags & RS::TEXTURE_FLAG_MIPMAPS) && !texture->ignore_mipmaps) {
if (!had_mipmaps && texture->mipmaps == 1) {
glGenerateMipmap(texture->target);
}
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, config.use_fast_texture_filter ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR_MIPMAP_LINEAR);
} else {
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
+ if (texture->flags & RS::TEXTURE_FLAG_FILTER) {
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
} else {
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
}
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
+ if (texture->flags & RS::TEXTURE_FLAG_FILTER) {
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering
@@ -1059,10 +1059,10 @@ Image::Format RasterizerStorageGLES2::texture_get_format(RID p_texture) const {
return texture->format;
}
-VisualServer::TextureType RasterizerStorageGLES2::texture_get_type(RID p_texture) const {
+RenderingServer::TextureType RasterizerStorageGLES2::texture_get_type(RID p_texture) const {
Texture *texture = texture_owner.getornull(p_texture);
- ERR_FAIL_COND_V(!texture, VS::TEXTURE_TYPE_2D);
+ ERR_FAIL_COND_V(!texture, RS::TEXTURE_TYPE_2D);
return texture->type;
}
@@ -1135,7 +1135,7 @@ String RasterizerStorageGLES2::texture_get_path(RID p_texture) const {
return texture->path;
}
-void RasterizerStorageGLES2::texture_debug_usage(List<VS::TextureInfo> *r_info) {
+void RasterizerStorageGLES2::texture_debug_usage(List<RS::TextureInfo> *r_info) {
List<RID> textures;
texture_owner.get_owned_list(&textures);
@@ -1144,7 +1144,7 @@ void RasterizerStorageGLES2::texture_debug_usage(List<VS::TextureInfo> *r_info)
Texture *t = texture_owner.getornull(E->get());
if (!t)
continue;
- VS::TextureInfo tinfo;
+ RS::TextureInfo tinfo;
tinfo.path = t->path;
tinfo.format = t->format;
tinfo.width = t->alloc_width;
@@ -1200,7 +1200,7 @@ void RasterizerStorageGLES2::texture_set_force_redraw_if_visible(RID p_texture,
texture->redraw_if_visible = p_enable;
}
-void RasterizerStorageGLES2::texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {
+void RasterizerStorageGLES2::texture_set_detect_3d_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata) {
Texture *texture = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!texture);
@@ -1208,7 +1208,7 @@ void RasterizerStorageGLES2::texture_set_detect_3d_callback(RID p_texture, Visua
texture->detect_3d_ud = p_userdata;
}
-void RasterizerStorageGLES2::texture_set_detect_srgb_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {
+void RasterizerStorageGLES2::texture_set_detect_srgb_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata) {
Texture *texture = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!texture);
@@ -1216,7 +1216,7 @@ void RasterizerStorageGLES2::texture_set_detect_srgb_callback(RID p_texture, Vis
texture->detect_srgb_ud = p_userdata;
}
-void RasterizerStorageGLES2::texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata) {
+void RasterizerStorageGLES2::texture_set_detect_normal_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata) {
Texture *texture = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!texture);
@@ -1265,7 +1265,7 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
glDisable(GL_SCISSOR_TEST);
glDisable(GL_BLEND);
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX - 1; i++) {
glDisableVertexAttribArray(i);
}
}
@@ -1397,7 +1397,7 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
RID RasterizerStorageGLES2::shader_create() {
Shader *shader = memnew(Shader);
- shader->mode = VS::SHADER_SPATIAL;
+ shader->mode = RS::SHADER_SPATIAL;
shader->shader = &scene->state.scene_shader;
RID rid = shader_owner.make_rid(shader);
_shader_make_dirty(shader);
@@ -1421,16 +1421,16 @@ void RasterizerStorageGLES2::shader_set_code(RID p_shader, const String &p_code)
shader->code = p_code;
String mode_string = ShaderLanguage::get_shader_type(p_code);
- VS::ShaderMode mode;
+ RS::ShaderMode mode;
if (mode_string == "canvas_item")
- mode = VS::SHADER_CANVAS_ITEM;
+ mode = RS::SHADER_CANVAS_ITEM;
else if (mode_string == "particles")
- mode = VS::SHADER_PARTICLES;
+ mode = RS::SHADER_PARTICLES;
else if (mode_string == "sky")
- mode = VS::SHADER_SKY;
+ mode = RS::SHADER_SKY;
else
- mode = VS::SHADER_SPATIAL;
+ mode = RS::SHADER_SPATIAL;
if (shader->custom_code_id && mode != shader->mode) {
shader->shader->free_custom_shader(shader->custom_code_id);
@@ -1440,10 +1440,10 @@ void RasterizerStorageGLES2::shader_set_code(RID p_shader, const String &p_code)
shader->mode = mode;
// TODO handle all shader types
- if (mode == VS::SHADER_CANVAS_ITEM) {
+ if (mode == RS::SHADER_CANVAS_ITEM) {
shader->shader = &canvas->state.canvas_shader;
- } else if (mode == VS::SHADER_SPATIAL) {
+ } else if (mode == RS::SHADER_SPATIAL) {
shader->shader = &scene->state.scene_shader;
} else {
return;
@@ -1481,7 +1481,7 @@ void RasterizerStorageGLES2::_update_shader(Shader *p_shader) const {
switch (p_shader->mode) {
- case VS::SHADER_CANVAS_ITEM: {
+ case RS::SHADER_CANVAS_ITEM: {
p_shader->canvas_item.light_mode = Shader::CanvasItem::LIGHT_MODE_NORMAL;
p_shader->canvas_item.blend_mode = Shader::CanvasItem::BLEND_MODE_MIX;
@@ -1508,7 +1508,7 @@ void RasterizerStorageGLES2::_update_shader(Shader *p_shader) const {
actions->uniforms = &p_shader->uniforms;
} break;
- case VS::SHADER_SPATIAL: {
+ case RS::SHADER_SPATIAL: {
p_shader->spatial.blend_mode = Shader::Spatial::BLEND_MODE_MIX;
p_shader->spatial.depth_draw_mode = Shader::Spatial::DEPTH_DRAW_OPAQUE;
p_shader->spatial.cull_mode = Shader::Spatial::CULL_MODE_BACK;
@@ -1949,8 +1949,8 @@ void RasterizerStorageGLES2::material_remove_instance_owner(RID p_material, Rast
}
void RasterizerStorageGLES2::material_set_render_priority(RID p_material, int priority) {
- ERR_FAIL_COND(priority < VS::MATERIAL_RENDER_PRIORITY_MIN);
- ERR_FAIL_COND(priority > VS::MATERIAL_RENDER_PRIORITY_MAX);
+ ERR_FAIL_COND(priority < RS::MATERIAL_RENDER_PRIORITY_MIN);
+ ERR_FAIL_COND(priority > RS::MATERIAL_RENDER_PRIORITY_MAX);
Material *material = material_owner.getornull(p_material);
ERR_FAIL_COND(!material);
@@ -1975,7 +1975,7 @@ void RasterizerStorageGLES2::_update_material(Material *p_material) {
bool can_cast_shadow = false;
bool is_animated = false;
- if (p_material->shader && p_material->shader->mode == VS::SHADER_SPATIAL) {
+ if (p_material->shader && p_material->shader->mode == RS::SHADER_SPATIAL) {
if (p_material->shader->spatial.blend_mode == Shader::Spatial::BLEND_MODE_MIX &&
(!p_material->shader->spatial.uses_alpha || p_material->shader->spatial.depth_draw_mode == Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS)) {
@@ -2087,14 +2087,14 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
uint32_t p_format = format;
- static int src_size[VS::ARRAY_MAX];
- static int dst_size[VS::ARRAY_MAX];
- static int to_convert[VS::ARRAY_MAX];
+ static int src_size[RS::ARRAY_MAX];
+ static int dst_size[RS::ARRAY_MAX];
+ static int to_convert[RS::ARRAY_MAX];
int src_stride = 0;
int dst_stride = 0;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
to_convert[i] = 0;
if (!(p_format & (1 << i))) {
@@ -2105,11 +2105,11 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
- if (p_format & VS::ARRAY_COMPRESS_VERTEX) {
+ if (p_format & RS::ARRAY_COMPRESS_VERTEX) {
- if (p_format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ if (p_format & RS::ARRAY_FLAG_USE_2D_VERTICES) {
src_size[i] = 4;
dst_size[i] = 8;
to_convert[i] = 2;
@@ -2119,10 +2119,10 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
to_convert[i] = 3;
}
- format &= ~VS::ARRAY_COMPRESS_VERTEX;
+ format &= ~RS::ARRAY_COMPRESS_VERTEX;
} else {
- if (p_format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ if (p_format & RS::ARRAY_FLAG_USE_2D_VERTICES) {
src_size[i] = 8;
dst_size[i] = 8;
} else {
@@ -2132,9 +2132,9 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
- if (p_format & VS::ARRAY_COMPRESS_NORMAL) {
+ if (p_format & RS::ARRAY_COMPRESS_NORMAL) {
src_size[i] = 4;
dst_size[i] = 4;
} else {
@@ -2143,9 +2143,9 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
}
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
- if (p_format & VS::ARRAY_COMPRESS_TANGENT) {
+ if (p_format & RS::ARRAY_COMPRESS_TANGENT) {
src_size[i] = 4;
dst_size[i] = 4;
} else {
@@ -2154,9 +2154,9 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
- if (p_format & VS::ARRAY_COMPRESS_COLOR) {
+ if (p_format & RS::ARRAY_COMPRESS_COLOR) {
src_size[i] = 4;
dst_size[i] = 4;
} else {
@@ -2165,12 +2165,12 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
- if (p_format & VS::ARRAY_COMPRESS_TEX_UV) {
+ if (p_format & RS::ARRAY_COMPRESS_TEX_UV) {
src_size[i] = 4;
to_convert[i] = 2;
- format &= ~VS::ARRAY_COMPRESS_TEX_UV;
+ format &= ~RS::ARRAY_COMPRESS_TEX_UV;
} else {
src_size[i] = 8;
}
@@ -2178,12 +2178,12 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
dst_size[i] = 8;
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
- if (p_format & VS::ARRAY_COMPRESS_TEX_UV2) {
+ if (p_format & RS::ARRAY_COMPRESS_TEX_UV2) {
src_size[i] = 4;
to_convert[i] = 2;
- format &= ~VS::ARRAY_COMPRESS_TEX_UV2;
+ format &= ~RS::ARRAY_COMPRESS_TEX_UV2;
} else {
src_size[i] = 8;
}
@@ -2191,9 +2191,9 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
dst_size[i] = 8;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
- if (p_format & VS::ARRAY_FLAG_USE_16_BIT_BONES) {
+ if (p_format & RS::ARRAY_FLAG_USE_16_BIT_BONES) {
src_size[i] = 8;
dst_size[i] = 8;
} else {
@@ -2202,9 +2202,9 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
}
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
- if (p_format & VS::ARRAY_COMPRESS_WEIGHTS) {
+ if (p_format & RS::ARRAY_COMPRESS_WEIGHTS) {
src_size[i] = 8;
dst_size[i] = 8;
} else {
@@ -2213,7 +2213,7 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
}
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
src_size[i] = 0;
dst_size[i] = 0;
@@ -2234,7 +2234,7 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
int src_offset = 0;
int dst_offset = 0;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
if (src_size[i] == 0) {
continue; //no go
@@ -2272,27 +2272,27 @@ static Vector<uint8_t> _unpack_half_floats(const Vector<uint8_t> &array, uint32_
return ret;
}
-void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes, const Vector<AABB> &p_bone_aabbs) {
+void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, RS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes, const Vector<AABB> &p_bone_aabbs) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
- ERR_FAIL_COND(!(p_format & VS::ARRAY_FORMAT_VERTEX));
+ ERR_FAIL_COND(!(p_format & RS::ARRAY_FORMAT_VERTEX));
//must have index and bones, both.
{
- uint32_t bones_weight = VS::ARRAY_FORMAT_BONES | VS::ARRAY_FORMAT_WEIGHTS;
+ uint32_t bones_weight = RS::ARRAY_FORMAT_BONES | RS::ARRAY_FORMAT_WEIGHTS;
ERR_FAIL_COND_MSG((p_format & bones_weight) && (p_format & bones_weight) != bones_weight, "Array must have both bones and weights in format or none.");
}
//bool has_morph = p_blend_shapes.size();
- Surface::Attrib attribs[VS::ARRAY_MAX];
+ Surface::Attrib attribs[RS::ARRAY_MAX];
int stride = 0;
bool uses_half_float = false;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
attribs[i].index = i;
@@ -2308,15 +2308,15 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
- if (p_format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ if (p_format & RS::ARRAY_FLAG_USE_2D_VERTICES) {
attribs[i].size = 2;
} else {
- attribs[i].size = (p_format & VS::ARRAY_COMPRESS_VERTEX) ? 4 : 3;
+ attribs[i].size = (p_format & RS::ARRAY_COMPRESS_VERTEX) ? 4 : 3;
}
- if (p_format & VS::ARRAY_COMPRESS_VERTEX) {
+ if (p_format & RS::ARRAY_COMPRESS_VERTEX) {
attribs[i].type = _GL_HALF_FLOAT_OES;
stride += attribs[i].size * 2;
uses_half_float = true;
@@ -2328,11 +2328,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
attribs[i].normalized = GL_FALSE;
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
attribs[i].size = 3;
- if (p_format & VS::ARRAY_COMPRESS_NORMAL) {
+ if (p_format & RS::ARRAY_COMPRESS_NORMAL) {
attribs[i].type = GL_BYTE;
stride += 4; //pad extra byte
attribs[i].normalized = GL_TRUE;
@@ -2343,11 +2343,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
}
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
attribs[i].size = 4;
- if (p_format & VS::ARRAY_COMPRESS_TANGENT) {
+ if (p_format & RS::ARRAY_COMPRESS_TANGENT) {
attribs[i].type = GL_BYTE;
stride += 4;
attribs[i].normalized = GL_TRUE;
@@ -2358,11 +2358,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
attribs[i].size = 4;
- if (p_format & VS::ARRAY_COMPRESS_COLOR) {
+ if (p_format & RS::ARRAY_COMPRESS_COLOR) {
attribs[i].type = GL_UNSIGNED_BYTE;
stride += 4;
attribs[i].normalized = GL_TRUE;
@@ -2373,11 +2373,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
attribs[i].size = 2;
- if (p_format & VS::ARRAY_COMPRESS_TEX_UV) {
+ if (p_format & RS::ARRAY_COMPRESS_TEX_UV) {
attribs[i].type = _GL_HALF_FLOAT_OES;
stride += 4;
uses_half_float = true;
@@ -2389,11 +2389,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
attribs[i].normalized = GL_FALSE;
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
attribs[i].size = 2;
- if (p_format & VS::ARRAY_COMPRESS_TEX_UV2) {
+ if (p_format & RS::ARRAY_COMPRESS_TEX_UV2) {
attribs[i].type = _GL_HALF_FLOAT_OES;
stride += 4;
uses_half_float = true;
@@ -2404,11 +2404,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
attribs[i].normalized = GL_FALSE;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
attribs[i].size = 4;
- if (p_format & VS::ARRAY_FLAG_USE_16_BIT_BONES) {
+ if (p_format & RS::ARRAY_FLAG_USE_16_BIT_BONES) {
attribs[i].type = GL_UNSIGNED_SHORT;
stride += 8;
} else {
@@ -2420,11 +2420,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
attribs[i].integer = true;
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
attribs[i].size = 4;
- if (p_format & VS::ARRAY_COMPRESS_WEIGHTS) {
+ if (p_format & RS::ARRAY_COMPRESS_WEIGHTS) {
attribs[i].type = GL_UNSIGNED_SHORT;
stride += 8;
@@ -2436,7 +2436,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
}
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
attribs[i].size = 1;
@@ -2454,7 +2454,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
}
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX - 1; i++) {
attribs[i].stride = stride;
}
@@ -2500,9 +2500,9 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
return; //do not go any further, above function used unpacked stuff will be used instead.
}
- if (p_format & VS::ARRAY_FORMAT_INDEX) {
+ if (p_format & RS::ARRAY_FORMAT_INDEX) {
- index_array_size = attribs[VS::ARRAY_INDEX].stride * p_index_count;
+ index_array_size = attribs[RS::ARRAY_INDEX].stride * p_index_count;
}
ERR_FAIL_COND(p_index_array.size() != index_array_size);
@@ -2545,7 +2545,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
surface->skeleton_bone_used.write[i] = !(surface->skeleton_bone_aabb[i].size.x < 0 || surface->skeleton_bone_aabb[i].size.y < 0 || surface->skeleton_bone_aabb[i].size.z < 0);
}
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
surface->attribs[i] = attribs[i];
}
@@ -2555,11 +2555,11 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
glGenBuffers(1, &surface->vertex_id);
glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
- glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), (p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), (p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
- if (p_format & VS::ARRAY_FORMAT_INDEX) {
+ if (p_format & RS::ARRAY_FORMAT_INDEX) {
const uint8_t *ir = p_index_array.ptr();
glGenBuffers(1, &surface->index_id);
@@ -2616,16 +2616,16 @@ int RasterizerStorageGLES2::mesh_get_blend_shape_count(RID p_mesh) const {
return mesh->blend_shape_count;
}
-void RasterizerStorageGLES2::mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) {
+void RasterizerStorageGLES2::mesh_set_blend_shape_mode(RID p_mesh, RS::BlendShapeMode p_mode) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
mesh->blend_shape_mode = p_mode;
}
-VS::BlendShapeMode RasterizerStorageGLES2::mesh_get_blend_shape_mode(RID p_mesh) const {
+RS::BlendShapeMode RasterizerStorageGLES2::mesh_get_blend_shape_mode(RID p_mesh) const {
const Mesh *mesh = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!mesh, VS::BLEND_SHAPE_MODE_NORMALIZED);
+ ERR_FAIL_COND_V(!mesh, RS::BLEND_SHAPE_MODE_NORMALIZED);
return mesh->blend_shape_mode;
}
@@ -2723,10 +2723,10 @@ uint32_t RasterizerStorageGLES2::mesh_surface_get_format(RID p_mesh, int p_surfa
return mesh->surfaces[p_surface]->format;
}
-VS::PrimitiveType RasterizerStorageGLES2::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const {
+RS::PrimitiveType RasterizerStorageGLES2::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const {
const Mesh *mesh = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!mesh, VS::PRIMITIVE_MAX);
- ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), VS::PRIMITIVE_MAX);
+ ERR_FAIL_COND_V(!mesh, RS::PRIMITIVE_MAX);
+ ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), RS::PRIMITIVE_MAX);
return mesh->surfaces[p_surface]->primitive;
}
@@ -2827,7 +2827,7 @@ AABB RasterizerStorageGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
for (int i = 0; i < mesh->surfaces.size(); i++) {
AABB laabb;
- if ((mesh->surfaces[i]->format & VS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->skeleton_bone_aabb.size()) {
+ if ((mesh->surfaces[i]->format & RS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->skeleton_bone_aabb.size()) {
int bs = mesh->surfaces[i]->skeleton_bone_aabb.size();
const AABB *skbones = mesh->surfaces[i]->skeleton_bone_aabb.ptr();
@@ -2939,7 +2939,7 @@ RID RasterizerStorageGLES2::multimesh_create() {
return multimesh_owner.make_rid(multimesh);
}
-void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format, VS::MultimeshCustomDataFormat p_data) {
+void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances, RS::MultimeshTransformFormat p_transform_format, RS::MultimeshColorFormat p_color_format, RS::MultimeshCustomDataFormat p_data) {
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
@@ -2957,23 +2957,23 @@ void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances
multimesh->data.resize(0);
}
- if (multimesh->transform_format == VS::MULTIMESH_TRANSFORM_2D) {
+ if (multimesh->transform_format == RS::MULTIMESH_TRANSFORM_2D) {
multimesh->xform_floats = 8;
} else {
multimesh->xform_floats = 12;
}
- if (multimesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
+ if (multimesh->color_format == RS::MULTIMESH_COLOR_8BIT) {
multimesh->color_floats = 1;
- } else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) {
+ } else if (multimesh->color_format == RS::MULTIMESH_COLOR_FLOAT) {
multimesh->color_floats = 4;
} else {
multimesh->color_floats = 0;
}
- if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_8BIT) {
+ if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_8BIT) {
multimesh->custom_data_floats = 1;
- } else if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_FLOAT) {
+ } else if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_FLOAT) {
multimesh->custom_data_floats = 4;
} else {
multimesh->custom_data_floats = 0;
@@ -2987,7 +2987,7 @@ void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances
int color_from = 0;
int custom_data_from = 0;
- if (multimesh->transform_format == VS::MULTIMESH_TRANSFORM_2D) {
+ if (multimesh->transform_format == RS::MULTIMESH_TRANSFORM_2D) {
multimesh->data.write[i + 0] = 1.0;
multimesh->data.write[i + 1] = 0.0;
multimesh->data.write[i + 2] = 0.0;
@@ -3015,7 +3015,7 @@ void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances
custom_data_from = 12;
}
- if (multimesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
+ if (multimesh->color_format == RS::MULTIMESH_COLOR_8BIT) {
union {
uint32_t colu;
float colf;
@@ -3024,7 +3024,7 @@ void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances
cu.colu = 0xFFFFFFFF;
multimesh->data.write[i + color_from + 0] = cu.colf;
custom_data_from = color_from + 1;
- } else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) {
+ } else if (multimesh->color_format == RS::MULTIMESH_COLOR_FLOAT) {
multimesh->data.write[i + color_from + 0] = 1.0;
multimesh->data.write[i + color_from + 1] = 1.0;
multimesh->data.write[i + color_from + 2] = 1.0;
@@ -3032,7 +3032,7 @@ void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances
custom_data_from = color_from + 4;
}
- if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_8BIT) {
+ if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_8BIT) {
union {
uint32_t colu;
float colf;
@@ -3040,7 +3040,7 @@ void RasterizerStorageGLES2::multimesh_allocate(RID p_multimesh, int p_instances
cu.colu = 0;
multimesh->data.write[i + custom_data_from + 0] = cu.colf;
- } else if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_FLOAT) {
+ } else if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_FLOAT) {
multimesh->data.write[i + custom_data_from + 0] = 0.0;
multimesh->data.write[i + custom_data_from + 1] = 0.0;
multimesh->data.write[i + custom_data_from + 2] = 0.0;
@@ -3094,7 +3094,7 @@ void RasterizerStorageGLES2::multimesh_instance_set_transform(RID p_multimesh, i
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->size);
- ERR_FAIL_COND(multimesh->transform_format == VS::MULTIMESH_TRANSFORM_2D);
+ ERR_FAIL_COND(multimesh->transform_format == RS::MULTIMESH_TRANSFORM_2D);
int stride = multimesh->color_floats + multimesh->custom_data_floats + multimesh->xform_floats;
@@ -3125,7 +3125,7 @@ void RasterizerStorageGLES2::multimesh_instance_set_transform_2d(RID p_multimesh
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->size);
- ERR_FAIL_COND(multimesh->transform_format == VS::MULTIMESH_TRANSFORM_3D);
+ ERR_FAIL_COND(multimesh->transform_format == RS::MULTIMESH_TRANSFORM_3D);
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index];
@@ -3151,13 +3151,13 @@ void RasterizerStorageGLES2::multimesh_instance_set_color(RID p_multimesh, int p
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->size);
- ERR_FAIL_COND(multimesh->color_format == VS::MULTIMESH_COLOR_NONE);
- ERR_FAIL_INDEX(multimesh->color_format, VS::MULTIMESH_COLOR_MAX);
+ ERR_FAIL_COND(multimesh->color_format == RS::MULTIMESH_COLOR_NONE);
+ ERR_FAIL_INDEX(multimesh->color_format, RS::MULTIMESH_COLOR_MAX);
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index + multimesh->xform_floats];
- if (multimesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
+ if (multimesh->color_format == RS::MULTIMESH_COLOR_8BIT) {
uint8_t *data8 = (uint8_t *)dataptr;
data8[0] = CLAMP(p_color.r * 255.0, 0, 255);
@@ -3165,7 +3165,7 @@ void RasterizerStorageGLES2::multimesh_instance_set_color(RID p_multimesh, int p
data8[2] = CLAMP(p_color.b * 255.0, 0, 255);
data8[3] = CLAMP(p_color.a * 255.0, 0, 255);
- } else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) {
+ } else if (multimesh->color_format == RS::MULTIMESH_COLOR_FLOAT) {
dataptr[0] = p_color.r;
dataptr[1] = p_color.g;
dataptr[2] = p_color.b;
@@ -3184,13 +3184,13 @@ void RasterizerStorageGLES2::multimesh_instance_set_custom_data(RID p_multimesh,
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->size);
- ERR_FAIL_COND(multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_NONE);
- ERR_FAIL_INDEX(multimesh->custom_data_format, VS::MULTIMESH_CUSTOM_DATA_MAX);
+ ERR_FAIL_COND(multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_NONE);
+ ERR_FAIL_INDEX(multimesh->custom_data_format, RS::MULTIMESH_CUSTOM_DATA_MAX);
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index + multimesh->xform_floats + multimesh->color_floats];
- if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_8BIT) {
+ if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_8BIT) {
uint8_t *data8 = (uint8_t *)dataptr;
data8[0] = CLAMP(p_custom_data.r * 255.0, 0, 255);
@@ -3198,7 +3198,7 @@ void RasterizerStorageGLES2::multimesh_instance_set_custom_data(RID p_multimesh,
data8[2] = CLAMP(p_custom_data.b * 255.0, 0, 255);
data8[3] = CLAMP(p_custom_data.a * 255.0, 0, 255);
- } else if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_FLOAT) {
+ } else if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_FLOAT) {
dataptr[0] = p_custom_data.r;
dataptr[1] = p_custom_data.g;
dataptr[2] = p_custom_data.b;
@@ -3224,7 +3224,7 @@ Transform RasterizerStorageGLES2::multimesh_instance_get_transform(RID p_multime
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Transform());
ERR_FAIL_INDEX_V(p_index, multimesh->size, Transform());
- ERR_FAIL_COND_V(multimesh->transform_format == VS::MULTIMESH_TRANSFORM_2D, Transform());
+ ERR_FAIL_COND_V(multimesh->transform_format == RS::MULTIMESH_TRANSFORM_2D, Transform());
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index];
@@ -3251,7 +3251,7 @@ Transform2D RasterizerStorageGLES2::multimesh_instance_get_transform_2d(RID p_mu
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Transform2D());
ERR_FAIL_INDEX_V(p_index, multimesh->size, Transform2D());
- ERR_FAIL_COND_V(multimesh->transform_format == VS::MULTIMESH_TRANSFORM_3D, Transform2D());
+ ERR_FAIL_COND_V(multimesh->transform_format == RS::MULTIMESH_TRANSFORM_3D, Transform2D());
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index];
@@ -3272,13 +3272,13 @@ Color RasterizerStorageGLES2::multimesh_instance_get_color(RID p_multimesh, int
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Color());
ERR_FAIL_INDEX_V(p_index, multimesh->size, Color());
- ERR_FAIL_COND_V(multimesh->color_format == VS::MULTIMESH_COLOR_NONE, Color());
- ERR_FAIL_INDEX_V(multimesh->color_format, VS::MULTIMESH_COLOR_MAX, Color());
+ ERR_FAIL_COND_V(multimesh->color_format == RS::MULTIMESH_COLOR_NONE, Color());
+ ERR_FAIL_INDEX_V(multimesh->color_format, RS::MULTIMESH_COLOR_MAX, Color());
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index + multimesh->xform_floats];
- if (multimesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
+ if (multimesh->color_format == RS::MULTIMESH_COLOR_8BIT) {
union {
uint32_t colu;
float colf;
@@ -3288,7 +3288,7 @@ Color RasterizerStorageGLES2::multimesh_instance_get_color(RID p_multimesh, int
return Color::hex(BSWAP32(cu.colu));
- } else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) {
+ } else if (multimesh->color_format == RS::MULTIMESH_COLOR_FLOAT) {
Color c;
c.r = dataptr[0];
c.g = dataptr[1];
@@ -3305,13 +3305,13 @@ Color RasterizerStorageGLES2::multimesh_instance_get_custom_data(RID p_multimesh
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Color());
ERR_FAIL_INDEX_V(p_index, multimesh->size, Color());
- ERR_FAIL_COND_V(multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_NONE, Color());
- ERR_FAIL_INDEX_V(multimesh->custom_data_format, VS::MULTIMESH_CUSTOM_DATA_MAX, Color());
+ ERR_FAIL_COND_V(multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_NONE, Color());
+ ERR_FAIL_INDEX_V(multimesh->custom_data_format, RS::MULTIMESH_CUSTOM_DATA_MAX, Color());
int stride = multimesh->color_floats + multimesh->xform_floats + multimesh->custom_data_floats;
float *dataptr = &multimesh->data.write[stride * p_index + multimesh->xform_floats + multimesh->color_floats];
- if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_8BIT) {
+ if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_8BIT) {
union {
uint32_t colu;
float colf;
@@ -3321,7 +3321,7 @@ Color RasterizerStorageGLES2::multimesh_instance_get_custom_data(RID p_multimesh
return Color::hex(BSWAP32(cu.colu));
- } else if (multimesh->custom_data_format == VS::MULTIMESH_CUSTOM_DATA_FLOAT) {
+ } else if (multimesh->custom_data_format == RS::MULTIMESH_CUSTOM_DATA_FLOAT) {
Color c;
c.r = dataptr[0];
c.g = dataptr[1];
@@ -3400,7 +3400,7 @@ void RasterizerStorageGLES2::update_dirty_multimeshes() {
AABB aabb;
- if (multimesh->transform_format == VS::MULTIMESH_TRANSFORM_2D) {
+ if (multimesh->transform_format == RS::MULTIMESH_TRANSFORM_2D) {
for (int i = 0; i < count; i += stride) {
@@ -3472,7 +3472,7 @@ RID RasterizerStorageGLES2::immediate_create() {
return immediate_owner.make_rid(im);
}
-void RasterizerStorageGLES2::immediate_begin(RID p_immediate, VS::PrimitiveType p_primitive, RID p_texture) {
+void RasterizerStorageGLES2::immediate_begin(RID p_immediate, RS::PrimitiveType p_primitive, RID p_texture) {
Immediate *im = immediate_owner.getornull(p_immediate);
ERR_FAIL_COND(!im);
ERR_FAIL_COND(im->building);
@@ -3499,17 +3499,17 @@ void RasterizerStorageGLES2::immediate_vertex(RID p_immediate, const Vector3 &p_
im->aabb.expand_to(p_vertex);
}
- if (im->mask & VS::ARRAY_FORMAT_NORMAL)
+ if (im->mask & RS::ARRAY_FORMAT_NORMAL)
c->normals.push_back(chunk_normal);
- if (im->mask & VS::ARRAY_FORMAT_TANGENT)
+ if (im->mask & RS::ARRAY_FORMAT_TANGENT)
c->tangents.push_back(chunk_tangent);
- if (im->mask & VS::ARRAY_FORMAT_COLOR)
+ if (im->mask & RS::ARRAY_FORMAT_COLOR)
c->colors.push_back(chunk_color);
- if (im->mask & VS::ARRAY_FORMAT_TEX_UV)
+ if (im->mask & RS::ARRAY_FORMAT_TEX_UV)
c->uvs.push_back(chunk_uv);
- if (im->mask & VS::ARRAY_FORMAT_TEX_UV2)
+ if (im->mask & RS::ARRAY_FORMAT_TEX_UV2)
c->uv2s.push_back(chunk_uv2);
- im->mask |= VS::ARRAY_FORMAT_VERTEX;
+ im->mask |= RS::ARRAY_FORMAT_VERTEX;
c->vertices.push_back(p_vertex);
}
@@ -3518,7 +3518,7 @@ void RasterizerStorageGLES2::immediate_normal(RID p_immediate, const Vector3 &p_
ERR_FAIL_COND(!im);
ERR_FAIL_COND(!im->building);
- im->mask |= VS::ARRAY_FORMAT_NORMAL;
+ im->mask |= RS::ARRAY_FORMAT_NORMAL;
chunk_normal = p_normal;
}
@@ -3527,7 +3527,7 @@ void RasterizerStorageGLES2::immediate_tangent(RID p_immediate, const Plane &p_t
ERR_FAIL_COND(!im);
ERR_FAIL_COND(!im->building);
- im->mask |= VS::ARRAY_FORMAT_TANGENT;
+ im->mask |= RS::ARRAY_FORMAT_TANGENT;
chunk_tangent = p_tangent;
}
@@ -3536,7 +3536,7 @@ void RasterizerStorageGLES2::immediate_color(RID p_immediate, const Color &p_col
ERR_FAIL_COND(!im);
ERR_FAIL_COND(!im->building);
- im->mask |= VS::ARRAY_FORMAT_COLOR;
+ im->mask |= RS::ARRAY_FORMAT_COLOR;
chunk_color = p_color;
}
@@ -3545,7 +3545,7 @@ void RasterizerStorageGLES2::immediate_uv(RID p_immediate, const Vector2 &tex_uv
ERR_FAIL_COND(!im);
ERR_FAIL_COND(!im->building);
- im->mask |= VS::ARRAY_FORMAT_TEX_UV;
+ im->mask |= RS::ARRAY_FORMAT_TEX_UV;
chunk_uv = tex_uv;
}
@@ -3554,7 +3554,7 @@ void RasterizerStorageGLES2::immediate_uv2(RID p_immediate, const Vector2 &tex_u
ERR_FAIL_COND(!im);
ERR_FAIL_COND(!im->building);
- im->mask |= VS::ARRAY_FORMAT_TEX_UV2;
+ im->mask |= RS::ARRAY_FORMAT_TEX_UV2;
chunk_uv2 = tex_uv;
}
@@ -3812,34 +3812,34 @@ void RasterizerStorageGLES2::update_dirty_skeletons() {
/* Light API */
-RID RasterizerStorageGLES2::light_create(VS::LightType p_type) {
+RID RasterizerStorageGLES2::light_create(RS::LightType p_type) {
Light *light = memnew(Light);
light->type = p_type;
- light->param[VS::LIGHT_PARAM_ENERGY] = 1.0;
- light->param[VS::LIGHT_PARAM_INDIRECT_ENERGY] = 1.0;
- light->param[VS::LIGHT_PARAM_SPECULAR] = 0.5;
- light->param[VS::LIGHT_PARAM_RANGE] = 1.0;
- light->param[VS::LIGHT_PARAM_SPOT_ANGLE] = 45;
- light->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE] = 45;
- light->param[VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE] = 0;
- light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET] = 0.1;
- light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET] = 0.3;
- light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET] = 0.6;
- light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] = 0.1;
- light->param[VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE] = 0.1;
+ light->param[RS::LIGHT_PARAM_ENERGY] = 1.0;
+ light->param[RS::LIGHT_PARAM_INDIRECT_ENERGY] = 1.0;
+ light->param[RS::LIGHT_PARAM_SPECULAR] = 0.5;
+ light->param[RS::LIGHT_PARAM_RANGE] = 1.0;
+ light->param[RS::LIGHT_PARAM_SPOT_ANGLE] = 45;
+ light->param[RS::LIGHT_PARAM_CONTACT_SHADOW_SIZE] = 45;
+ light->param[RS::LIGHT_PARAM_SHADOW_MAX_DISTANCE] = 0;
+ light->param[RS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET] = 0.1;
+ light->param[RS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET] = 0.3;
+ light->param[RS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET] = 0.6;
+ light->param[RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] = 0.1;
+ light->param[RS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE] = 0.1;
light->color = Color(1, 1, 1, 1);
light->shadow = false;
light->negative = false;
light->cull_mask = 0xFFFFFFFF;
- light->directional_shadow_mode = VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL;
- light->omni_shadow_mode = VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID;
- light->omni_shadow_detail = VS::LIGHT_OMNI_SHADOW_DETAIL_VERTICAL;
+ light->directional_shadow_mode = RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL;
+ light->omni_shadow_mode = RS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID;
+ light->omni_shadow_detail = RS::LIGHT_OMNI_SHADOW_DETAIL_VERTICAL;
light->directional_blend_splits = false;
- light->directional_range_mode = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE;
+ light->directional_range_mode = RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE;
light->reverse_cull = false;
light->use_gi = true;
light->version = 0;
@@ -3854,20 +3854,20 @@ void RasterizerStorageGLES2::light_set_color(RID p_light, const Color &p_color)
light->color = p_color;
}
-void RasterizerStorageGLES2::light_set_param(RID p_light, VS::LightParam p_param, float p_value) {
+void RasterizerStorageGLES2::light_set_param(RID p_light, RS::LightParam p_param, float p_value) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
- ERR_FAIL_INDEX(p_param, VS::LIGHT_PARAM_MAX);
+ ERR_FAIL_INDEX(p_param, RS::LIGHT_PARAM_MAX);
switch (p_param) {
- case VS::LIGHT_PARAM_RANGE:
- case VS::LIGHT_PARAM_SPOT_ANGLE:
- case VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE:
- case VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET:
- case VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET:
- case VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET:
- case VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS:
- case VS::LIGHT_PARAM_SHADOW_BIAS: {
+ case RS::LIGHT_PARAM_RANGE:
+ case RS::LIGHT_PARAM_SPOT_ANGLE:
+ case RS::LIGHT_PARAM_SHADOW_MAX_DISTANCE:
+ case RS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET:
+ case RS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET:
+ case RS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET:
+ case RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS:
+ case RS::LIGHT_PARAM_SHADOW_BIAS: {
light->version++;
light->instance_change_notify(true, false);
} break;
@@ -3939,7 +3939,7 @@ void RasterizerStorageGLES2::light_set_use_gi(RID p_light, bool p_enabled) {
light->instance_change_notify(true, false);
}
-void RasterizerStorageGLES2::light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {
+void RasterizerStorageGLES2::light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
@@ -3949,14 +3949,14 @@ void RasterizerStorageGLES2::light_omni_set_shadow_mode(RID p_light, VS::LightOm
light->instance_change_notify(true, false);
}
-VS::LightOmniShadowMode RasterizerStorageGLES2::light_omni_get_shadow_mode(RID p_light) {
+RS::LightOmniShadowMode RasterizerStorageGLES2::light_omni_get_shadow_mode(RID p_light) {
Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_OMNI_SHADOW_CUBE);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_OMNI_SHADOW_CUBE);
return light->omni_shadow_mode;
}
-void RasterizerStorageGLES2::light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail) {
+void RasterizerStorageGLES2::light_omni_set_shadow_detail(RID p_light, RS::LightOmniShadowDetail p_detail) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
@@ -3966,7 +3966,7 @@ void RasterizerStorageGLES2::light_omni_set_shadow_detail(RID p_light, VS::Light
light->instance_change_notify(true, false);
}
-void RasterizerStorageGLES2::light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) {
+void RasterizerStorageGLES2::light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
@@ -3992,37 +3992,37 @@ bool RasterizerStorageGLES2::light_directional_get_blend_splits(RID p_light) con
return light->directional_blend_splits;
}
-VS::LightDirectionalShadowMode RasterizerStorageGLES2::light_directional_get_shadow_mode(RID p_light) {
+RS::LightDirectionalShadowMode RasterizerStorageGLES2::light_directional_get_shadow_mode(RID p_light) {
Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL);
return light->directional_shadow_mode;
}
-void RasterizerStorageGLES2::light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode) {
+void RasterizerStorageGLES2::light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
light->directional_range_mode = p_range_mode;
}
-VS::LightDirectionalShadowDepthRangeMode RasterizerStorageGLES2::light_directional_get_shadow_depth_range_mode(RID p_light) const {
+RS::LightDirectionalShadowDepthRangeMode RasterizerStorageGLES2::light_directional_get_shadow_depth_range_mode(RID p_light) const {
Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE);
return light->directional_range_mode;
}
-VS::LightType RasterizerStorageGLES2::light_get_type(RID p_light) const {
+RS::LightType RasterizerStorageGLES2::light_get_type(RID p_light) const {
Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
return light->type;
}
-float RasterizerStorageGLES2::light_get_param(RID p_light, VS::LightParam p_param) {
+float RasterizerStorageGLES2::light_get_param(RID p_light, RS::LightParam p_param) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND_V(!light, 0.0);
- ERR_FAIL_INDEX_V(p_param, VS::LIGHT_PARAM_MAX, 0.0);
+ ERR_FAIL_INDEX_V(p_param, RS::LIGHT_PARAM_MAX, 0.0);
return light->param[p_param];
}
@@ -4061,18 +4061,18 @@ AABB RasterizerStorageGLES2::light_get_aabb(RID p_light) const {
switch (light->type) {
- case VS::LIGHT_SPOT: {
- float len = light->param[VS::LIGHT_PARAM_RANGE];
- float size = Math::tan(Math::deg2rad(light->param[VS::LIGHT_PARAM_SPOT_ANGLE])) * len;
+ case RS::LIGHT_SPOT: {
+ float len = light->param[RS::LIGHT_PARAM_RANGE];
+ float size = Math::tan(Math::deg2rad(light->param[RS::LIGHT_PARAM_SPOT_ANGLE])) * len;
return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
};
- case VS::LIGHT_OMNI: {
- float r = light->param[VS::LIGHT_PARAM_RANGE];
+ case RS::LIGHT_OMNI: {
+ float r = light->param[RS::LIGHT_PARAM_RANGE];
return AABB(-Vector3(r, r, r), Vector3(r, r, r) * 2);
};
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
return AABB();
};
}
@@ -4097,13 +4097,13 @@ RID RasterizerStorageGLES2::reflection_probe_create() {
reflection_probe->box_projection = false;
reflection_probe->enable_shadows = false;
reflection_probe->cull_mask = (1 << 20) - 1;
- reflection_probe->update_mode = VS::REFLECTION_PROBE_UPDATE_ONCE;
+ reflection_probe->update_mode = RS::REFLECTION_PROBE_UPDATE_ONCE;
reflection_probe->resolution = 128;
return reflection_probe_owner.make_rid(reflection_probe);
}
-void RasterizerStorageGLES2::reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode) {
+void RasterizerStorageGLES2::reflection_probe_set_update_mode(RID p_probe, RS::ReflectionProbeUpdateMode p_mode) {
ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
ERR_FAIL_COND(!reflection_probe);
@@ -4220,10 +4220,10 @@ AABB RasterizerStorageGLES2::reflection_probe_get_aabb(RID p_probe) const {
return aabb;
}
-VS::ReflectionProbeUpdateMode RasterizerStorageGLES2::reflection_probe_get_update_mode(RID p_probe) const {
+RS::ReflectionProbeUpdateMode RasterizerStorageGLES2::reflection_probe_get_update_mode(RID p_probe) const {
const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
- ERR_FAIL_COND_V(!reflection_probe, VS::REFLECTION_PROBE_UPDATE_ALWAYS);
+ ERR_FAIL_COND_V(!reflection_probe, RS::REFLECTION_PROBE_UPDATE_ALWAYS);
return reflection_probe->update_mode;
}
@@ -4518,7 +4518,7 @@ void RasterizerStorageGLES2::particles_set_fractional_delta(RID p_particles, boo
void RasterizerStorageGLES2::particles_set_process_material(RID p_particles, RID p_material) {
}
-void RasterizerStorageGLES2::particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) {
+void RasterizerStorageGLES2::particles_set_draw_order(RID p_particles, RS::ParticlesDrawOrder p_order) {
}
void RasterizerStorageGLES2::particles_set_draw_passes(RID p_particles, int p_passes) {
@@ -4581,35 +4581,35 @@ void RasterizerStorageGLES2::instance_add_dependency(RID p_base, RasterizerScene
Instantiable *inst = NULL;
switch (p_instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
inst = mesh_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
inst = multimesh_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
inst = immediate_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- /*case VS::INSTANCE_PARTICLES: {
+ /*case RS::INSTANCE_PARTICLES: {
inst = particles_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;*/
- case VS::INSTANCE_REFLECTION_PROBE: {
+ case RS::INSTANCE_REFLECTION_PROBE: {
inst = reflection_probe_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- case VS::INSTANCE_LIGHT: {
+ case RS::INSTANCE_LIGHT: {
inst = light_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- /*case VS::INSTANCE_GI_PROBE: {
+ /*case RS::INSTANCE_GI_PROBE: {
inst = gi_probe_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;*/
- case VS::INSTANCE_LIGHTMAP_CAPTURE: {
+ case RS::INSTANCE_LIGHTMAP_CAPTURE: {
inst = lightmap_capture_data_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
@@ -4626,35 +4626,35 @@ void RasterizerStorageGLES2::instance_remove_dependency(RID p_base, RasterizerSc
Instantiable *inst = NULL;
switch (p_instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
inst = mesh_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
inst = multimesh_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
inst = immediate_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- /*case VS::INSTANCE_PARTICLES: {
+ /*case RS::INSTANCE_PARTICLES: {
inst = particles_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;*/
- case VS::INSTANCE_REFLECTION_PROBE: {
+ case RS::INSTANCE_REFLECTION_PROBE: {
inst = reflection_probe_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- case VS::INSTANCE_LIGHT: {
+ case RS::INSTANCE_LIGHT: {
inst = light_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
- /*case VS::INSTANCE_GI_PROBE: {
+ /*case RS::INSTANCE_GI_PROBE: {
inst = gi_probe_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break; */
- case VS::INSTANCE_LIGHTMAP_CAPTURE: {
+ case RS::INSTANCE_LIGHTMAP_CAPTURE: {
inst = lightmap_capture_data_owner.getornull(p_base);
ERR_FAIL_COND(!inst);
} break;
@@ -4723,7 +4723,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, rt->width, rt->height, 0, color_format, color_type, NULL);
- if (texture->flags & VS::TEXTURE_FLAG_FILTER) {
+ if (texture->flags & RS::TEXTURE_FLAG_FILTER) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -4805,7 +4805,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
/* For MSAA */
#ifndef JAVASCRIPT_ENABLED
- if (rt->msaa >= VS::VIEWPORT_MSAA_2X && rt->msaa <= VS::VIEWPORT_MSAA_16X && config.multisample_supported) {
+ if (rt->msaa >= RS::VIEWPORT_MSAA_2X && rt->msaa <= RS::VIEWPORT_MSAA_16X && config.multisample_supported) {
rt->multisample_active = true;
@@ -5134,7 +5134,7 @@ RID RasterizerStorageGLES2::render_target_create() {
Texture *t = memnew(Texture);
- t->type = VS::TEXTURE_TYPE_2D;
+ t->type = RS::TEXTURE_TYPE_2D;
t->flags = 0;
t->width = 0;
t->height = 0;
@@ -5235,7 +5235,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar
// allocate a texture
t = memnew(Texture);
- t->type = VS::TEXTURE_TYPE_2D;
+ t->type = RS::TEXTURE_TYPE_2D;
t->flags = 0;
t->width = 0;
t->height = 0;
@@ -5278,7 +5278,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar
// Switch our texture on our frame buffer
#if ANDROID_ENABLED
- if (rt->msaa >= VS::VIEWPORT_MSAA_EXT_2X && rt->msaa <= VS::VIEWPORT_MSAA_EXT_4X) {
+ if (rt->msaa >= RS::VIEWPORT_MSAA_EXT_2X && rt->msaa <= RS::VIEWPORT_MSAA_EXT_4X) {
// This code only applies to the Oculus Go and Oculus Quest. Due to the the tiled nature
// of the GPU we can do a single render pass by rendering directly into our texture chains
// texture and apply MSAA as we render.
@@ -5287,7 +5287,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar
// the normal MSAA modes need to be used to enable our two pass approach
static const int msaa_value[] = { 2, 4 };
- int msaa = msaa_value[rt->msaa - VS::VIEWPORT_MSAA_EXT_2X];
+ int msaa = msaa_value[rt->msaa - RS::VIEWPORT_MSAA_EXT_2X];
if (rt->external.depth == 0) {
// create a multisample depth buffer, we're not reusing Godots because Godot's didn't get created..
@@ -5370,7 +5370,7 @@ void RasterizerStorageGLES2::render_target_set_as_unused(RID p_render_target) {
rt->used_in_frame = false;
}
-void RasterizerStorageGLES2::render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa) {
+void RasterizerStorageGLES2::render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) {
RenderTarget *rt = render_target_owner.getornull(p_render_target);
ERR_FAIL_COND(!rt);
@@ -5544,22 +5544,22 @@ void RasterizerStorageGLES2::canvas_light_occluder_set_polylines(RID p_occluder,
}
}
-VS::InstanceType RasterizerStorageGLES2::get_base_type(RID p_rid) const {
+RS::InstanceType RasterizerStorageGLES2::get_base_type(RID p_rid) const {
if (mesh_owner.owns(p_rid)) {
- return VS::INSTANCE_MESH;
+ return RS::INSTANCE_MESH;
} else if (light_owner.owns(p_rid)) {
- return VS::INSTANCE_LIGHT;
+ return RS::INSTANCE_LIGHT;
} else if (multimesh_owner.owns(p_rid)) {
- return VS::INSTANCE_MULTIMESH;
+ return RS::INSTANCE_MULTIMESH;
} else if (immediate_owner.owns(p_rid)) {
- return VS::INSTANCE_IMMEDIATE;
+ return RS::INSTANCE_IMMEDIATE;
} else if (reflection_probe_owner.owns(p_rid)) {
- return VS::INSTANCE_REFLECTION_PROBE;
+ return RS::INSTANCE_REFLECTION_PROBE;
} else if (lightmap_capture_data_owner.owns(p_rid)) {
- return VS::INSTANCE_LIGHTMAP_CAPTURE;
+ return RS::INSTANCE_LIGHTMAP_CAPTURE;
} else {
- return VS::INSTANCE_NONE;
+ return RS::INSTANCE_NONE;
}
}
@@ -5710,7 +5710,7 @@ bool RasterizerStorageGLES2::free(RID p_rid) {
}
}
- multimesh_allocate(p_rid, 0, VS::MULTIMESH_TRANSFORM_3D, VS::MULTIMESH_COLOR_NONE);
+ multimesh_allocate(p_rid, 0, RS::MULTIMESH_TRANSFORM_3D, RS::MULTIMESH_COLOR_NONE);
update_dirty_multimeshes();
@@ -5817,25 +5817,25 @@ void RasterizerStorageGLES2::render_info_end_capture() {
info.snap.vertices_count = info.render.vertices_count - info.snap.vertices_count;
}
-int RasterizerStorageGLES2::get_captured_render_info(VS::RenderInfo p_info) {
+int RasterizerStorageGLES2::get_captured_render_info(RS::RenderInfo p_info) {
switch (p_info) {
- case VS::INFO_OBJECTS_IN_FRAME: {
+ case RS::INFO_OBJECTS_IN_FRAME: {
return info.snap.object_count;
} break;
- case VS::INFO_VERTICES_IN_FRAME: {
+ case RS::INFO_VERTICES_IN_FRAME: {
return info.snap.vertices_count;
} break;
- case VS::INFO_MATERIAL_CHANGES_IN_FRAME: {
+ case RS::INFO_MATERIAL_CHANGES_IN_FRAME: {
return info.snap.material_switch_count;
} break;
- case VS::INFO_SHADER_CHANGES_IN_FRAME: {
+ case RS::INFO_SHADER_CHANGES_IN_FRAME: {
return info.snap.shader_rebind_count;
} break;
- case VS::INFO_SURFACE_CHANGES_IN_FRAME: {
+ case RS::INFO_SURFACE_CHANGES_IN_FRAME: {
return info.snap.surface_switch_count;
} break;
- case VS::INFO_DRAW_CALLS_IN_FRAME: {
+ case RS::INFO_DRAW_CALLS_IN_FRAME: {
return info.snap.draw_call_count;
} break;
default: {
@@ -5844,27 +5844,27 @@ int RasterizerStorageGLES2::get_captured_render_info(VS::RenderInfo p_info) {
}
}
-int RasterizerStorageGLES2::get_render_info(VS::RenderInfo p_info) {
+int RasterizerStorageGLES2::get_render_info(RS::RenderInfo p_info) {
switch (p_info) {
- case VS::INFO_OBJECTS_IN_FRAME:
+ case RS::INFO_OBJECTS_IN_FRAME:
return info.render_final.object_count;
- case VS::INFO_VERTICES_IN_FRAME:
+ case RS::INFO_VERTICES_IN_FRAME:
return info.render_final.vertices_count;
- case VS::INFO_MATERIAL_CHANGES_IN_FRAME:
+ case RS::INFO_MATERIAL_CHANGES_IN_FRAME:
return info.render_final.material_switch_count;
- case VS::INFO_SHADER_CHANGES_IN_FRAME:
+ case RS::INFO_SHADER_CHANGES_IN_FRAME:
return info.render_final.shader_rebind_count;
- case VS::INFO_SURFACE_CHANGES_IN_FRAME:
+ case RS::INFO_SURFACE_CHANGES_IN_FRAME:
return info.render_final.surface_switch_count;
- case VS::INFO_DRAW_CALLS_IN_FRAME:
+ case RS::INFO_DRAW_CALLS_IN_FRAME:
return info.render_final.draw_call_count;
- case VS::INFO_USAGE_VIDEO_MEM_TOTAL:
+ case RS::INFO_USAGE_VIDEO_MEM_TOTAL:
return 0; //no idea
- case VS::INFO_VIDEO_MEM_USED:
+ case RS::INFO_VIDEO_MEM_USED:
return info.vertex_mem + info.texture_mem;
- case VS::INFO_TEXTURE_MEM_USED:
+ case RS::INFO_TEXTURE_MEM_USED:
return info.texture_mem;
- case VS::INFO_VERTEX_MEM_USED:
+ case RS::INFO_VERTEX_MEM_USED:
return info.vertex_mem;
default:
return 0; //no idea either
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h
index 86965730e0..f8b8b824bd 100644
--- a/drivers/gles2/rasterizer_storage_gles2.h
+++ b/drivers/gles2/rasterizer_storage_gles2.h
@@ -32,8 +32,8 @@
#define RASTERIZERSTORAGEGLES2_H
#include "core/self_list.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering/shader_language.h"
#include "shader_compiler_gles2.h"
#include "shader_gles2.h"
@@ -249,7 +249,7 @@ public:
int width, height, depth;
int alloc_width, alloc_height;
Image::Format format;
- VS::TextureType type;
+ RS::TextureType type;
GLenum target;
GLenum gl_format_cache;
@@ -279,13 +279,13 @@ public:
bool redraw_if_visible;
- VisualServer::TextureDetectCallback detect_3d;
+ RenderingServer::TextureDetectCallback detect_3d;
void *detect_3d_ud;
- VisualServer::TextureDetectCallback detect_srgb;
+ RenderingServer::TextureDetectCallback detect_srgb;
void *detect_srgb_ud;
- VisualServer::TextureDetectCallback detect_normal;
+ RenderingServer::TextureDetectCallback detect_normal;
void *detect_normal_ud;
Texture() :
@@ -296,7 +296,7 @@ public:
alloc_width(0),
alloc_height(0),
format(Image::FORMAT_L8),
- type(VS::TEXTURE_TYPE_2D),
+ type(RS::TEXTURE_TYPE_2D),
target(0),
data_size(0),
total_data_size(0),
@@ -345,14 +345,14 @@ public:
Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_force_decompress) const;
virtual RID texture_create();
- virtual void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, VS::TextureType p_type, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT);
+ virtual void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, RS::TextureType p_type, uint32_t p_flags = RS::TEXTURE_FLAGS_DEFAULT);
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, int p_layer = 0);
virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, int p_layer = 0);
virtual Ref<Image> texture_get_data(RID p_texture, int p_layer = 0) const;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
virtual uint32_t texture_get_flags(RID p_texture) const;
virtual Image::Format texture_get_format(RID p_texture) const;
- virtual VS::TextureType texture_get_type(RID p_texture) const;
+ virtual RS::TextureType texture_get_type(RID p_texture) const;
virtual uint32_t texture_get_texid(RID p_texture) const;
virtual uint32_t texture_get_width(RID p_texture) const;
virtual uint32_t texture_get_height(RID p_texture) const;
@@ -365,7 +365,7 @@ public:
virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable);
- virtual void texture_debug_usage(List<VS::TextureInfo> *r_info);
+ virtual void texture_debug_usage(List<RS::TextureInfo> *r_info);
virtual RID texture_create_radiance_cubemap(RID p_source, int p_resolution = -1) const;
@@ -374,9 +374,9 @@ public:
virtual void texture_set_proxy(RID p_texture, RID p_proxy);
virtual Size2 texture_size_with_proxy(RID p_texture) const;
- virtual void texture_set_detect_3d_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
- virtual void texture_set_detect_srgb_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
- virtual void texture_set_detect_normal_callback(RID p_texture, VisualServer::TextureDetectCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_3d_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_srgb_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_normal_callback(RID p_texture, RenderingServer::TextureDetectCallback p_callback, void *p_userdata);
virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable);
@@ -402,7 +402,7 @@ public:
RID self;
- VS::ShaderMode mode;
+ RS::ShaderMode mode;
ShaderGLES2 *shader;
String code;
SelfList<Material>::List materials;
@@ -617,7 +617,7 @@ public:
uint32_t offset;
};
- Attrib attribs[VS::ARRAY_MAX];
+ Attrib attribs[RS::ARRAY_MAX];
Mesh *mesh;
uint32_t format;
@@ -641,7 +641,7 @@ public:
int array_byte_size;
int index_array_byte_size;
- VS::PrimitiveType primitive;
+ RS::PrimitiveType primitive;
Vector<AABB> skeleton_bone_aabb;
Vector<bool> skeleton_bone_used;
@@ -660,7 +660,7 @@ public:
index_array_len(0),
array_byte_size(0),
index_array_byte_size(0),
- primitive(VS::PRIMITIVE_POINTS),
+ primitive(RS::PRIMITIVE_POINTS),
active(false),
total_data_size(0) {
}
@@ -675,7 +675,7 @@ public:
Vector<Surface *> surfaces;
int blend_shape_count;
- VS::BlendShapeMode blend_shape_mode;
+ RS::BlendShapeMode blend_shape_mode;
AABB custom_aabb;
@@ -694,7 +694,7 @@ public:
Mesh() :
blend_shape_count(0),
- blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED) {
+ blend_shape_mode(RS::BLEND_SHAPE_MODE_NORMALIZED) {
}
};
@@ -702,13 +702,13 @@ public:
virtual RID mesh_create();
- virtual void mesh_add_surface(RID p_mesh, uint32_t p_format, VS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes = Vector<Vector<uint8_t>>(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>());
+ virtual void mesh_add_surface(RID p_mesh, uint32_t p_format, RS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes = Vector<Vector<uint8_t>>(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>());
virtual void mesh_set_blend_shape_count(RID p_mesh, int p_amount);
virtual int mesh_get_blend_shape_count(RID p_mesh) const;
- virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode);
- virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const;
+ virtual void mesh_set_blend_shape_mode(RID p_mesh, RS::BlendShapeMode p_mode);
+ virtual RS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const;
virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const Vector<uint8_t> &p_data);
@@ -722,7 +722,7 @@ public:
virtual Vector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const;
virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const;
- virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const;
+ virtual RS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const;
virtual AABB mesh_surface_get_aabb(RID p_mesh, int p_surface) const;
virtual Vector<Vector<uint8_t>> mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const;
@@ -744,9 +744,9 @@ public:
RID mesh;
int size;
- VS::MultimeshTransformFormat transform_format;
- VS::MultimeshColorFormat color_format;
- VS::MultimeshCustomDataFormat custom_data_format;
+ RS::MultimeshTransformFormat transform_format;
+ RS::MultimeshColorFormat color_format;
+ RS::MultimeshCustomDataFormat custom_data_format;
Vector<float> data;
@@ -766,9 +766,9 @@ public:
MultiMesh() :
size(0),
- transform_format(VS::MULTIMESH_TRANSFORM_2D),
- color_format(VS::MULTIMESH_COLOR_NONE),
- custom_data_format(VS::MULTIMESH_CUSTOM_DATA_NONE),
+ transform_format(RS::MULTIMESH_TRANSFORM_2D),
+ color_format(RS::MULTIMESH_COLOR_NONE),
+ custom_data_format(RS::MULTIMESH_CUSTOM_DATA_NONE),
update_list(this),
mesh_list(this),
visible_instances(-1),
@@ -786,7 +786,7 @@ public:
virtual RID multimesh_create();
- virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format, VS::MultimeshCustomDataFormat p_data = VS::MULTIMESH_CUSTOM_DATA_NONE);
+ virtual void multimesh_allocate(RID p_multimesh, int p_instances, RS::MultimeshTransformFormat p_transform_format, RS::MultimeshColorFormat p_color_format, RS::MultimeshCustomDataFormat p_data = RS::MULTIMESH_CUSTOM_DATA_NONE);
virtual int multimesh_get_instance_count(RID p_multimesh) const;
virtual void multimesh_set_mesh(RID p_multimesh, RID p_mesh);
@@ -817,7 +817,7 @@ public:
struct Chunk {
RID texture;
- VS::PrimitiveType primitive;
+ RS::PrimitiveType primitive;
Vector<Vector3> vertices;
Vector<Vector3> normals;
Vector<Plane> tangents;
@@ -846,7 +846,7 @@ public:
mutable RID_PtrOwner<Immediate> immediate_owner;
virtual RID immediate_create();
- virtual void immediate_begin(RID p_immediate, VS::PrimitiveType p_primitive, RID p_texture = RID());
+ virtual void immediate_begin(RID p_immediate, RS::PrimitiveType p_primitive, RID p_texture = RID());
virtual void immediate_vertex(RID p_immediate, const Vector3 &p_vertex);
virtual void immediate_normal(RID p_immediate, const Vector3 &p_normal);
virtual void immediate_tangent(RID p_immediate, const Plane &p_tangent);
@@ -906,8 +906,8 @@ public:
/* Light API */
struct Light : Instantiable {
- VS::LightType type;
- float param[VS::LIGHT_PARAM_MAX];
+ RS::LightType type;
+ float param[RS::LIGHT_PARAM_MAX];
Color color;
Color shadow_color;
@@ -921,11 +921,11 @@ public:
uint32_t cull_mask;
- VS::LightOmniShadowMode omni_shadow_mode;
- VS::LightOmniShadowDetail omni_shadow_detail;
+ RS::LightOmniShadowMode omni_shadow_mode;
+ RS::LightOmniShadowDetail omni_shadow_detail;
- VS::LightDirectionalShadowMode directional_shadow_mode;
- VS::LightDirectionalShadowDepthRangeMode directional_range_mode;
+ RS::LightDirectionalShadowMode directional_shadow_mode;
+ RS::LightDirectionalShadowDepthRangeMode directional_range_mode;
bool directional_blend_splits;
@@ -934,10 +934,10 @@ public:
mutable RID_PtrOwner<Light> light_owner;
- virtual RID light_create(VS::LightType p_type);
+ virtual RID light_create(RS::LightType p_type);
virtual void light_set_color(RID p_light, const Color &p_color);
- virtual void light_set_param(RID p_light, VS::LightParam p_param, float p_value);
+ virtual void light_set_param(RID p_light, RS::LightParam p_param, float p_value);
virtual void light_set_shadow(RID p_light, bool p_enabled);
virtual void light_set_shadow_color(RID p_light, const Color &p_color);
virtual void light_set_projector(RID p_light, RID p_texture);
@@ -946,23 +946,23 @@ public:
virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled);
virtual void light_set_use_gi(RID p_light, bool p_enabled);
- virtual void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode);
- virtual void light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail);
+ virtual void light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode);
+ virtual void light_omni_set_shadow_detail(RID p_light, RS::LightOmniShadowDetail p_detail);
- virtual void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode);
+ virtual void light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode);
virtual void light_directional_set_blend_splits(RID p_light, bool p_enable);
virtual bool light_directional_get_blend_splits(RID p_light) const;
- virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light);
- virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light);
+ virtual RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light);
+ virtual RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light);
- virtual void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode);
- virtual VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const;
+ virtual void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode);
+ virtual RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const;
virtual bool light_has_shadow(RID p_light) const;
- virtual VS::LightType light_get_type(RID p_light) const;
- virtual float light_get_param(RID p_light, VS::LightParam p_param);
+ virtual RS::LightType light_get_type(RID p_light) const;
+ virtual float light_get_param(RID p_light, RS::LightParam p_param);
virtual Color light_get_color(RID p_light);
virtual bool light_get_use_gi(RID p_light);
@@ -973,7 +973,7 @@ public:
struct ReflectionProbe : Instantiable {
- VS::ReflectionProbeUpdateMode update_mode;
+ RS::ReflectionProbeUpdateMode update_mode;
float intensity;
Color interior_ambient;
float interior_ambient_energy;
@@ -992,7 +992,7 @@ public:
virtual RID reflection_probe_create();
- virtual void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode);
+ virtual void reflection_probe_set_update_mode(RID p_probe, RS::ReflectionProbeUpdateMode p_mode);
virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity);
virtual void reflection_probe_set_interior_ambient(RID p_probe, const Color &p_ambient);
virtual void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy);
@@ -1007,7 +1007,7 @@ public:
virtual void reflection_probe_set_resolution(RID p_probe, int p_resolution);
virtual AABB reflection_probe_get_aabb(RID p_probe) const;
- virtual VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const;
+ virtual RS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const;
virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const;
virtual int reflection_probe_get_resolution(RID p_probe) const;
@@ -1111,7 +1111,7 @@ public:
virtual void particles_set_fractional_delta(RID p_particles, bool p_enable);
virtual void particles_restart(RID p_particles);
- virtual void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order);
+ virtual void particles_set_draw_order(RID p_particles, RS::ParticlesDrawOrder p_order);
virtual void particles_set_draw_passes(RID p_particles, int p_passes);
virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh);
@@ -1203,7 +1203,7 @@ public:
bool flags[RENDER_TARGET_FLAG_MAX];
bool used_in_frame;
- VS::ViewportMSAA msaa;
+ RS::ViewportMSAA msaa;
RID texture;
@@ -1223,7 +1223,7 @@ public:
width(0),
height(0),
used_in_frame(false),
- msaa(VS::VIEWPORT_MSAA_DISABLED),
+ msaa(RS::VIEWPORT_MSAA_DISABLED),
used_dof_blur_near(false),
mip_maps_allocated(false) {
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) {
@@ -1247,7 +1247,7 @@ public:
virtual void render_target_set_flag(RID p_render_target, RenderTargetFlags p_flag, bool p_value);
virtual bool render_target_was_used(RID p_render_target);
virtual void render_target_set_as_unused(RID p_render_target);
- virtual void render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa);
+ virtual void render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa);
/* CANVAS SHADOW */
@@ -1279,7 +1279,7 @@ public:
virtual RID canvas_light_occluder_create();
virtual void canvas_light_occluder_set_polylines(RID p_occluder, const Vector<Vector2> &p_lines);
- virtual VS::InstanceType get_base_type(RID p_rid) const;
+ virtual RS::InstanceType get_base_type(RID p_rid) const;
virtual bool free(RID p_rid);
@@ -1309,9 +1309,9 @@ public:
virtual void render_info_begin_capture();
virtual void render_info_end_capture();
- virtual int get_captured_render_info(VS::RenderInfo p_info);
+ virtual int get_captured_render_info(RS::RenderInfo p_info);
- virtual int get_render_info(VS::RenderInfo p_info);
+ virtual int get_render_info(RS::RenderInfo p_info);
virtual String get_video_adapter_name() const;
virtual String get_video_adapter_vendor() const;
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index 620fcdbdca..d626263431 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -934,7 +934,7 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
return code.as_string();
}
-Error ShaderCompilerGLES2::compile(VS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code) {
+Error ShaderCompilerGLES2::compile(RS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code) {
Error err = parser.compile(p_code, ShaderTypes::get_singleton()->get_functions(p_mode), ShaderTypes::get_singleton()->get_modes(p_mode), ShaderTypes::get_singleton()->get_types());
@@ -975,210 +975,210 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
/** CANVAS ITEM SHADER **/
- actions[VS::SHADER_CANVAS_ITEM].renames["VERTEX"] = "outvec.xy";
- actions[VS::SHADER_CANVAS_ITEM].renames["UV"] = "uv";
- actions[VS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"] = "point_size";
-
- actions[VS::SHADER_CANVAS_ITEM].renames["WORLD_MATRIX"] = "modelview_matrix";
- actions[VS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"] = "projection_matrix";
- actions[VS::SHADER_CANVAS_ITEM].renames["EXTRA_MATRIX"] = "extra_matrix_instance";
- actions[VS::SHADER_CANVAS_ITEM].renames["TIME"] = "time";
- actions[VS::SHADER_CANVAS_ITEM].renames["AT_LIGHT_PASS"] = "at_light_pass";
- actions[VS::SHADER_CANVAS_ITEM].renames["INSTANCE_CUSTOM"] = "instance_custom";
-
- actions[VS::SHADER_CANVAS_ITEM].renames["COLOR"] = "color";
- actions[VS::SHADER_CANVAS_ITEM].renames["NORMAL"] = "normal";
- actions[VS::SHADER_CANVAS_ITEM].renames["NORMALMAP"] = "normal_map";
- actions[VS::SHADER_CANVAS_ITEM].renames["NORMALMAP_DEPTH"] = "normal_depth";
- actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE"] = "color_texture";
- actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE_PIXEL_SIZE"] = "color_texpixel_size";
- actions[VS::SHADER_CANVAS_ITEM].renames["NORMAL_TEXTURE"] = "normal_texture";
- actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_UV"] = "screen_uv";
- actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_TEXTURE"] = "screen_texture";
- actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_PIXEL_SIZE"] = "screen_pixel_size";
- actions[VS::SHADER_CANVAS_ITEM].renames["FRAGCOORD"] = "gl_FragCoord";
- actions[VS::SHADER_CANVAS_ITEM].renames["POINT_COORD"] = "gl_PointCoord";
-
- actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_VEC"] = "light_vec";
- actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_HEIGHT"] = "light_height";
- actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_COLOR"] = "light_color";
- actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_UV"] = "light_uv";
- actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT"] = "light";
- actions[VS::SHADER_CANVAS_ITEM].renames["SHADOW_COLOR"] = "shadow_color";
- actions[VS::SHADER_CANVAS_ITEM].renames["SHADOW_VEC"] = "shadow_vec";
-
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["COLOR"] = "#define COLOR_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_PIXEL_SIZE"] = "@SCREEN_UV";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMAL"] = "#define NORMAL_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMALMAP"] = "#define NORMALMAP_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
- actions[VS::SHADER_CANVAS_ITEM].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["SHADOW_VEC"] = "#define SHADOW_VEC_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].renames["VERTEX"] = "outvec.xy";
+ actions[RS::SHADER_CANVAS_ITEM].renames["UV"] = "uv";
+ actions[RS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"] = "point_size";
+
+ actions[RS::SHADER_CANVAS_ITEM].renames["WORLD_MATRIX"] = "modelview_matrix";
+ actions[RS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"] = "projection_matrix";
+ actions[RS::SHADER_CANVAS_ITEM].renames["EXTRA_MATRIX"] = "extra_matrix_instance";
+ actions[RS::SHADER_CANVAS_ITEM].renames["TIME"] = "time";
+ actions[RS::SHADER_CANVAS_ITEM].renames["AT_LIGHT_PASS"] = "at_light_pass";
+ actions[RS::SHADER_CANVAS_ITEM].renames["INSTANCE_CUSTOM"] = "instance_custom";
+
+ actions[RS::SHADER_CANVAS_ITEM].renames["COLOR"] = "color";
+ actions[RS::SHADER_CANVAS_ITEM].renames["NORMAL"] = "normal";
+ actions[RS::SHADER_CANVAS_ITEM].renames["NORMALMAP"] = "normal_map";
+ actions[RS::SHADER_CANVAS_ITEM].renames["NORMALMAP_DEPTH"] = "normal_depth";
+ actions[RS::SHADER_CANVAS_ITEM].renames["TEXTURE"] = "color_texture";
+ actions[RS::SHADER_CANVAS_ITEM].renames["TEXTURE_PIXEL_SIZE"] = "color_texpixel_size";
+ actions[RS::SHADER_CANVAS_ITEM].renames["NORMAL_TEXTURE"] = "normal_texture";
+ actions[RS::SHADER_CANVAS_ITEM].renames["SCREEN_UV"] = "screen_uv";
+ actions[RS::SHADER_CANVAS_ITEM].renames["SCREEN_TEXTURE"] = "screen_texture";
+ actions[RS::SHADER_CANVAS_ITEM].renames["SCREEN_PIXEL_SIZE"] = "screen_pixel_size";
+ actions[RS::SHADER_CANVAS_ITEM].renames["FRAGCOORD"] = "gl_FragCoord";
+ actions[RS::SHADER_CANVAS_ITEM].renames["POINT_COORD"] = "gl_PointCoord";
+
+ actions[RS::SHADER_CANVAS_ITEM].renames["LIGHT_VEC"] = "light_vec";
+ actions[RS::SHADER_CANVAS_ITEM].renames["LIGHT_HEIGHT"] = "light_height";
+ actions[RS::SHADER_CANVAS_ITEM].renames["LIGHT_COLOR"] = "light_color";
+ actions[RS::SHADER_CANVAS_ITEM].renames["LIGHT_UV"] = "light_uv";
+ actions[RS::SHADER_CANVAS_ITEM].renames["LIGHT"] = "light";
+ actions[RS::SHADER_CANVAS_ITEM].renames["SHADOW_COLOR"] = "shadow_color";
+ actions[RS::SHADER_CANVAS_ITEM].renames["SHADOW_VEC"] = "shadow_vec";
+
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["COLOR"] = "#define COLOR_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_PIXEL_SIZE"] = "@SCREEN_UV";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["NORMAL"] = "#define NORMAL_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["NORMALMAP"] = "#define NORMALMAP_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
+ actions[RS::SHADER_CANVAS_ITEM].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["SHADOW_VEC"] = "#define SHADOW_VEC_USED\n";
// Ported from GLES3
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["sinh"] = "#define SINH_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["cosh"] = "#define COSH_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["tanh"] = "#define TANH_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["asinh"] = "#define ASINH_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["acosh"] = "#define ACOSH_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["atanh"] = "#define ATANH_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["determinant"] = "#define DETERMINANT_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["transpose"] = "#define TRANSPOSE_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["outerProduct"] = "#define OUTER_PRODUCT_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["round"] = "#define ROUND_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["roundEven"] = "#define ROUND_EVEN_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["inverse"] = "#define INVERSE_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["isinf"] = "#define IS_INF_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["isnan"] = "#define IS_NAN_USED\n";
- actions[VS::SHADER_CANVAS_ITEM].usage_defines["trunc"] = "#define TRUNC_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["sinh"] = "#define SINH_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["cosh"] = "#define COSH_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["tanh"] = "#define TANH_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["asinh"] = "#define ASINH_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["acosh"] = "#define ACOSH_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["atanh"] = "#define ATANH_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["determinant"] = "#define DETERMINANT_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["transpose"] = "#define TRANSPOSE_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["outerProduct"] = "#define OUTER_PRODUCT_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["round"] = "#define ROUND_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["roundEven"] = "#define ROUND_EVEN_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["inverse"] = "#define INVERSE_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["isinf"] = "#define IS_INF_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["isnan"] = "#define IS_NAN_USED\n";
+ actions[RS::SHADER_CANVAS_ITEM].usage_defines["trunc"] = "#define TRUNC_USED\n";
/** SPATIAL SHADER **/
- actions[VS::SHADER_SPATIAL].renames["WORLD_MATRIX"] = "world_transform";
- actions[VS::SHADER_SPATIAL].renames["INV_CAMERA_MATRIX"] = "camera_inverse_matrix";
- actions[VS::SHADER_SPATIAL].renames["CAMERA_MATRIX"] = "camera_matrix";
- actions[VS::SHADER_SPATIAL].renames["PROJECTION_MATRIX"] = "projection_matrix";
- actions[VS::SHADER_SPATIAL].renames["INV_PROJECTION_MATRIX"] = "projection_inverse_matrix";
- actions[VS::SHADER_SPATIAL].renames["MODELVIEW_MATRIX"] = "modelview";
-
- actions[VS::SHADER_SPATIAL].renames["VERTEX"] = "vertex.xyz";
- actions[VS::SHADER_SPATIAL].renames["NORMAL"] = "normal";
- actions[VS::SHADER_SPATIAL].renames["TANGENT"] = "tangent";
- actions[VS::SHADER_SPATIAL].renames["BINORMAL"] = "binormal";
- actions[VS::SHADER_SPATIAL].renames["POSITION"] = "position";
- actions[VS::SHADER_SPATIAL].renames["UV"] = "uv_interp";
- actions[VS::SHADER_SPATIAL].renames["UV2"] = "uv2_interp";
- actions[VS::SHADER_SPATIAL].renames["COLOR"] = "color_interp";
- actions[VS::SHADER_SPATIAL].renames["POINT_SIZE"] = "point_size";
+ actions[RS::SHADER_SPATIAL].renames["WORLD_MATRIX"] = "world_transform";
+ actions[RS::SHADER_SPATIAL].renames["INV_CAMERA_MATRIX"] = "camera_inverse_matrix";
+ actions[RS::SHADER_SPATIAL].renames["CAMERA_MATRIX"] = "camera_matrix";
+ actions[RS::SHADER_SPATIAL].renames["PROJECTION_MATRIX"] = "projection_matrix";
+ actions[RS::SHADER_SPATIAL].renames["INV_PROJECTION_MATRIX"] = "projection_inverse_matrix";
+ actions[RS::SHADER_SPATIAL].renames["MODELVIEW_MATRIX"] = "modelview";
+
+ actions[RS::SHADER_SPATIAL].renames["VERTEX"] = "vertex.xyz";
+ actions[RS::SHADER_SPATIAL].renames["NORMAL"] = "normal";
+ actions[RS::SHADER_SPATIAL].renames["TANGENT"] = "tangent";
+ actions[RS::SHADER_SPATIAL].renames["BINORMAL"] = "binormal";
+ actions[RS::SHADER_SPATIAL].renames["POSITION"] = "position";
+ actions[RS::SHADER_SPATIAL].renames["UV"] = "uv_interp";
+ actions[RS::SHADER_SPATIAL].renames["UV2"] = "uv2_interp";
+ actions[RS::SHADER_SPATIAL].renames["COLOR"] = "color_interp";
+ actions[RS::SHADER_SPATIAL].renames["POINT_SIZE"] = "point_size";
// gl_InstanceID is not available in OpenGL ES 2.0
- actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "0";
+ actions[RS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "0";
//builtins
- actions[VS::SHADER_SPATIAL].renames["TIME"] = "time";
- actions[VS::SHADER_SPATIAL].renames["VIEWPORT_SIZE"] = "viewport_size";
-
- actions[VS::SHADER_SPATIAL].renames["FRAGCOORD"] = "gl_FragCoord";
- actions[VS::SHADER_SPATIAL].renames["FRONT_FACING"] = "gl_FrontFacing";
- actions[VS::SHADER_SPATIAL].renames["NORMALMAP"] = "normalmap";
- actions[VS::SHADER_SPATIAL].renames["NORMALMAP_DEPTH"] = "normaldepth";
- actions[VS::SHADER_SPATIAL].renames["ALBEDO"] = "albedo";
- actions[VS::SHADER_SPATIAL].renames["ALPHA"] = "alpha";
- actions[VS::SHADER_SPATIAL].renames["METALLIC"] = "metallic";
- actions[VS::SHADER_SPATIAL].renames["SPECULAR"] = "specular";
- actions[VS::SHADER_SPATIAL].renames["ROUGHNESS"] = "roughness";
- actions[VS::SHADER_SPATIAL].renames["RIM"] = "rim";
- actions[VS::SHADER_SPATIAL].renames["RIM_TINT"] = "rim_tint";
- actions[VS::SHADER_SPATIAL].renames["CLEARCOAT"] = "clearcoat";
- actions[VS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"] = "clearcoat_gloss";
- actions[VS::SHADER_SPATIAL].renames["ANISOTROPY"] = "anisotropy";
- actions[VS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"] = "anisotropy_flow";
- actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength";
- actions[VS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission";
- actions[VS::SHADER_SPATIAL].renames["AO"] = "ao";
- actions[VS::SHADER_SPATIAL].renames["AO_LIGHT_AFFECT"] = "ao_light_affect";
- actions[VS::SHADER_SPATIAL].renames["EMISSION"] = "emission";
- actions[VS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord";
- actions[VS::SHADER_SPATIAL].renames["INSTANCE_CUSTOM"] = "instance_custom";
- actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv";
- actions[VS::SHADER_SPATIAL].renames["SCREEN_TEXTURE"] = "screen_texture";
- actions[VS::SHADER_SPATIAL].renames["DEPTH_TEXTURE"] = "depth_texture";
+ actions[RS::SHADER_SPATIAL].renames["TIME"] = "time";
+ actions[RS::SHADER_SPATIAL].renames["VIEWPORT_SIZE"] = "viewport_size";
+
+ actions[RS::SHADER_SPATIAL].renames["FRAGCOORD"] = "gl_FragCoord";
+ actions[RS::SHADER_SPATIAL].renames["FRONT_FACING"] = "gl_FrontFacing";
+ actions[RS::SHADER_SPATIAL].renames["NORMALMAP"] = "normalmap";
+ actions[RS::SHADER_SPATIAL].renames["NORMALMAP_DEPTH"] = "normaldepth";
+ actions[RS::SHADER_SPATIAL].renames["ALBEDO"] = "albedo";
+ actions[RS::SHADER_SPATIAL].renames["ALPHA"] = "alpha";
+ actions[RS::SHADER_SPATIAL].renames["METALLIC"] = "metallic";
+ actions[RS::SHADER_SPATIAL].renames["SPECULAR"] = "specular";
+ actions[RS::SHADER_SPATIAL].renames["ROUGHNESS"] = "roughness";
+ actions[RS::SHADER_SPATIAL].renames["RIM"] = "rim";
+ actions[RS::SHADER_SPATIAL].renames["RIM_TINT"] = "rim_tint";
+ actions[RS::SHADER_SPATIAL].renames["CLEARCOAT"] = "clearcoat";
+ actions[RS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"] = "clearcoat_gloss";
+ actions[RS::SHADER_SPATIAL].renames["ANISOTROPY"] = "anisotropy";
+ actions[RS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"] = "anisotropy_flow";
+ actions[RS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength";
+ actions[RS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission";
+ actions[RS::SHADER_SPATIAL].renames["AO"] = "ao";
+ actions[RS::SHADER_SPATIAL].renames["AO_LIGHT_AFFECT"] = "ao_light_affect";
+ actions[RS::SHADER_SPATIAL].renames["EMISSION"] = "emission";
+ actions[RS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord";
+ actions[RS::SHADER_SPATIAL].renames["INSTANCE_CUSTOM"] = "instance_custom";
+ actions[RS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv";
+ actions[RS::SHADER_SPATIAL].renames["SCREEN_TEXTURE"] = "screen_texture";
+ actions[RS::SHADER_SPATIAL].renames["DEPTH_TEXTURE"] = "depth_texture";
// Defined in GLES3, but not available in GLES2
- //actions[VS::SHADER_SPATIAL].renames["DEPTH"] = "gl_FragDepth";
- actions[VS::SHADER_SPATIAL].renames["ALPHA_SCISSOR"] = "alpha_scissor";
- actions[VS::SHADER_SPATIAL].renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
+ //actions[RS::SHADER_SPATIAL].renames["DEPTH"] = "gl_FragDepth";
+ actions[RS::SHADER_SPATIAL].renames["ALPHA_SCISSOR"] = "alpha_scissor";
+ actions[RS::SHADER_SPATIAL].renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
//for light
- actions[VS::SHADER_SPATIAL].renames["VIEW"] = "view";
- actions[VS::SHADER_SPATIAL].renames["LIGHT_COLOR"] = "light_color";
- actions[VS::SHADER_SPATIAL].renames["LIGHT"] = "light";
- actions[VS::SHADER_SPATIAL].renames["ATTENUATION"] = "attenuation";
- actions[VS::SHADER_SPATIAL].renames["DIFFUSE_LIGHT"] = "diffuse_light";
- actions[VS::SHADER_SPATIAL].renames["SPECULAR_LIGHT"] = "specular_light";
-
- actions[VS::SHADER_SPATIAL].usage_defines["TANGENT"] = "#define ENABLE_TANGENT_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["BINORMAL"] = "@TANGENT";
- actions[VS::SHADER_SPATIAL].usage_defines["RIM"] = "#define LIGHT_USE_RIM\n";
- actions[VS::SHADER_SPATIAL].usage_defines["RIM_TINT"] = "@RIM";
- actions[VS::SHADER_SPATIAL].usage_defines["CLEARCOAT"] = "#define LIGHT_USE_CLEARCOAT\n";
- actions[VS::SHADER_SPATIAL].usage_defines["CLEARCOAT_GLOSS"] = "@CLEARCOAT";
- actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY"] = "#define LIGHT_USE_ANISOTROPY\n";
- actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY_FLOW"] = "@ANISOTROPY";
- actions[VS::SHADER_SPATIAL].usage_defines["AO"] = "#define ENABLE_AO\n";
- actions[VS::SHADER_SPATIAL].usage_defines["AO_LIGHT_AFFECT"] = "#define ENABLE_AO\n";
- actions[VS::SHADER_SPATIAL].usage_defines["UV"] = "#define ENABLE_UV_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["UV2"] = "#define ENABLE_UV2_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP"] = "#define ENABLE_NORMALMAP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP_DEPTH"] = "@NORMALMAP";
- actions[VS::SHADER_SPATIAL].usage_defines["COLOR"] = "#define ENABLE_COLOR_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["INSTANCE_CUSTOM"] = "#define ENABLE_INSTANCE_CUSTOM\n";
- actions[VS::SHADER_SPATIAL].usage_defines["ALPHA_SCISSOR"] = "#define ALPHA_SCISSOR_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["POSITION"] = "#define OVERRIDE_POSITION\n";
-
- actions[VS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS\n";
- actions[VS::SHADER_SPATIAL].usage_defines["TRANSMISSION"] = "#define TRANSMISSION_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["DEPTH_TEXTURE"] = "#define DEPTH_TEXTURE_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
-
- actions[VS::SHADER_SPATIAL].usage_defines["DIFFUSE_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SPECULAR_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
+ actions[RS::SHADER_SPATIAL].renames["VIEW"] = "view";
+ actions[RS::SHADER_SPATIAL].renames["LIGHT_COLOR"] = "light_color";
+ actions[RS::SHADER_SPATIAL].renames["LIGHT"] = "light";
+ actions[RS::SHADER_SPATIAL].renames["ATTENUATION"] = "attenuation";
+ actions[RS::SHADER_SPATIAL].renames["DIFFUSE_LIGHT"] = "diffuse_light";
+ actions[RS::SHADER_SPATIAL].renames["SPECULAR_LIGHT"] = "specular_light";
+
+ actions[RS::SHADER_SPATIAL].usage_defines["TANGENT"] = "#define ENABLE_TANGENT_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["BINORMAL"] = "@TANGENT";
+ actions[RS::SHADER_SPATIAL].usage_defines["RIM"] = "#define LIGHT_USE_RIM\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["RIM_TINT"] = "@RIM";
+ actions[RS::SHADER_SPATIAL].usage_defines["CLEARCOAT"] = "#define LIGHT_USE_CLEARCOAT\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["CLEARCOAT_GLOSS"] = "@CLEARCOAT";
+ actions[RS::SHADER_SPATIAL].usage_defines["ANISOTROPY"] = "#define LIGHT_USE_ANISOTROPY\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["ANISOTROPY_FLOW"] = "@ANISOTROPY";
+ actions[RS::SHADER_SPATIAL].usage_defines["AO"] = "#define ENABLE_AO\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["AO_LIGHT_AFFECT"] = "#define ENABLE_AO\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["UV"] = "#define ENABLE_UV_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["UV2"] = "#define ENABLE_UV2_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["NORMALMAP"] = "#define ENABLE_NORMALMAP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["NORMALMAP_DEPTH"] = "@NORMALMAP";
+ actions[RS::SHADER_SPATIAL].usage_defines["COLOR"] = "#define ENABLE_COLOR_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["INSTANCE_CUSTOM"] = "#define ENABLE_INSTANCE_CUSTOM\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["ALPHA_SCISSOR"] = "#define ALPHA_SCISSOR_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["POSITION"] = "#define OVERRIDE_POSITION\n";
+
+ actions[RS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["TRANSMISSION"] = "#define TRANSMISSION_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["DEPTH_TEXTURE"] = "#define DEPTH_TEXTURE_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
+
+ actions[RS::SHADER_SPATIAL].usage_defines["DIFFUSE_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["SPECULAR_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
// Ported from GLES3
- actions[VS::SHADER_SPATIAL].usage_defines["sinh"] = "#define SINH_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["cosh"] = "#define COSH_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["tanh"] = "#define TANH_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["asinh"] = "#define ASINH_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["acosh"] = "#define ACOSH_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["atanh"] = "#define ATANH_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["determinant"] = "#define DETERMINANT_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["transpose"] = "#define TRANSPOSE_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["outerProduct"] = "#define OUTER_PRODUCT_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["round"] = "#define ROUND_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["roundEven"] = "#define ROUND_EVEN_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["inverse"] = "#define INVERSE_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["isinf"] = "#define IS_INF_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["isnan"] = "#define IS_NAN_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["trunc"] = "#define TRUNC_USED\n";
-
- actions[VS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["sinh"] = "#define SINH_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["cosh"] = "#define COSH_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["tanh"] = "#define TANH_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["asinh"] = "#define ASINH_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["acosh"] = "#define ACOSH_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["atanh"] = "#define ATANH_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["determinant"] = "#define DETERMINANT_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["transpose"] = "#define TRANSPOSE_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["outerProduct"] = "#define OUTER_PRODUCT_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["round"] = "#define ROUND_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["roundEven"] = "#define ROUND_EVEN_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["inverse"] = "#define INVERSE_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["isinf"] = "#define IS_INF_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["isnan"] = "#define IS_NAN_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["trunc"] = "#define TRUNC_USED\n";
+
+ actions[RS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n";
// Defined in GLES3, could be implemented in GLES2 too if there's a need for it
- //actions[VS::SHADER_SPATIAL].render_mode_defines["ensure_correct_normals"] = "#define ENSURE_CORRECT_NORMALS\n";
+ //actions[RS::SHADER_SPATIAL].render_mode_defines["ensure_correct_normals"] = "#define ENSURE_CORRECT_NORMALS\n";
// Defined in GLES3, might not be possible in GLES2 as gl_FrontFacing is not available
- //actions[VS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
- //actions[VS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
+ //actions[RS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
+ //actions[RS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
bool force_lambert = GLOBAL_GET("rendering/quality/shading/force_lambert_over_burley");
if (!force_lambert) {
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
}
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
bool force_blinn = GLOBAL_GET("rendering/quality/shading/force_blinn_over_ggx");
if (!force_blinn) {
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
} else {
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
}
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_disabled"] = "#define SPECULAR_DISABLED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["shadows_disabled"] = "#define SHADOWS_DISABLED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["ambient_light_disabled"] = "#define AMBIENT_LIGHT_DISABLED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["shadow_to_opacity"] = "#define USE_SHADOW_TO_OPACITY\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_disabled"] = "#define SPECULAR_DISABLED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["shadows_disabled"] = "#define SHADOWS_DISABLED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["ambient_light_disabled"] = "#define AMBIENT_LIGHT_DISABLED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["shadow_to_opacity"] = "#define USE_SHADOW_TO_OPACITY\n";
// No defines for particle shaders in GLES2, there are no GPU particles
diff --git a/drivers/gles2/shader_compiler_gles2.h b/drivers/gles2/shader_compiler_gles2.h
index dd10a27c0d..757dcdd4f2 100644
--- a/drivers/gles2/shader_compiler_gles2.h
+++ b/drivers/gles2/shader_compiler_gles2.h
@@ -33,9 +33,9 @@
#include "core/pair.h"
#include "core/string_builder.h"
-#include "servers/visual/shader_language.h"
-#include "servers/visual/shader_types.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/shader_language.h"
+#include "servers/rendering/shader_types.h"
+#include "servers/rendering_server.h"
class ShaderCompilerGLES2 {
public:
@@ -91,10 +91,10 @@ private:
Set<StringName> used_rmode_defines;
Set<StringName> internal_functions;
- DefaultIdentifierActions actions[VS::SHADER_MAX];
+ DefaultIdentifierActions actions[RS::SHADER_MAX];
public:
- Error compile(VS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code);
+ Error compile(RS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code);
ShaderCompilerGLES2();
};
diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h
index d5e8159479..54858becb6 100644
--- a/drivers/gles2/shader_gles2.h
+++ b/drivers/gles2/shader_gles2.h
@@ -44,7 +44,7 @@
#include "core/math/camera_matrix.h"
#include "core/pair.h"
#include "core/variant.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
#include <stdio.h>
diff --git a/drivers/gles2/shaders/blend_shape.glsl b/drivers/gles2/shaders/blend_shape.glsl
index a1e954e33d..0d0b3e24e4 100644
--- a/drivers/gles2/shaders/blend_shape.glsl
+++ b/drivers/gles2/shaders/blend_shape.glsl
@@ -2,7 +2,7 @@
[vertex]
/*
-from VisualServer:
+from RenderingServer:
ARRAY_VERTEX=0,
ARRAY_NORMAL=1,
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 458488f3e9..76a89b2bb4 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -41,7 +41,7 @@
#include "drivers/unix/net_socket_posix.h"
#include "drivers/unix/rw_lock_posix.h"
#include "drivers/unix/thread_posix.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#ifdef __APPLE__
#include <mach-o/dyld.h>
diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h
index 7f1697b2b5..f7ae9c28ea 100644
--- a/drivers/vulkan/rendering_device_vulkan.h
+++ b/drivers/vulkan/rendering_device_vulkan.h
@@ -34,7 +34,7 @@
#include "core/oa_hash_map.h"
#include "core/os/thread_safe.h"
#include "core/rid_owner.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rendering_device.h"
#ifdef DEBUG_ENABLED
#define _DEBUG
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp
index ea0d7511fe..4467366c3f 100644
--- a/editor/animation_track_editor_plugins.cpp
+++ b/editor/animation_track_editor_plugins.cpp
@@ -303,7 +303,7 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
Vector<Color> color;
color.push_back(Color(0.75, 0.75, 0.75));
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
if (p_selected) {
Color accent = get_theme_color("accent_color", "Editor");
@@ -673,7 +673,7 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
}
if (lines.size() > 2) {
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
}
int limit = to_x - from_x - 4;
@@ -926,7 +926,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
Vector<Color> color;
color.push_back(Color(0.75, 0.75, 0.75));
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
Color cut_color = get_theme_color("accent_color", "Editor");
cut_color.a = 0.7;
@@ -1255,7 +1255,7 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
}
if (lines.size() > 2) {
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
}
int limit = to_x - from_x - 4;
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 181811207c..013ba88c30 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1569,7 +1569,7 @@ void EditorInspector::update_tree() {
} else if (!(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name))
continue;
- if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && VS::get_singleton()->is_low_end())
+ if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && RS::get_singleton()->is_low_end())
continue; //do not show this property in low end gfx
if (p.name == "script" && (hide_script || bool(object->call("_hide_script_from_inspector")))) {
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 6b332ca300..2ba67ae879 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -61,9 +61,9 @@
#include "scene/gui/texture_progress.h"
#include "scene/gui/tool_button.h"
#include "scene/resources/packed_scene.h"
-#include "servers/navigation_2d_server.h"
-#include "servers/navigation_server.h"
-#include "servers/physics_2d_server.h"
+#include "servers/navigation_server_2d.h"
+#include "servers/navigation_server_3d.h"
+#include "servers/physics_server_2d.h"
#include "editor/audio_stream_preview.h"
#include "editor/debugger/editor_debugger_node.h"
@@ -358,13 +358,13 @@ void EditorNode::_notification(int p_what) {
scene_root->set_default_canvas_item_texture_repeat(tr);
}
- VS::DOFBokehShape dof_shape = VS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape")));
- VS::get_singleton()->camera_effects_set_dof_blur_bokeh_shape(dof_shape);
- VS::DOFBlurQuality dof_quality = VS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality")));
+ RS::DOFBokehShape dof_shape = RS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape")));
+ RS::get_singleton()->camera_effects_set_dof_blur_bokeh_shape(dof_shape);
+ RS::DOFBlurQuality dof_quality = RS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality")));
bool dof_jitter = GLOBAL_GET("rendering/quality/filters/depth_of_field_use_jitter");
- VS::get_singleton()->camera_effects_set_dof_blur_quality(dof_quality, dof_jitter);
- VS::get_singleton()->environment_set_ssao_quality(VS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size"));
- VS::get_singleton()->screen_space_roughness_limiter_set_active(GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter"), GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter_curve"));
+ RS::get_singleton()->camera_effects_set_dof_blur_quality(dof_quality, dof_jitter);
+ RS::get_singleton()->environment_set_ssao_quality(RS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size"));
+ RS::get_singleton()->screen_space_roughness_limiter_set_active(GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter"), GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter_curve"));
}
ResourceImporterTexture::get_singleton()->update_imports();
@@ -404,9 +404,9 @@ void EditorNode::_notification(int p_what) {
_initializing_addons = false;
}
- VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true);
- VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
- VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
feature_profile_manager->notify_changed();
@@ -5530,12 +5530,12 @@ EditorNode::EditorNode() {
InputFilter::get_singleton()->set_use_accumulated_input(true);
Resource::_get_local_scene_func = _resource_get_edited_scene;
- VisualServer::get_singleton()->set_debug_generate_wireframes(true);
+ RenderingServer::get_singleton()->set_debug_generate_wireframes(true);
- NavigationServer::get_singleton()->set_active(false); // no nav by default if editor
+ NavigationServer3D::get_singleton()->set_active(false); // no nav by default if editor
- PhysicsServer::get_singleton()->set_active(false); // no physics by default if editor
- Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor
+ PhysicsServer3D::get_singleton()->set_active(false); // no physics by default if editor
+ PhysicsServer2D::get_singleton()->set_active(false); // no physics by default if editor
ScriptServer::set_scripting_enabled(false); // no scripting by default if editor
EditorHelp::generate_doc(); //before any editor classes are created
@@ -6011,7 +6011,7 @@ EditorNode::EditorNode() {
scene_root = memnew(SubViewport);
//scene_root->set_usage(Viewport::USAGE_2D); canvas BG mode prevents usage of this as 2D
- VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true);
scene_root->set_disable_input(true);
scene_root->set_as_audio_listener_2d(true);
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 2cafbe3cca..8faaabc1fb 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -41,7 +41,7 @@
#include "plugins/node_3d_editor_plugin.h"
#include "scene/3d/camera_3d.h"
#include "scene/gui/popup_menu.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) {
@@ -64,25 +64,25 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
int size = p_preview_size;
- RID scenario = VS::get_singleton()->scenario_create();
+ RID scenario = RS::get_singleton()->scenario_create();
- RID viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ALWAYS);
- VS::get_singleton()->viewport_set_scenario(viewport, scenario);
- VS::get_singleton()->viewport_set_size(viewport, size, size);
- VS::get_singleton()->viewport_set_transparent_background(viewport, true);
- VS::get_singleton()->viewport_set_active(viewport, true);
- RID viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ RID viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ALWAYS);
+ RS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ RS::get_singleton()->viewport_set_size(viewport, size, size);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ RID viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- RID camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport, camera);
+ RID camera = RS::get_singleton()->camera_create();
+ RS::get_singleton()->viewport_attach_camera(viewport, camera);
- RID light = VS::get_singleton()->directional_light_create();
- RID light_instance = VS::get_singleton()->instance_create2(light, scenario);
+ RID light = RS::get_singleton()->directional_light_create();
+ RID light_instance = RS::get_singleton()->instance_create2(light, scenario);
- RID light2 = VS::get_singleton()->directional_light_create();
- VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- RID light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+ RID light2 = RS::get_singleton()->directional_light_create();
+ RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ RID light_instance2 = RS::get_singleton()->instance_create2(light2, scenario);
EditorProgress ep("mlib", TTR("Creating Mesh Previews"), p_meshes.size());
@@ -101,8 +101,8 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
mesh_xform = (*p_transforms)[i];
}
- RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(), scenario);
- VS::get_singleton()->instance_set_transform(inst, mesh_xform);
+ RID inst = RS::get_singleton()->instance_create2(mesh->get_rid(), scenario);
+ RS::get_singleton()->instance_set_transform(inst, mesh_xform);
AABB aabb = mesh->get_aabb();
Vector3 ofs = aabb.position + aabb.size * 0.5;
@@ -121,32 +121,32 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
xform.invert();
xform = mesh_xform * xform;
- VS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3)));
- VS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0);
+ RS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3)));
+ RS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0);
- VS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0)));
- VS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0)));
+ RS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0)));
+ RS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0)));
ep.step(TTR("Thumbnail..."), i);
Main::iteration();
Main::iteration();
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_CONTINUE(!img.is_valid() || img->empty());
Ref<ImageTexture> it(memnew(ImageTexture));
it->create_from_image(img);
- VS::get_singleton()->free(inst);
+ RS::get_singleton()->free(inst);
textures.push_back(it);
}
- VS::get_singleton()->free(viewport);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(light_instance);
- VS::get_singleton()->free(light2);
- VS::get_singleton()->free(light_instance2);
- VS::get_singleton()->free(camera);
- VS::get_singleton()->free(scenario);
+ RS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(light);
+ RS::get_singleton()->free(light_instance);
+ RS::get_singleton()->free(light2);
+ RS::get_singleton()->free(light_instance2);
+ RS::get_singleton()->free(camera);
+ RS::get_singleton()->free(scenario);
return textures;
}
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 398850f2d6..4db8fb98f1 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -465,7 +465,7 @@ void EditorResourcePreview::stop() {
preview_sem.post();
while (!exited) {
OS::get_singleton()->delay_usec(10000);
- VisualServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server
+ RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server
}
Thread::wait_to_finish(thread);
memdelete(thread);
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index e67dd37b88..6c089d7020 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -922,10 +922,10 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
if (has_weights) {
Vector<float> weights;
Vector<int> bones;
- weights.resize(VS::ARRAY_WEIGHTS_SIZE);
- bones.resize(VS::ARRAY_WEIGHTS_SIZE);
+ weights.resize(RS::ARRAY_WEIGHTS_SIZE);
+ bones.resize(RS::ARRAY_WEIGHTS_SIZE);
//float sum=0.0;
- for (int l = 0; l < VS::ARRAY_WEIGHTS_SIZE; l++) {
+ for (int l = 0; l < RS::ARRAY_WEIGHTS_SIZE; l++) {
if (l < vertex_array[k].weights.size()) {
weights.write[l] = vertex_array[k].weights[l].weight;
bones.write[l] = vertex_array[k].weights[l].bone_idx;
@@ -963,7 +963,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
////////////////////////////
Array d = surftool->commit_to_arrays();
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
Array mr;
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 0090d30b9c..c218697423 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -36,7 +36,7 @@
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
-void ResourceImporterTexture::_texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VS::TextureDetectRoughnessChannel p_channel) {
+void ResourceImporterTexture::_texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_channel) {
MutexLock lock(singleton->mutex);
diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h
index ed0fe1be89..5f5fb75585 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -35,7 +35,7 @@
#include "core/io/resource_importer.h"
#include "core/os/file_access.h"
#include "scene/resources/texture.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class StreamTexture;
@@ -63,16 +63,16 @@ protected:
int flags;
String normal_path_for_roughness;
- VS::TextureDetectRoughnessChannel channel_for_roughness;
+ RS::TextureDetectRoughnessChannel channel_for_roughness;
MakeInfo() {
flags = 0;
- channel_for_roughness = VS::TEXTURE_DETECT_ROUGNHESS_R;
+ channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R;
}
};
Map<StringName, MakeInfo> make_flags;
- static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VisualServer::TextureDetectRoughnessChannel p_channel);
+ static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, RenderingServer::TextureDetectRoughnessChannel p_channel);
static void _texture_reimport_3d(const Ref<StreamTexture> &p_tex);
static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex);
diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp
index 67f0d991bd..40c17a9fc3 100644
--- a/editor/node_3d_editor_gizmos.cpp
+++ b/editor/node_3d_editor_gizmos.cpp
@@ -86,7 +86,7 @@ void EditorNode3DGizmo::clear() {
for (int i = 0; i < instances.size(); i++) {
if (instances[i].instance.is_valid())
- VS::get_singleton()->free(instances[i].instance);
+ RS::get_singleton()->free(instances[i].instance);
}
billboard_handle = false;
@@ -168,16 +168,16 @@ void EditorNode3DGizmo::set_spatial_node(Node3D *p_node) {
void EditorNode3DGizmo::Instance::create_instance(Node3D *p_base, bool p_hidden) {
- instance = VS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario());
- VS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id());
+ instance = RS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario());
+ RS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id());
if (skin_reference.is_valid()) {
- VS::get_singleton()->instance_attach_skeleton(instance, skin_reference->get_skeleton());
+ RS::get_singleton()->instance_attach_skeleton(instance, skin_reference->get_skeleton());
}
if (extra_margin)
- VS::get_singleton()->instance_set_extra_visibility_margin(instance, 1);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, VS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_extra_visibility_margin(instance, 1);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, RS::SHADOW_CASTING_SETTING_OFF);
int layer = p_hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER;
- VS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26
+ RS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26
}
void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const Ref<SkinReference> &p_skin_reference, const Ref<Material> &p_material) {
@@ -191,9 +191,9 @@ void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard,
ins.material = p_material;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
if (ins.material.is_valid()) {
- VS::get_singleton()->instance_geometry_set_material_override(ins.instance, p_material->get_rid());
+ RS::get_singleton()->instance_geometry_set_material_override(ins.instance, p_material->get_rid());
}
}
@@ -246,7 +246,7 @@ void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mate
ins.mesh = mesh;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
}
instances.push_back(ins);
@@ -310,7 +310,7 @@ void EditorNode3DGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
ins.billboard = true;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
}
selectable_icon_size = p_scale;
@@ -346,8 +346,8 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
Ref<ArrayMesh> mesh = memnew(ArrayMesh);
Array a;
- a.resize(VS::ARRAY_MAX);
- a[VS::ARRAY_VERTEX] = p_handles;
+ a.resize(RS::ARRAY_MAX);
+ a[RS::ARRAY_VERTEX] = p_handles;
Vector<Color> colors;
{
colors.resize(p_handles.size());
@@ -364,7 +364,7 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
w[i] = col;
}
}
- a[VS::ARRAY_COLOR] = colors;
+ a[RS::ARRAY_COLOR] = colors;
mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a);
mesh->surface_set_material(0, p_material);
@@ -384,7 +384,7 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
ins.extra_margin = true;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
}
instances.push_back(ins);
if (!p_secondary) {
@@ -410,14 +410,14 @@ void EditorNode3DGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size,
cubem.set_size(p_size);
Array arrays = cubem.surface_get_arrays(0);
- PackedVector3Array vertex = arrays[VS::ARRAY_VERTEX];
+ PackedVector3Array vertex = arrays[RS::ARRAY_VERTEX];
Vector3 *w = vertex.ptrw();
for (int i = 0; i < vertex.size(); ++i) {
w[i] += p_position;
}
- arrays[VS::ARRAY_VERTEX] = vertex;
+ arrays[RS::ARRAY_VERTEX] = vertex;
Ref<ArrayMesh> m = memnew(ArrayMesh);
m->add_surface_from_arrays(cubem.surface_get_primitive_type(0), arrays);
@@ -708,7 +708,7 @@ void EditorNode3DGizmo::transform() {
ERR_FAIL_COND(!spatial_node);
ERR_FAIL_COND(!valid);
for (int i = 0; i < instances.size(); i++) {
- VS::get_singleton()->instance_set_transform(instances[i].instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(instances[i].instance, spatial_node->get_global_transform());
}
}
@@ -720,7 +720,7 @@ void EditorNode3DGizmo::free() {
for (int i = 0; i < instances.size(); i++) {
if (instances[i].instance.is_valid())
- VS::get_singleton()->free(instances[i].instance);
+ RS::get_singleton()->free(instances[i].instance);
instances.write[i].instance = RID();
}
@@ -733,7 +733,7 @@ void EditorNode3DGizmo::set_hidden(bool p_hidden) {
hidden = p_hidden;
int layer = hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER;
for (int i = 0; i < instances.size(); ++i) {
- VS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer);
+ RS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer);
}
}
@@ -1585,7 +1585,7 @@ Position3DNode3DGizmoPlugin::Position3DNode3DGizmoPlugin() {
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
Array d;
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
d[Mesh::ARRAY_VERTEX] = cursor_points;
d[Mesh::ARRAY_COLOR] = cursor_colors;
pos3d_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, d);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 41af2ab0cc..0b0f93bcb5 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -41,7 +41,7 @@
#include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
#include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning.
#include "scene/main/window.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void AnimationPlayerEditor::_node_removed(Node *p_node) {
@@ -947,8 +947,8 @@ void AnimationPlayerEditor::forward_canvas_force_draw_over_viewport(Control *p_o
alpha += alpha_step;
if (onion.captures_valid[cidx]) {
- VS::get_singleton()->canvas_item_add_texture_rect_region(
- ci, dst_rect, VS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
+ RS::get_singleton()->canvas_item_add_texture_rect_region(
+ ci, dst_rect, RS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
}
cidx++;
@@ -961,8 +961,8 @@ void AnimationPlayerEditor::forward_canvas_force_draw_over_viewport(Control *p_o
alpha -= alpha_step;
if (onion.captures_valid[cidx]) {
- VS::get_singleton()->canvas_item_add_texture_rect_region(
- ci, dst_rect, VS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
+ RS::get_singleton()->canvas_item_add_texture_rect_region(
+ ci, dst_rect, RS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
}
cidx++;
@@ -1318,17 +1318,17 @@ void AnimationPlayerEditor::_allocate_onion_layers() {
bool is_present = onion.differences_only && i == captures - 1;
// Each capture is a viewport with a canvas item attached that renders a full-size rect with the contents of the main viewport.
- onion.captures.write[i] = VS::get_singleton()->viewport_create();
+ onion.captures.write[i] = RS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_size(onion.captures[i], capture_size.width, capture_size.height);
- VS::get_singleton()->viewport_set_update_mode(onion.captures[i], VS::VIEWPORT_UPDATE_ALWAYS);
- VS::get_singleton()->viewport_set_transparent_background(onion.captures[i], !is_present);
- VS::get_singleton()->viewport_attach_canvas(onion.captures[i], onion.capture.canvas);
+ RS::get_singleton()->viewport_set_size(onion.captures[i], capture_size.width, capture_size.height);
+ RS::get_singleton()->viewport_set_update_mode(onion.captures[i], RS::VIEWPORT_UPDATE_ALWAYS);
+ RS::get_singleton()->viewport_set_transparent_background(onion.captures[i], !is_present);
+ RS::get_singleton()->viewport_attach_canvas(onion.captures[i], onion.capture.canvas);
}
// Reset the capture canvas item to the current root viewport texture (defensive).
- VS::get_singleton()->canvas_item_clear(onion.capture.canvas_item);
- VS::get_singleton()->canvas_item_add_texture_rect(onion.capture.canvas_item, Rect2(Point2(), capture_size), get_tree()->get_root()->get_texture()->get_rid());
+ RS::get_singleton()->canvas_item_clear(onion.capture.canvas_item);
+ RS::get_singleton()->canvas_item_add_texture_rect(onion.capture.canvas_item, Rect2(Point2(), capture_size), get_tree()->get_root()->get_texture()->get_rid());
onion.capture_size = capture_size;
}
@@ -1337,7 +1337,7 @@ void AnimationPlayerEditor::_free_onion_layers() {
for (int i = 0; i < onion.captures.size(); i++) {
if (onion.captures[i].is_valid()) {
- VS::get_singleton()->free(onion.captures[i]);
+ RS::get_singleton()->free(onion.captures[i]);
}
}
onion.captures.clear();
@@ -1421,18 +1421,18 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
// Tweak the root viewport to ensure it's rendered before our target.
RID root_vp = get_tree()->get_root()->get_viewport_rid();
Rect2 root_vp_screen_rect = Rect2(Vector2(), get_tree()->get_root()->get_size());
- VS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2());
- VS::get_singleton()->viewport_set_update_mode(root_vp, VS::VIEWPORT_UPDATE_ALWAYS);
+ RS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2());
+ RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_ALWAYS);
RID present_rid;
if (onion.differences_only) {
// Capture present scene as it is.
- VS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, RID());
+ RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, RID());
present_rid = onion.captures[onion.captures.size() - 1];
- VS::get_singleton()->viewport_set_active(present_rid, true);
- VS::get_singleton()->viewport_set_parent_viewport(root_vp, present_rid);
- VS::get_singleton()->draw(false);
- VS::get_singleton()->viewport_set_active(present_rid, false);
+ RS::get_singleton()->viewport_set_active(present_rid, true);
+ RS::get_singleton()->viewport_set_parent_viewport(root_vp, present_rid);
+ RS::get_singleton()->draw(false);
+ RS::get_singleton()->viewport_set_active(present_rid, false);
}
// Backup current animation state.
@@ -1441,10 +1441,10 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
// Render every past/future step with the capture shader.
- VS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid());
+ RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid());
onion.capture.material->set_shader_param("bkg_color", GLOBAL_GET("rendering/environment/default_clear_color"));
onion.capture.material->set_shader_param("differences_only", onion.differences_only);
- onion.capture.material->set_shader_param("present", onion.differences_only ? VS::get_singleton()->viewport_get_texture(present_rid) : RID());
+ onion.capture.material->set_shader_param("present", onion.differences_only ? RS::get_singleton()->viewport_get_texture(present_rid) : RID());
int step_off_a = onion.past ? -onion.steps : 0;
int step_off_b = onion.future ? onion.steps : 0;
@@ -1468,19 +1468,19 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
get_tree()->flush_transform_notifications(); // Needed for transforms of Node3Ds.
values_backup.update_skeletons(); // Needed for Skeletons (2D & 3D).
- VS::get_singleton()->viewport_set_active(onion.captures[cidx], true);
- VS::get_singleton()->viewport_set_parent_viewport(root_vp, onion.captures[cidx]);
- VS::get_singleton()->draw(false);
- VS::get_singleton()->viewport_set_active(onion.captures[cidx], false);
+ RS::get_singleton()->viewport_set_active(onion.captures[cidx], true);
+ RS::get_singleton()->viewport_set_parent_viewport(root_vp, onion.captures[cidx]);
+ RS::get_singleton()->draw(false);
+ RS::get_singleton()->viewport_set_active(onion.captures[cidx], false);
}
cidx++;
}
// Restore root viewport.
- VS::get_singleton()->viewport_set_parent_viewport(root_vp, RID());
- VS::get_singleton()->viewport_attach_to_screen(root_vp, root_vp_screen_rect);
- VS::get_singleton()->viewport_set_update_mode(root_vp, VS::VIEWPORT_UPDATE_WHEN_VISIBLE);
+ RS::get_singleton()->viewport_set_parent_viewport(root_vp, RID());
+ RS::get_singleton()->viewport_attach_to_screen(root_vp, root_vp_screen_rect);
+ RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_WHEN_VISIBLE);
// Restore animation state
// (Seeking with update=true wouldn't do the trick because the current value of the properties
@@ -1764,9 +1764,9 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
onion.last_frame = 0;
onion.can_overlay = false;
onion.capture_size = Size2();
- onion.capture.canvas = VS::get_singleton()->canvas_create();
- onion.capture.canvas_item = VS::get_singleton()->canvas_item_create();
- VS::get_singleton()->canvas_item_set_parent(onion.capture.canvas_item, onion.capture.canvas);
+ onion.capture.canvas = RS::get_singleton()->canvas_create();
+ onion.capture.canvas_item = RS::get_singleton()->canvas_item_create();
+ RS::get_singleton()->canvas_item_set_parent(onion.capture.canvas_item, onion.capture.canvas);
onion.capture.material = Ref<ShaderMaterial>(memnew(ShaderMaterial));
@@ -1792,14 +1792,14 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
COLOR = vec4(capture_samp.rgb * dir_color.rgb, bkg_mask * diff_mask); \
} \
");
- VS::get_singleton()->material_set_shader(onion.capture.material->get_rid(), onion.capture.shader->get_rid());
+ RS::get_singleton()->material_set_shader(onion.capture.material->get_rid(), onion.capture.shader->get_rid());
}
AnimationPlayerEditor::~AnimationPlayerEditor() {
_free_onion_layers();
- VS::get_singleton()->free(onion.capture.canvas);
- VS::get_singleton()->free(onion.capture.canvas_item);
+ RS::get_singleton()->free(onion.capture.canvas);
+ RS::get_singleton()->free(onion.capture.canvas_item);
}
void AnimationPlayerEditorPlugin::_notification(int p_what) {
diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp
index 6cffda49d0..0459ac7618 100644
--- a/editor/plugins/audio_stream_editor_plugin.cpp
+++ b/editor/plugins/audio_stream_editor_plugin.cpp
@@ -89,7 +89,7 @@ void AudioStreamEditor::_draw_preview() {
Vector<Color> color;
color.push_back(get_theme_color("contrast_color_2", "Editor"));
- VS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color);
+ RS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color);
}
void AudioStreamEditor::_preview_changed(ObjectID p_which) {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index ba9cba5515..c7ddcd5e46 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3427,7 +3427,7 @@ void CanvasItemEditor::_draw_straight_line(Point2 p_from, Point2 p_to, Color p_c
}
}
if (points.size() >= 2) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, points[0], points[1], p_color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, points[0], points[1], p_color);
}
}
@@ -3455,7 +3455,7 @@ void CanvasItemEditor::_draw_axis() {
};
for (int i = 0; i < 4; i++) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, screen_endpoints[i], screen_endpoints[(i + 1) % 4], area_axis_color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, screen_endpoints[i], screen_endpoints[(i + 1) % 4], area_axis_color);
}
}
}
@@ -3512,8 +3512,8 @@ void CanvasItemEditor::_draw_bones() {
outline_colors.push_back(bone_outline_color);
}
- VisualServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors);
- VisualServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID());
+ RenderingServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors);
+ RenderingServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID());
}
}
}
@@ -3744,7 +3744,7 @@ void CanvasItemEditor::_draw_viewport() {
}
RID ci = viewport->get_canvas_item();
- VisualServer::get_singleton()->canvas_item_add_set_transform(ci, Transform2D());
+ RenderingServer::get_singleton()->canvas_item_add_set_transform(ci, Transform2D());
EditorPluginList *over_plugin_list = editor->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
@@ -4911,7 +4911,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
bool preview = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(PREVIEW_CANVAS_SCALE));
preview = !preview;
- VS::get_singleton()->canvas_set_disable_scale(!preview);
+ RS::get_singleton()->canvas_set_disable_scale(!preview);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(PREVIEW_CANVAS_SCALE), preview);
} break;
@@ -5818,13 +5818,13 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
canvas_item_editor->show();
canvas_item_editor->set_physics_process(true);
- VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false);
+ RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false);
} else {
canvas_item_editor->hide();
canvas_item_editor->set_physics_process(false);
- VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true);
}
}
@@ -6307,7 +6307,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
label_desc->hide();
canvas_item_editor->get_controls_container()->add_child(label_desc);
- VS::get_singleton()->canvas_set_disable_scale(true);
+ RS::get_singleton()->canvas_set_disable_scale(true);
}
CanvasItemEditorViewport::~CanvasItemEditorViewport() {
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 3c173ab783..a8c4bddccf 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -328,19 +328,19 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si
if (material->get_shader_mode() == Shader::MODE_SPATIAL) {
- VS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid());
+ RS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid());
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
preview_done = false;
- VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant());
+ RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant());
while (!preview_done) {
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
- VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
+ RS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
@@ -358,35 +358,35 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si
EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
- scenario = VS::get_singleton()->scenario_create();
+ scenario = RS::get_singleton()->scenario_create();
- viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_scenario(viewport, scenario);
- VS::get_singleton()->viewport_set_size(viewport, 128, 128);
- VS::get_singleton()->viewport_set_transparent_background(viewport, true);
- VS::get_singleton()->viewport_set_active(viewport, true);
- viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ RS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport, camera);
- VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
- VS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10);
+ camera = RS::get_singleton()->camera_create();
+ RS::get_singleton()->viewport_attach_camera(viewport, camera);
+ RS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
+ RS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10);
- light = VS::get_singleton()->directional_light_create();
- light_instance = VS::get_singleton()->instance_create2(light, scenario);
- VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
+ light = RS::get_singleton()->directional_light_create();
+ light_instance = RS::get_singleton()->instance_create2(light, scenario);
+ RS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
- light2 = VS::get_singleton()->directional_light_create();
- VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- //VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ light2 = RS::get_singleton()->directional_light_create();
+ RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+ light_instance2 = RS::get_singleton()->instance_create2(light2, scenario);
- VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
+ RS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
- sphere = VS::get_singleton()->mesh_create();
- sphere_instance = VS::get_singleton()->instance_create2(sphere, scenario);
+ sphere = RS::get_singleton()->mesh_create();
+ sphere_instance = RS::get_singleton()->instance_create2(sphere, scenario);
int lats = 32;
int lons = 32;
@@ -453,25 +453,25 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
}
Array arr;
- arr.resize(VS::ARRAY_MAX);
- arr[VS::ARRAY_VERTEX] = vertices;
- arr[VS::ARRAY_NORMAL] = normals;
- arr[VS::ARRAY_TANGENT] = tangents;
- arr[VS::ARRAY_TEX_UV] = uvs;
- VS::get_singleton()->mesh_add_surface_from_arrays(sphere, VS::PRIMITIVE_TRIANGLES, arr);
+ arr.resize(RS::ARRAY_MAX);
+ arr[RS::ARRAY_VERTEX] = vertices;
+ arr[RS::ARRAY_NORMAL] = normals;
+ arr[RS::ARRAY_TANGENT] = tangents;
+ arr[RS::ARRAY_TEX_UV] = uvs;
+ RS::get_singleton()->mesh_add_surface_from_arrays(sphere, RS::PRIMITIVE_TRIANGLES, arr);
}
EditorMaterialPreviewPlugin::~EditorMaterialPreviewPlugin() {
- VS::get_singleton()->free(sphere);
- VS::get_singleton()->free(sphere_instance);
- VS::get_singleton()->free(viewport);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(light_instance);
- VS::get_singleton()->free(light2);
- VS::get_singleton()->free(light_instance2);
- VS::get_singleton()->free(camera);
- VS::get_singleton()->free(scenario);
+ RS::get_singleton()->free(sphere);
+ RS::get_singleton()->free(sphere_instance);
+ RS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(light);
+ RS::get_singleton()->free(light_instance);
+ RS::get_singleton()->free(light2);
+ RS::get_singleton()->free(light_instance2);
+ RS::get_singleton()->free(camera);
+ RS::get_singleton()->free(scenario);
}
///////////////////////////////////////////////////////////////////////////
@@ -706,7 +706,7 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
Ref<Mesh> mesh = p_from;
ERR_FAIL_COND_V(mesh.is_null(), Ref<Texture2D>());
- VS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid());
+ RS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid());
AABB aabb = mesh->get_aabb();
Vector3 ofs = aabb.position + aabb.size * 0.5;
@@ -723,21 +723,21 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
xform.basis.scale(Vector3(m, m, m));
xform.origin = -xform.basis.xform(ofs); //-ofs*m;
xform.origin.z -= rot_aabb.size.z * 2;
- VS::get_singleton()->instance_set_transform(mesh_instance, xform);
+ RS::get_singleton()->instance_set_transform(mesh_instance, xform);
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
preview_done = false;
- VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant());
+ RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant());
while (!preview_done) {
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
- VS::get_singleton()->instance_set_base(mesh_instance, RID());
+ RS::get_singleton()->instance_set_base(mesh_instance, RID());
img->convert(Image::FORMAT_RGBA8);
@@ -759,49 +759,49 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() {
- scenario = VS::get_singleton()->scenario_create();
+ scenario = RS::get_singleton()->scenario_create();
- viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_scenario(viewport, scenario);
- VS::get_singleton()->viewport_set_size(viewport, 128, 128);
- VS::get_singleton()->viewport_set_transparent_background(viewport, true);
- VS::get_singleton()->viewport_set_active(viewport, true);
- viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ RS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport, camera);
- VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
- //VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
- VS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0);
+ camera = RS::get_singleton()->camera_create();
+ RS::get_singleton()->viewport_attach_camera(viewport, camera);
+ RS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
+ //RS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
+ RS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0);
- light = VS::get_singleton()->directional_light_create();
- light_instance = VS::get_singleton()->instance_create2(light, scenario);
- VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
+ light = RS::get_singleton()->directional_light_create();
+ light_instance = RS::get_singleton()->instance_create2(light, scenario);
+ RS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
- light2 = VS::get_singleton()->directional_light_create();
- VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- //VS::get_singleton()->light_set_color(light2, VS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0));
- light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+ light2 = RS::get_singleton()->directional_light_create();
+ RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //RS::get_singleton()->light_set_color(light2, RS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0));
+ light_instance2 = RS::get_singleton()->instance_create2(light2, scenario);
- VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
+ RS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
- //sphere = VS::get_singleton()->mesh_create();
- mesh_instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_scenario(mesh_instance, scenario);
+ //sphere = RS::get_singleton()->mesh_create();
+ mesh_instance = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_scenario(mesh_instance, scenario);
}
EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
- //VS::get_singleton()->free(sphere);
- VS::get_singleton()->free(mesh_instance);
- VS::get_singleton()->free(viewport);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(light_instance);
- VS::get_singleton()->free(light2);
- VS::get_singleton()->free(light_instance2);
- VS::get_singleton()->free(camera);
- VS::get_singleton()->free(scenario);
+ //RS::get_singleton()->free(sphere);
+ RS::get_singleton()->free(mesh_instance);
+ RS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(light);
+ RS::get_singleton()->free(light_instance);
+ RS::get_singleton()->free(light2);
+ RS::get_singleton()->free(light_instance2);
+ RS::get_singleton()->free(camera);
+ RS::get_singleton()->free(scenario);
}
///////////////////////////////////////////////////////////////////////////
@@ -849,16 +849,16 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path,
font->draw(canvas_item, pos, sampled_text);
preview_done = false;
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
- VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant());
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
+ RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant());
while (!preview_done) {
OS::get_singleton()->delay_usec(10);
}
- VS::get_singleton()->canvas_item_clear(canvas_item);
+ RS::get_singleton()->canvas_item_clear(canvas_item);
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
img->convert(Image::FORMAT_RGBA8);
@@ -891,22 +891,22 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate(const RES &p_from, const Size2
EditorFontPreviewPlugin::EditorFontPreviewPlugin() {
- viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_size(viewport, 128, 128);
- VS::get_singleton()->viewport_set_active(viewport, true);
- viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- canvas = VS::get_singleton()->canvas_create();
- canvas_item = VS::get_singleton()->canvas_item_create();
+ canvas = RS::get_singleton()->canvas_create();
+ canvas_item = RS::get_singleton()->canvas_item_create();
- VS::get_singleton()->viewport_attach_canvas(viewport, canvas);
- VS::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
+ RS::get_singleton()->viewport_attach_canvas(viewport, canvas);
+ RS::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
}
EditorFontPreviewPlugin::~EditorFontPreviewPlugin() {
- VS::get_singleton()->free(canvas_item);
- VS::get_singleton()->free(canvas);
- VS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(canvas_item);
+ RS::get_singleton()->free(canvas);
+ RS::get_singleton()->free(viewport);
}
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 8129b9bd86..5623805201 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -256,14 +256,14 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
@@ -273,7 +273,7 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p
if (texture.is_valid()) {
smat->set_shader_param(E->get().name, texture);
} else {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
}
@@ -302,17 +302,17 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -340,17 +340,17 @@ Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -378,17 +378,17 @@ Ref<Resource> ProceduralSkyMaterialConversionPlugin::convert(const Ref<Resource>
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -416,17 +416,17 @@ Ref<Resource> PanoramaSkyMaterialConversionPlugin::convert(const Ref<Resource> &
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -454,17 +454,17 @@ Ref<Resource> PhysicalSkyMaterialConversionPlugin::convert(const Ref<Resource> &
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 07eaf3f63f..6f6d06b09d 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -496,7 +496,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b
Vector3 pos = _get_ray_pos(p_pos);
Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink();
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
Set<Ref<EditorNode3DGizmo>> found_gizmos;
Node *edited_scene = get_tree()->get_edited_scene_root();
@@ -563,7 +563,7 @@ void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_inclu
Vector3 ray = _get_ray(p_pos);
Vector3 pos = _get_ray_pos(p_pos);
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
Set<Ref<EditorNode3DGizmo>> found_gizmos;
r_includes_current = false;
@@ -686,7 +686,7 @@ void Node3DEditorViewport::_select_region() {
frustum.push_back(far);
}
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario());
Vector<Node *> selected;
Node *edited_scene = get_tree()->get_edited_scene_root();
@@ -2395,7 +2395,7 @@ void Node3DEditorViewport::_notification(int p_what) {
}
previewing = cam;
previewing->connect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera());
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera());
surface->update();
}
}
@@ -2437,7 +2437,7 @@ void Node3DEditorViewport::_notification(int p_what) {
aabb_s.scale(se->aabb.size);
t.basis = t.basis * aabb_s;
- VisualServer::get_singleton()->instance_set_transform(se->sbox_instance, t);
+ RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance, t);
}
if (changed || (spatial_editor->is_gizmo_visible() && !exist)) {
@@ -2643,7 +2643,7 @@ void Node3DEditorViewport::_draw() {
if (_edit.mode == TRANSFORM_ROTATE) {
Point2 center = _point_to_screen(_edit.center);
- VisualServer::get_singleton()->canvas_item_add_line(
+ RenderingServer::get_singleton()->canvas_item_add_line(
ci,
_edit.mouse_pos,
center,
@@ -3082,51 +3082,51 @@ void Node3DEditorViewport::_init_gizmo_instance(int p_idx) {
uint32_t layer = 1 << (GIZMO_BASE_LAYER + p_idx);
for (int i = 0; i < 3; i++) {
- move_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(move_gizmo_instance[i], spatial_editor->get_move_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i], layer);
-
- move_plane_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(move_plane_gizmo_instance[i], spatial_editor->get_move_plane_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(move_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_plane_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(move_plane_gizmo_instance[i], layer);
-
- rotate_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i], spatial_editor->get_rotate_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i], layer);
-
- scale_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(scale_gizmo_instance[i], spatial_editor->get_scale_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(scale_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(scale_gizmo_instance[i], layer);
-
- scale_plane_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(scale_plane_gizmo_instance[i], spatial_editor->get_scale_plane_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(scale_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_plane_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(scale_plane_gizmo_instance[i], layer);
+ move_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(move_gizmo_instance[i], spatial_editor->get_move_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(move_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i], layer);
+
+ move_plane_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(move_plane_gizmo_instance[i], spatial_editor->get_move_plane_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(move_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_plane_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(move_plane_gizmo_instance[i], layer);
+
+ rotate_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(rotate_gizmo_instance[i], spatial_editor->get_rotate_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i], layer);
+
+ scale_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(scale_gizmo_instance[i], spatial_editor->get_scale_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(scale_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(scale_gizmo_instance[i], layer);
+
+ scale_plane_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(scale_plane_gizmo_instance[i], spatial_editor->get_scale_plane_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(scale_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_plane_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(scale_plane_gizmo_instance[i], layer);
}
}
void Node3DEditorViewport::_finish_gizmo_instances() {
for (int i = 0; i < 3; i++) {
- VS::get_singleton()->free(move_gizmo_instance[i]);
- VS::get_singleton()->free(move_plane_gizmo_instance[i]);
- VS::get_singleton()->free(rotate_gizmo_instance[i]);
- VS::get_singleton()->free(scale_gizmo_instance[i]);
- VS::get_singleton()->free(scale_plane_gizmo_instance[i]);
+ RS::get_singleton()->free(move_gizmo_instance[i]);
+ RS::get_singleton()->free(move_plane_gizmo_instance[i]);
+ RS::get_singleton()->free(rotate_gizmo_instance[i]);
+ RS::get_singleton()->free(scale_gizmo_instance[i]);
+ RS::get_singleton()->free(scale_plane_gizmo_instance[i]);
}
}
void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
@@ -3138,7 +3138,7 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
previewing->disconnect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
previewing = NULL;
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
if (!preview)
preview_camera->hide();
view_menu->set_disabled(false);
@@ -3148,7 +3148,7 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
previewing = preview;
previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
}
@@ -3161,7 +3161,7 @@ void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) {
previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
previewing = NULL;
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
preview_camera->set_pressed(false);
if (!preview) {
preview_camera->hide();
@@ -3212,11 +3212,11 @@ void Node3DEditorViewport::update_transform_gizmo_view() {
if (xform.origin.distance_squared_to(camera_xform.origin) < 0.01) {
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
}
return;
}
@@ -3244,16 +3244,16 @@ void Node3DEditorViewport::update_transform_gizmo_view() {
xform.basis.scale(scale);
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
- VisualServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
- VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
- VisualServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
- VisualServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
+ RenderingServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
+ RenderingServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
+ RenderingServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
+ RenderingServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
+ RenderingServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
}
}
@@ -3363,7 +3363,7 @@ void Node3DEditorViewport::set_state(const Dictionary &p_state) {
if (Object::cast_to<Camera3D>(pv)) {
previewing = Object::cast_to<Camera3D>(pv);
previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
preview_camera->set_pressed(true);
@@ -3478,7 +3478,7 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const
Vector3 world_ray = _get_ray(p_pos);
Vector3 world_pos = _get_ray_pos(p_pos);
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario());
Set<Ref<EditorNode3DGizmo>> found_gizmos;
float closest_dist = MAX_DISTANCE;
@@ -4398,7 +4398,7 @@ Node3DEditor *Node3DEditor::singleton = NULL;
Node3DEditorSelectedItem::~Node3DEditorSelectedItem() {
if (sbox_instance.is_valid())
- VisualServer::get_singleton()->free(sbox_instance);
+ RenderingServer::get_singleton()->free(sbox_instance);
}
void Node3DEditor::select_gizmo_highlight_axis(int p_axis) {
@@ -4484,8 +4484,8 @@ Object *Node3DEditor::_get_editor_data(Object *p_what) {
Node3DEditorSelectedItem *si = memnew(Node3DEditorSelectedItem);
si->sp = sp;
- si->sbox_instance = VisualServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario());
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, VS::SHADOW_CASTING_SETTING_OFF);
+ si->sbox_instance = RenderingServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario());
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, RS::SHADOW_CASTING_SETTING_OFF);
return si;
}
@@ -4649,7 +4649,7 @@ void Node3DEditor::set_state(const Dictionary &p_state) {
if (use != view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) {
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use);
- VisualServer::get_singleton()->instance_set_visible(origin_instance, use);
+ RenderingServer::get_singleton()->instance_set_visible(origin_instance, use);
}
}
@@ -4954,7 +4954,7 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
bool is_checked = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(p_option));
origin_enabled = !is_checked;
- VisualServer::get_singleton()->instance_set_visible(origin_instance, origin_enabled);
+ RenderingServer::get_singleton()->instance_set_visible(origin_instance, origin_enabled);
// Update the grid since its appearance depends on whether the origin is enabled
_finish_grid();
_init_grid();
@@ -4969,7 +4969,7 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
for (int i = 0; i < 3; ++i) {
if (grid_enable[i]) {
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_enabled);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], grid_enabled);
grid_visible[i] = grid_enabled;
}
}
@@ -5129,19 +5129,19 @@ void Node3DEditor::_init_indicators() {
_init_grid();
- origin = VisualServer::get_singleton()->mesh_create();
+ origin = RenderingServer::get_singleton()->mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VisualServer::ARRAY_VERTEX] = origin_points;
- d[VisualServer::ARRAY_COLOR] = origin_colors;
+ d.resize(RS::ARRAY_MAX);
+ d[RenderingServer::ARRAY_VERTEX] = origin_points;
+ d[RenderingServer::ARRAY_COLOR] = origin_colors;
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(origin, VisualServer::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid());
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(origin, RenderingServer::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid());
- origin_instance = VisualServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
+ origin_instance = RenderingServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
- VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, VS::SHADOW_CASTING_SETTING_OFF);
+ RenderingServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, RS::SHADOW_CASTING_SETTING_OFF);
}
{
@@ -5506,33 +5506,33 @@ void Node3DEditor::_init_grid() {
grid_colors[i].push_back(line_color);
}
- grid[i] = VisualServer::get_singleton()->mesh_create();
+ grid[i] = RenderingServer::get_singleton()->mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VisualServer::ARRAY_VERTEX] = grid_points[i];
- d[VisualServer::ARRAY_COLOR] = grid_colors[i];
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], VisualServer::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid());
- grid_instance[i] = VisualServer::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario());
+ d.resize(RS::ARRAY_MAX);
+ d[RenderingServer::ARRAY_VERTEX] = grid_points[i];
+ d[RenderingServer::ARRAY_COLOR] = grid_colors[i];
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], RenderingServer::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid());
+ grid_instance[i] = RenderingServer::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario());
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]);
- VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]);
+ RenderingServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
}
}
void Node3DEditor::_finish_indicators() {
- VisualServer::get_singleton()->free(origin_instance);
- VisualServer::get_singleton()->free(origin);
+ RenderingServer::get_singleton()->free(origin_instance);
+ RenderingServer::get_singleton()->free(origin);
_finish_grid();
}
void Node3DEditor::_finish_grid() {
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->free(grid_instance[i]);
- VisualServer::get_singleton()->free(grid[i]);
+ RenderingServer::get_singleton()->free(grid_instance[i]);
+ RenderingServer::get_singleton()->free(grid[i]);
}
}
@@ -5658,8 +5658,8 @@ void Node3DEditor::snap_selected_nodes_to_floor() {
}
}
- PhysicsDirectSpaceState *ss = get_tree()->get_root()->get_world()->get_direct_space_state();
- PhysicsDirectSpaceState::RayResult result;
+ PhysicsDirectSpaceState3D *ss = get_tree()->get_root()->get_world()->get_direct_space_state();
+ PhysicsDirectSpaceState3D::RayResult result;
Array keys = snap_data.keys();
@@ -5952,11 +5952,11 @@ void Node3DEditor::clear() {
viewports[i]->reset();
}
- VisualServer::get_singleton()->instance_set_visible(origin_instance, true);
+ RenderingServer::get_singleton()->instance_set_visible(origin_instance, true);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true);
for (int i = 0; i < 3; ++i) {
if (grid_enable[i]) {
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], true);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], true);
grid_visible[i] = true;
}
}
@@ -6313,7 +6313,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
xform_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_xform_dialog_action));
- scenario_debug = VisualServer::SCENARIO_DEBUG_DISABLED;
+ scenario_debug = RenderingServer::SCENARIO_DEBUG_DISABLED;
selected = NULL;
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index af6bc43b80..4b9f5a605b 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -578,7 +578,7 @@ private:
ToolMode tool_mode;
bool orthogonal;
- VisualServer::ScenarioDebugMode scenario_debug;
+ RenderingServer::ScenarioDebugMode scenario_debug;
RID origin;
RID origin_instance;
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 5a94c95dd7..f570baa885 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -990,9 +990,9 @@ void Polygon2DEditor::_uv_draw() {
mtx.elements[2] = -uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom));
- VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx);
+ RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx);
uv_edit_draw->draw_texture(base_tex, Point2());
- VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D());
+ RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D());
if (snap_show_grid) {
Color grid_color = Color(1.0, 1.0, 1.0, 0.15);
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index c38bb09567..29ebfc8f7a 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -39,7 +39,7 @@
#include "editor/editor_settings.h"
#include "editor/property_editor.h"
#include "servers/display_server.h"
-#include "servers/visual/shader_types.h"
+#include "servers/rendering/shader_types.h"
/*** SHADER SCRIPT EDITOR ****/
@@ -150,16 +150,16 @@ void ShaderTextEditor::_load_theme_settings() {
if (shader.is_valid()) {
- for (const Map<StringName, ShaderLanguage::FunctionInfo>::Element *E = ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())).front(); E; E = E->next()) {
+ for (const Map<StringName, ShaderLanguage::FunctionInfo>::Element *E = ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())).front(); E; E = E->next()) {
for (const Map<StringName, ShaderLanguage::BuiltInInfo>::Element *F = E->get().built_ins.front(); F; F = F->next()) {
keywords.push_back(F->key());
}
}
- for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())).size(); i++) {
+ for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())).size(); i++) {
- keywords.push_back(ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode()))[i]);
+ keywords.push_back(ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()))[i]);
}
}
@@ -200,7 +200,7 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptCo
ShaderLanguage sl;
String calltip;
- sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
+ sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
get_text_edit()->set_code_hint(calltip);
}
@@ -215,7 +215,7 @@ void ShaderTextEditor::_validate_script() {
ShaderLanguage sl;
- Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types());
+ Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types());
if (err != OK) {
String error_text = "error(" + itos(sl.get_error_line()) + "): " + sl.get_error_text();
diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h
index 900b40bd7a..f02ed590fc 100644
--- a/editor/plugins/shader_editor_plugin.h
+++ b/editor/plugins/shader_editor_plugin.h
@@ -39,7 +39,7 @@
#include "scene/gui/text_edit.h"
#include "scene/main/timer.h"
#include "scene/resources/shader.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
class ShaderTextEditor : public CodeTextEditor {
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 029159180c..d453598e33 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -68,9 +68,9 @@ void TextureRegionEditor::_region_draw() {
mtx.elements[2] = -draw_ofs * draw_zoom;
mtx.scale_basis(Vector2(draw_zoom, draw_zoom));
- VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx);
+ RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx);
edit_draw->draw_texture(base_tex, Point2());
- VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D());
+ RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D());
if (snap_mode == SNAP_GRID) {
Color grid_color = Color(1.0, 1.0, 1.0, 0.15);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index f5ffcc1a28..f479139e4d 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -528,8 +528,8 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
toolbar->add_child(spin_priority);
spin_z_index = memnew(SpinBox);
- spin_z_index->set_min(VS::CANVAS_ITEM_Z_MIN);
- spin_z_index->set_max(VS::CANVAS_ITEM_Z_MAX);
+ spin_z_index->set_min(RS::CANVAS_ITEM_Z_MIN);
+ spin_z_index->set_max(RS::CANVAS_ITEM_Z_MAX);
spin_z_index->set_step(1);
spin_z_index->set_custom_minimum_size(Size2(100, 0));
spin_z_index->connect("value_changed", callable_mp(this, &TileSetEditor::_on_z_index_changed));
@@ -3485,7 +3485,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_navigation_offset"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"));
+ p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"));
}
if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_COLLISION && tileset_editor->edited_collision_shape.is_valid()) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class()));
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 36f81b21ba..594dc400ec 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -45,7 +45,7 @@
#include "scene/main/window.h"
#include "scene/resources/visual_shader_nodes.h"
#include "servers/display_server.h"
-#include "servers/visual/shader_types.h"
+#include "servers/rendering/shader_types.h"
Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) {
@@ -2263,7 +2263,7 @@ void VisualShaderEditor::_update_preview() {
ShaderLanguage sl;
- Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_types());
+ Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_types());
for (int i = 0; i < preview_text->get_line_count(); i++) {
preview_text->set_line_as_marked(i, false);
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 41e15f47cc..8c5b078de0 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -1500,7 +1500,7 @@ void CustomPropertyEditor::_draw_easing() {
iflp = 1.0 - iflp;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(iflp * s.width, prev * s.height), Point2(ifl * s.width, h * s.height), color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2(iflp * s.width, prev * s.height), Point2(ifl * s.width, h * s.height), color);
prev = h;
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 7d429eb4b5..4b382f09f4 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -47,7 +47,7 @@
#include "scene/main/window.h"
#include "scene/resources/packed_scene.h"
#include "servers/display_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void SceneTreeDock::_nodes_drag_begin() {
diff --git a/gles_builders.py b/gles_builders.py
index 92cf9357cf..e4e5fafc85 100644
--- a/gles_builders.py
+++ b/gles_builders.py
@@ -602,7 +602,7 @@ def build_rd_header(filename):
out_file_class = out_file_base.replace(".glsl.gen.h", "").title().replace("_", "").replace(".", "") + "ShaderRD"
fd.write("\n")
- fd.write("#include \"servers/visual/rasterizer_rd/shader_rd.h\"\n\n")
+ fd.write("#include \"servers/rendering/rasterizer_rd/shader_rd.h\"\n\n")
fd.write("class " + out_file_class + " : public ShaderRD {\n\n")
fd.write("public:\n\n")
diff --git a/main/main.cpp b/main/main.cpp
index 9e7e0e8842..89c8832731 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -65,13 +65,13 @@
#include "servers/audio_server.h"
#include "servers/camera_server.h"
#include "servers/display_server.h"
-#include "servers/navigation_2d_server.h"
-#include "servers/navigation_server.h"
-#include "servers/physics_2d_server.h"
-#include "servers/physics_server.h"
+#include "servers/navigation_server_2d.h"
+#include "servers/navigation_server_3d.h"
+#include "servers/physics_server_2d.h"
+#include "servers/physics_server_3d.h"
#include "servers/register_server_types.h"
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/rendering/rendering_server_raster.h"
+#include "servers/rendering/rendering_server_wrap_mt.h"
#ifdef TOOLS_ENABLED
#include "editor/doc_data.h"
@@ -103,13 +103,13 @@ static MessageQueue *message_queue = NULL;
// Initialized in setup2()
static AudioServer *audio_server = NULL;
static DisplayServer *display_server = NULL;
-static VisualServer *visual_server = NULL;
+static RenderingServer *rendering_server = NULL;
static CameraServer *camera_server = NULL;
static ARVRServer *arvr_server = NULL;
-static PhysicsServer *physics_server = NULL;
-static Physics2DServer *physics_2d_server = NULL;
-static NavigationServer *navigation_server = NULL;
-static Navigation2DServer *navigation_2d_server = NULL;
+static PhysicsServer3D *physics_server = NULL;
+static PhysicsServer2D *physics_2d_server = NULL;
+static NavigationServer3D *navigation_server = NULL;
+static NavigationServer2D *navigation_2d_server = NULL;
// We error out if setup2() doesn't turn this true
static bool _start_success = false;
@@ -180,23 +180,23 @@ static String get_full_version_string() {
return String(VERSION_FULL_BUILD) + hash;
}
-// FIXME: Could maybe be moved to PhysicsServerManager and Physics2DServerManager directly
+// FIXME: Could maybe be moved to PhysicsServer3DManager and PhysicsServer2DManager directly
// to have less code in main.cpp.
void initialize_physics() {
/// 3D Physics Server
- physics_server = PhysicsServerManager::new_server(ProjectSettings::get_singleton()->get(PhysicsServerManager::setting_property_name));
+ physics_server = PhysicsServer3DManager::new_server(ProjectSettings::get_singleton()->get(PhysicsServer3DManager::setting_property_name));
if (!physics_server) {
// Physics server not found, Use the default physics
- physics_server = PhysicsServerManager::new_default_server();
+ physics_server = PhysicsServer3DManager::new_default_server();
}
ERR_FAIL_COND(!physics_server);
physics_server->init();
/// 2D Physics server
- physics_2d_server = Physics2DServerManager::new_server(ProjectSettings::get_singleton()->get(Physics2DServerManager::setting_property_name));
+ physics_2d_server = PhysicsServer2DManager::new_server(ProjectSettings::get_singleton()->get(PhysicsServer2DManager::setting_property_name));
if (!physics_2d_server) {
// Physics server not found, Use the default physics
- physics_2d_server = Physics2DServerManager::new_default_server();
+ physics_2d_server = PhysicsServer2DManager::new_default_server();
}
ERR_FAIL_COND(!physics_2d_server);
physics_2d_server->init();
@@ -213,8 +213,8 @@ void finalize_physics() {
void finalize_display() {
- visual_server->finish();
- memdelete(visual_server);
+ rendering_server->finish();
+ memdelete(rendering_server);
memdelete(display_server);
}
@@ -222,8 +222,8 @@ void finalize_display() {
void initialize_navigation_server() {
ERR_FAIL_COND(navigation_server != NULL);
- navigation_server = NavigationServerManager::new_default_server();
- navigation_2d_server = memnew(Navigation2DServer);
+ navigation_server = NavigationServer3DManager::new_default_server();
+ navigation_2d_server = memnew(NavigationServer2D);
}
void finalize_navigation_server() {
@@ -1273,12 +1273,12 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
/* Initialize Visual Server */
- visual_server = memnew(VisualServerRaster);
+ rendering_server = memnew(RenderingServerRaster);
if (OS::get_singleton()->get_render_thread_mode() != OS::RENDER_THREAD_UNSAFE) {
- visual_server = memnew(VisualServerWrapMT(visual_server, OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD));
+ rendering_server = memnew(RenderingServerWrapMT(rendering_server, OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD));
}
- visual_server->init();
+ rendering_server->init();
OS::get_singleton()->initialize_joypads();
@@ -1333,7 +1333,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
MAIN_PRINT("Main: Load Remaps");
Color clear = GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3));
- VisualServer::get_singleton()->set_default_clear_color(clear);
+ RenderingServer::get_singleton()->set_default_clear_color(clear);
if (show_logo) { //boot logo!
String boot_logo_path = GLOBAL_DEF("application/boot_splash/image", String());
@@ -1355,7 +1355,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
Color boot_bg_color = GLOBAL_DEF("application/boot_splash/bg_color", boot_splash_bg_color);
if (boot_logo.is_valid()) {
OS::get_singleton()->_msec_splash = OS::get_singleton()->get_ticks_msec();
- VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, boot_logo_filter);
+ RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, boot_logo_filter);
} else {
#ifndef NO_DEFAULT_BOOT_LOGO
@@ -1367,9 +1367,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
#endif
MAIN_PRINT("Main: ClearColor");
- VisualServer::get_singleton()->set_default_clear_color(boot_bg_color);
+ RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color);
MAIN_PRINT("Main: Image");
- VisualServer::get_singleton()->set_boot_image(splash, boot_bg_color, false);
+ RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, false);
#endif
}
@@ -1380,7 +1380,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
}
MAIN_PRINT("Main: DCC");
- VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3)));
+ RenderingServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3)));
MAIN_PRINT("Main: END");
GLOBAL_DEF("application/config/icon", String());
@@ -1826,7 +1826,7 @@ bool Main::start() {
{
int directional_atlas_size = GLOBAL_GET("rendering/quality/directional_shadow/size");
- VisualServer::get_singleton()->directional_shadow_atlas_set_size(directional_atlas_size);
+ RenderingServer::get_singleton()->directional_shadow_atlas_set_size(directional_atlas_size);
}
if (!editor && !project_manager) {
@@ -2101,25 +2101,25 @@ bool Main::iteration() {
uint64_t physics_begin = OS::get_singleton()->get_ticks_usec();
- PhysicsServer::get_singleton()->sync();
- PhysicsServer::get_singleton()->flush_queries();
+ PhysicsServer3D::get_singleton()->sync();
+ PhysicsServer3D::get_singleton()->flush_queries();
- Physics2DServer::get_singleton()->sync();
- Physics2DServer::get_singleton()->flush_queries();
+ PhysicsServer2D::get_singleton()->sync();
+ PhysicsServer2D::get_singleton()->flush_queries();
if (OS::get_singleton()->get_main_loop()->iteration(frame_slice * time_scale)) {
exit = true;
break;
}
- NavigationServer::get_singleton_mut()->process(frame_slice * time_scale);
+ NavigationServer3D::get_singleton_mut()->process(frame_slice * time_scale);
message_queue->flush();
- PhysicsServer::get_singleton()->step(frame_slice * time_scale);
+ PhysicsServer3D::get_singleton()->step(frame_slice * time_scale);
- Physics2DServer::get_singleton()->end_sync();
- Physics2DServer::get_singleton()->step(frame_slice * time_scale);
+ PhysicsServer2D::get_singleton()->end_sync();
+ PhysicsServer2D::get_singleton()->step(frame_slice * time_scale);
message_queue->flush();
@@ -2137,17 +2137,17 @@ bool Main::iteration() {
}
message_queue->flush();
- VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames.
+ RenderingServer::get_singleton()->sync(); //sync if still drawing from previous frames.
if (DisplayServer::get_singleton()->can_any_window_draw() && !disable_render_loop) {
if ((!force_redraw_requested) && OS::get_singleton()->is_in_low_processor_usage_mode()) {
- if (VisualServer::get_singleton()->has_changed()) {
- VisualServer::get_singleton()->draw(true, scaled_step); // flush visual commands
+ if (RenderingServer::get_singleton()->has_changed()) {
+ RenderingServer::get_singleton()->draw(true, scaled_step); // flush visual commands
Engine::get_singleton()->frames_drawn++;
}
} else {
- VisualServer::get_singleton()->draw(true, scaled_step); // flush visual commands
+ RenderingServer::get_singleton()->draw(true, scaled_step); // flush visual commands
Engine::get_singleton()->frames_drawn++;
force_redraw_requested = false;
}
@@ -2262,7 +2262,7 @@ void Main::cleanup() {
ScriptServer::finish_languages();
// Sync pending commands that may have been queued from a different thread during ScriptServer finalization
- VisualServer::get_singleton()->sync();
+ RenderingServer::get_singleton()->sync();
#ifdef TOOLS_ENABLED
EditorNode::unregister_editor_types();
diff --git a/main/performance.cpp b/main/performance.cpp
index c7e3a41aa6..335407c9eb 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -35,9 +35,9 @@
#include "scene/main/node.h"
#include "scene/main/scene_tree.h"
#include "servers/audio_server.h"
-#include "servers/physics_2d_server.h"
-#include "servers/physics_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/physics_server_3d.h"
+#include "servers/rendering_server.h"
Performance *Performance::singleton = NULL;
@@ -135,22 +135,22 @@ float Performance::get_monitor(Monitor p_monitor) const {
case OBJECT_RESOURCE_COUNT: return ResourceCache::get_cached_resource_count();
case OBJECT_NODE_COUNT: return _get_node_count();
case OBJECT_ORPHAN_NODE_COUNT: return Node::orphan_node_count;
- case RENDER_OBJECTS_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_OBJECTS_IN_FRAME);
- case RENDER_VERTICES_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_VERTICES_IN_FRAME);
- case RENDER_MATERIAL_CHANGES_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_MATERIAL_CHANGES_IN_FRAME);
- case RENDER_SHADER_CHANGES_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_SHADER_CHANGES_IN_FRAME);
- case RENDER_SURFACE_CHANGES_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_SURFACE_CHANGES_IN_FRAME);
- case RENDER_DRAW_CALLS_IN_FRAME: return VS::get_singleton()->get_render_info(VS::INFO_DRAW_CALLS_IN_FRAME);
- case RENDER_VIDEO_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_VIDEO_MEM_USED);
- case RENDER_TEXTURE_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_TEXTURE_MEM_USED);
- case RENDER_VERTEX_MEM_USED: return VS::get_singleton()->get_render_info(VS::INFO_VERTEX_MEM_USED);
- case RENDER_USAGE_VIDEO_MEM_TOTAL: return VS::get_singleton()->get_render_info(VS::INFO_USAGE_VIDEO_MEM_TOTAL);
- case PHYSICS_2D_ACTIVE_OBJECTS: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_ACTIVE_OBJECTS);
- case PHYSICS_2D_COLLISION_PAIRS: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_COLLISION_PAIRS);
- case PHYSICS_2D_ISLAND_COUNT: return Physics2DServer::get_singleton()->get_process_info(Physics2DServer::INFO_ISLAND_COUNT);
- case PHYSICS_3D_ACTIVE_OBJECTS: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_ACTIVE_OBJECTS);
- case PHYSICS_3D_COLLISION_PAIRS: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_COLLISION_PAIRS);
- case PHYSICS_3D_ISLAND_COUNT: return PhysicsServer::get_singleton()->get_process_info(PhysicsServer::INFO_ISLAND_COUNT);
+ case RENDER_OBJECTS_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_OBJECTS_IN_FRAME);
+ case RENDER_VERTICES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_VERTICES_IN_FRAME);
+ case RENDER_MATERIAL_CHANGES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_MATERIAL_CHANGES_IN_FRAME);
+ case RENDER_SHADER_CHANGES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_SHADER_CHANGES_IN_FRAME);
+ case RENDER_SURFACE_CHANGES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_SURFACE_CHANGES_IN_FRAME);
+ case RENDER_DRAW_CALLS_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_DRAW_CALLS_IN_FRAME);
+ case RENDER_VIDEO_MEM_USED: return RS::get_singleton()->get_render_info(RS::INFO_VIDEO_MEM_USED);
+ case RENDER_TEXTURE_MEM_USED: return RS::get_singleton()->get_render_info(RS::INFO_TEXTURE_MEM_USED);
+ case RENDER_VERTEX_MEM_USED: return RS::get_singleton()->get_render_info(RS::INFO_VERTEX_MEM_USED);
+ case RENDER_USAGE_VIDEO_MEM_TOTAL: return RS::get_singleton()->get_render_info(RS::INFO_USAGE_VIDEO_MEM_TOTAL);
+ case PHYSICS_2D_ACTIVE_OBJECTS: return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_2D_COLLISION_PAIRS: return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_COLLISION_PAIRS);
+ case PHYSICS_2D_ISLAND_COUNT: return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ISLAND_COUNT);
+ case PHYSICS_3D_ACTIVE_OBJECTS: return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_3D_COLLISION_PAIRS: return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_COLLISION_PAIRS);
+ case PHYSICS_3D_ISLAND_COUNT: return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_ISLAND_COUNT);
case AUDIO_OUTPUT_LATENCY: return AudioServer::get_singleton()->get_output_latency();
default: {
diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp
index d91503501d..29fa5e73a7 100644
--- a/main/tests/test_math.cpp
+++ b/main/tests/test_math.cpp
@@ -43,7 +43,7 @@
#include "core/vmap.h"
#include "scene/main/node.h"
#include "scene/resources/texture.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
#include "core/method_ptrcall.h"
diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp
index 7727af6ad1..5e8940f453 100644
--- a/main/tests/test_physics.cpp
+++ b/main/tests/test_physics.cpp
@@ -37,8 +37,8 @@
#include "core/os/os.h"
#include "core/print_string.h"
#include "servers/display_server.h"
-#include "servers/physics_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_3d.h"
+#include "servers/rendering_server.h"
class TestPhysicsMainLoop : public MainLoop {
@@ -65,13 +65,13 @@ class TestPhysicsMainLoop : public MainLoop {
Point2 joy_direction;
List<RID> bodies;
- Map<PhysicsServer::ShapeType, RID> type_shape_map;
- Map<PhysicsServer::ShapeType, RID> type_mesh_map;
+ Map<PhysicsServer3D::ShapeType, RID> type_shape_map;
+ Map<PhysicsServer3D::ShapeType, RID> type_mesh_map;
void body_changed_transform(Object *p_state, RID p_visual_instance) {
- PhysicsDirectBodyState *state = (PhysicsDirectBodyState *)p_state;
- VisualServer *vs = VisualServer::get_singleton();
+ PhysicsDirectBodyState3D *state = (PhysicsDirectBodyState3D *)p_state;
+ RenderingServer *vs = RenderingServer::get_singleton();
Transform t = state->get_transform();
vs->instance_set_transform(p_visual_instance, t);
}
@@ -84,23 +84,23 @@ protected:
ClassDB::bind_method("body_changed_transform", &TestPhysicsMainLoop::body_changed_transform);
}
- RID create_body(PhysicsServer::ShapeType p_shape, PhysicsServer::BodyMode p_body, const Transform p_location, bool p_active_default = true, const Transform &p_shape_xform = Transform()) {
+ RID create_body(PhysicsServer3D::ShapeType p_shape, PhysicsServer3D::BodyMode p_body, const Transform p_location, bool p_active_default = true, const Transform &p_shape_xform = Transform()) {
- VisualServer *vs = VisualServer::get_singleton();
- PhysicsServer *ps = PhysicsServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
RID mesh_instance = vs->instance_create2(type_mesh_map[p_shape], scenario);
RID body = ps->body_create(p_body, !p_active_default);
ps->body_set_space(body, space);
- ps->body_set_param(body, PhysicsServer::BODY_PARAM_BOUNCE, 0.0);
+ ps->body_set_param(body, PhysicsServer3D::BODY_PARAM_BOUNCE, 0.0);
//todo set space
ps->body_add_shape(body, type_shape_map[p_shape]);
ps->body_set_force_integration_callback(body, this, "body_changed_transform", mesh_instance);
- ps->body_set_state(body, PhysicsServer::BODY_STATE_TRANSFORM, p_location);
+ ps->body_set_state(body, PhysicsServer3D::BODY_STATE_TRANSFORM, p_location);
bodies.push_back(body);
- if (p_body == PhysicsServer::BODY_MODE_STATIC) {
+ if (p_body == PhysicsServer3D::BODY_MODE_STATIC) {
vs->instance_set_transform(mesh_instance, p_location);
}
@@ -109,12 +109,12 @@ protected:
RID create_static_plane(const Plane &p_plane) {
- PhysicsServer *ps = PhysicsServer::get_singleton();
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
- RID world_margin_shape = ps->shape_create(PhysicsServer::SHAPE_PLANE);
+ RID world_margin_shape = ps->shape_create(PhysicsServer3D::SHAPE_PLANE);
ps->shape_set_data(world_margin_shape, p_plane);
- RID b = ps->body_create(PhysicsServer::BODY_MODE_STATIC);
+ RID b = ps->body_create(PhysicsServer3D::BODY_MODE_STATIC);
ps->body_set_space(b, space);
//todo set space
ps->body_add_shape(b, world_margin_shape);
@@ -123,24 +123,24 @@ protected:
void configure_body(RID p_body, float p_mass, float p_friction, float p_bounce) {
- PhysicsServer *ps = PhysicsServer::get_singleton();
- ps->body_set_param(p_body, PhysicsServer::BODY_PARAM_MASS, p_mass);
- ps->body_set_param(p_body, PhysicsServer::BODY_PARAM_FRICTION, p_friction);
- ps->body_set_param(p_body, PhysicsServer::BODY_PARAM_BOUNCE, p_bounce);
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
+ ps->body_set_param(p_body, PhysicsServer3D::BODY_PARAM_MASS, p_mass);
+ ps->body_set_param(p_body, PhysicsServer3D::BODY_PARAM_FRICTION, p_friction);
+ ps->body_set_param(p_body, PhysicsServer3D::BODY_PARAM_BOUNCE, p_bounce);
}
void init_shapes() {
- VisualServer *vs = VisualServer::get_singleton();
- PhysicsServer *ps = PhysicsServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
/* SPHERE SHAPE */
RID sphere_mesh = vs->make_sphere_mesh(10, 20, 0.5);
- type_mesh_map[PhysicsServer::SHAPE_SPHERE] = sphere_mesh;
+ type_mesh_map[PhysicsServer3D::SHAPE_SPHERE] = sphere_mesh;
- RID sphere_shape = ps->shape_create(PhysicsServer::SHAPE_SPHERE);
+ RID sphere_shape = ps->shape_create(PhysicsServer3D::SHAPE_SPHERE);
ps->shape_set_data(sphere_shape, 0.5);
- type_shape_map[PhysicsServer::SHAPE_SPHERE] = sphere_shape;
+ type_shape_map[PhysicsServer3D::SHAPE_SPHERE] = sphere_shape;
/* BOX SHAPE */
@@ -148,11 +148,11 @@ protected:
RID box_mesh = vs->mesh_create();
Geometry::MeshData box_data = Geometry::build_convex_mesh(box_planes);
vs->mesh_add_surface_from_mesh_data(box_mesh, box_data);
- type_mesh_map[PhysicsServer::SHAPE_BOX] = box_mesh;
+ type_mesh_map[PhysicsServer3D::SHAPE_BOX] = box_mesh;
- RID box_shape = ps->shape_create(PhysicsServer::SHAPE_BOX);
+ RID box_shape = ps->shape_create(PhysicsServer3D::SHAPE_BOX);
ps->shape_set_data(box_shape, Vector3(0.5, 0.5, 0.5));
- type_shape_map[PhysicsServer::SHAPE_BOX] = box_shape;
+ type_shape_map[PhysicsServer3D::SHAPE_BOX] = box_shape;
/* CAPSULE SHAPE */
@@ -162,14 +162,14 @@ protected:
Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes);
vs->mesh_add_surface_from_mesh_data(capsule_mesh, capsule_data);
- type_mesh_map[PhysicsServer::SHAPE_CAPSULE] = capsule_mesh;
+ type_mesh_map[PhysicsServer3D::SHAPE_CAPSULE] = capsule_mesh;
- RID capsule_shape = ps->shape_create(PhysicsServer::SHAPE_CAPSULE);
+ RID capsule_shape = ps->shape_create(PhysicsServer3D::SHAPE_CAPSULE);
Dictionary capsule_params;
capsule_params["radius"] = 0.5;
capsule_params["height"] = 1.4;
ps->shape_set_data(capsule_shape, capsule_params);
- type_shape_map[PhysicsServer::SHAPE_CAPSULE] = capsule_shape;
+ type_shape_map[PhysicsServer3D::SHAPE_CAPSULE] = capsule_shape;
/* CONVEX SHAPE */
@@ -180,18 +180,18 @@ protected:
QuickHull::build(convex_data.vertices, convex_data);
vs->mesh_add_surface_from_mesh_data(convex_mesh, convex_data);
- type_mesh_map[PhysicsServer::SHAPE_CONVEX_POLYGON] = convex_mesh;
+ type_mesh_map[PhysicsServer3D::SHAPE_CONVEX_POLYGON] = convex_mesh;
- RID convex_shape = ps->shape_create(PhysicsServer::SHAPE_CONVEX_POLYGON);
+ RID convex_shape = ps->shape_create(PhysicsServer3D::SHAPE_CONVEX_POLYGON);
ps->shape_set_data(convex_shape, convex_data.vertices);
- type_shape_map[PhysicsServer::SHAPE_CONVEX_POLYGON] = convex_shape;
+ type_shape_map[PhysicsServer3D::SHAPE_CONVEX_POLYGON] = convex_shape;
}
void make_trimesh(Vector<Vector3> p_faces, const Transform &p_xform = Transform()) {
- VisualServer *vs = VisualServer::get_singleton();
- PhysicsServer *ps = PhysicsServer::get_singleton();
- RID trimesh_shape = ps->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON);
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
+ RID trimesh_shape = ps->shape_create(PhysicsServer3D::SHAPE_CONCAVE_POLYGON);
ps->shape_set_data(trimesh_shape, p_faces);
p_faces = ps->shape_get_data(trimesh_shape); // optimized one
Vector<Vector3> normals; // for drawing
@@ -205,19 +205,19 @@ protected:
RID trimesh_mesh = vs->mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VS::ARRAY_VERTEX] = p_faces;
- d[VS::ARRAY_NORMAL] = normals;
- vs->mesh_add_surface_from_arrays(trimesh_mesh, VS::PRIMITIVE_TRIANGLES, d);
+ d.resize(RS::ARRAY_MAX);
+ d[RS::ARRAY_VERTEX] = p_faces;
+ d[RS::ARRAY_NORMAL] = normals;
+ vs->mesh_add_surface_from_arrays(trimesh_mesh, RS::PRIMITIVE_TRIANGLES, d);
RID triins = vs->instance_create2(trimesh_mesh, scenario);
- RID tribody = ps->body_create(PhysicsServer::BODY_MODE_STATIC);
+ RID tribody = ps->body_create(PhysicsServer3D::BODY_MODE_STATIC);
ps->body_set_space(tribody, space);
//todo set space
ps->body_add_shape(tribody, trimesh_shape);
Transform tritrans = p_xform;
- ps->body_set_state(tribody, PhysicsServer::BODY_STATE_TRANSFORM, tritrans);
+ ps->body_set_state(tribody, PhysicsServer3D::BODY_STATE_TRANSFORM, tritrans);
vs->instance_set_transform(triins, tritrans);
}
@@ -276,11 +276,11 @@ public:
if (mover.is_valid()) {
- PhysicsServer *ps = PhysicsServer::get_singleton();
- Transform t = ps->body_get_state(mover, PhysicsServer::BODY_STATE_TRANSFORM);
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
+ Transform t = ps->body_get_state(mover, PhysicsServer3D::BODY_STATE_TRANSFORM);
t.origin += Vector3(x, y, 0);
- ps->body_set_state(mover, PhysicsServer::BODY_STATE_TRANSFORM, t);
+ ps->body_set_state(mover, PhysicsServer3D::BODY_STATE_TRANSFORM, t);
}
}
}
@@ -294,11 +294,11 @@ public:
ofs_x = ofs_y = 0;
init_shapes();
- PhysicsServer *ps = PhysicsServer::get_singleton();
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
space = ps->space_create();
ps->space_set_active(space, true);
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
/* LIGHT */
RID lightaux = vs->directional_light_create();
@@ -335,17 +335,17 @@ public:
if (mover.is_valid()) {
static float joy_speed = 10;
- PhysicsServer *ps = PhysicsServer::get_singleton();
- Transform t = ps->body_get_state(mover, PhysicsServer::BODY_STATE_TRANSFORM);
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
+ Transform t = ps->body_get_state(mover, PhysicsServer3D::BODY_STATE_TRANSFORM);
t.origin += Vector3(joy_speed * joy_direction.x * p_time, -joy_speed * joy_direction.y * p_time, 0);
- ps->body_set_state(mover, PhysicsServer::BODY_STATE_TRANSFORM, t);
+ ps->body_set_state(mover, PhysicsServer3D::BODY_STATE_TRANSFORM, t);
};
Transform cameratr;
cameratr.rotate(Vector3(0, 1, 0), ofs_x);
cameratr.rotate(Vector3(1, 0, 0), -ofs_y);
cameratr.translate(Vector3(0, 2, 8));
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
vs->camera_set_transform(camera, cameratr);
return quit;
@@ -361,17 +361,17 @@ public:
void test_character() {
- VisualServer *vs = VisualServer::get_singleton();
- PhysicsServer *ps = PhysicsServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer3D *ps = PhysicsServer3D::get_singleton();
Vector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 1, 12, 5, Vector3::AXIS_Y);
RID capsule_mesh = vs->mesh_create();
Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes);
vs->mesh_add_surface_from_mesh_data(capsule_mesh, capsule_data);
- type_mesh_map[PhysicsServer::SHAPE_CAPSULE] = capsule_mesh;
+ type_mesh_map[PhysicsServer3D::SHAPE_CAPSULE] = capsule_mesh;
- RID capsule_shape = ps->shape_create(PhysicsServer::SHAPE_CAPSULE);
+ RID capsule_shape = ps->shape_create(PhysicsServer3D::SHAPE_CAPSULE);
Dictionary capsule_params;
capsule_params["radius"] = 0.5;
capsule_params["height"] = 1;
@@ -381,14 +381,14 @@ public:
ps->shape_set_data(capsule_shape, capsule_params);
RID mesh_instance = vs->instance_create2(capsule_mesh, scenario);
- character = ps->body_create(PhysicsServer::BODY_MODE_CHARACTER);
+ character = ps->body_create(PhysicsServer3D::BODY_MODE_CHARACTER);
ps->body_set_space(character, space);
//todo add space
ps->body_add_shape(character, capsule_shape);
ps->body_set_force_integration_callback(character, this, "body_changed_transform", mesh_instance);
- ps->body_set_state(character, PhysicsServer::BODY_STATE_TRANSFORM, Transform(Basis(), Vector3(-2, 5, -2)));
+ ps->body_set_state(character, PhysicsServer3D::BODY_STATE_TRANSFORM, Transform(Basis(), Vector3(-2, 5, -2)));
bodies.push_back(character);
}
@@ -396,21 +396,21 @@ public:
for (int i = 0; i < 35; i++) {
- static const PhysicsServer::ShapeType shape_idx[] = {
- PhysicsServer::SHAPE_CAPSULE,
- PhysicsServer::SHAPE_BOX,
- PhysicsServer::SHAPE_SPHERE,
- PhysicsServer::SHAPE_CONVEX_POLYGON
+ static const PhysicsServer3D::ShapeType shape_idx[] = {
+ PhysicsServer3D::SHAPE_CAPSULE,
+ PhysicsServer3D::SHAPE_BOX,
+ PhysicsServer3D::SHAPE_SPHERE,
+ PhysicsServer3D::SHAPE_CONVEX_POLYGON
};
- PhysicsServer::ShapeType type = shape_idx[i % 4];
+ PhysicsServer3D::ShapeType type = shape_idx[i % 4];
Transform t;
t.origin = Vector3(0.0 * i, 3.5 + 1.1 * i, 0.7 + 0.0 * i);
t.basis.rotate(Vector3(0.2, -1, 0), Math_PI / 2 * 0.6);
- create_body(type, PhysicsServer::BODY_MODE_RIGID, t);
+ create_body(type, PhysicsServer3D::BODY_MODE_RIGID, t);
}
create_static_plane(Plane(Vector3(0, 1, 0), -1));
@@ -418,7 +418,7 @@ public:
void test_activate() {
- create_body(PhysicsServer::SHAPE_BOX, PhysicsServer::BODY_MODE_RIGID, Transform(Basis(), Vector3(0, 2, 0)), true);
+ create_body(PhysicsServer3D::SHAPE_BOX, PhysicsServer3D::BODY_MODE_RIGID, Transform(Basis(), Vector3(0, 2, 0)), true);
create_static_plane(Plane(Vector3(0, 1, 0), -1));
}
diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp
index 4403e40b76..6feff3b0a9 100644
--- a/main/tests/test_physics_2d.cpp
+++ b/main/tests/test_physics_2d.cpp
@@ -36,8 +36,8 @@
#include "core/print_string.h"
#include "scene/resources/texture.h"
#include "servers/display_server.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
static const unsigned char convex_png[] = {
0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x40, 0x8, 0x6, 0x0, 0x0, 0x0, 0xaa, 0x69, 0x71, 0xde, 0x0, 0x0, 0x0, 0x1, 0x73, 0x52, 0x47, 0x42, 0x0, 0xae, 0xce, 0x1c, 0xe9, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf9, 0x43, 0xbb, 0x7f, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xdb, 0x6, 0xa, 0x3, 0x13, 0x31, 0x66, 0xa7, 0xac, 0x79, 0x0, 0x0, 0x4, 0xef, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x9b, 0xdd, 0x4e, 0x2a, 0x57, 0x14, 0xc7, 0xf7, 0x1e, 0xc0, 0x19, 0x38, 0x32, 0x80, 0xa, 0x6a, 0xda, 0x18, 0xa3, 0xc6, 0x47, 0x50, 0x7b, 0xa1, 0xd9, 0x36, 0x27, 0x7e, 0x44, 0xed, 0x45, 0x4d, 0x93, 0x3e, 0x40, 0x1f, 0x64, 0x90, 0xf4, 0x1, 0xbc, 0xf0, 0xc2, 0x9c, 0x57, 0x30, 0x4d, 0xbc, 0xa8, 0x6d, 0xc, 0x69, 0x26, 0xb5, 0x68, 0x8b, 0x35, 0x7e, 0x20, 0xb4, 0xf5, 0x14, 0xbf, 0x51, 0x3c, 0x52, 0xe, 0xc, 0xe, 0xc8, 0xf0, 0xb1, 0x7a, 0x51, 0x3d, 0xb1, 0x9e, 0x19, 0x1c, 0x54, 0x70, 0x1c, 0xdc, 0x9, 0x17, 0x64, 0x8, 0xc9, 0xff, 0xb7, 0xd6, 0x7f, 0xcd, 0x3f, 0x2b, 0xd9, 0x8, 0xbd, 0x9c, 0xda, 0x3e, 0xf8, 0x31, 0xff, 0xc, 0x0, 0x8, 0x42, 0x88, 0x9c, 0x9f, 0x9f, 0xbf, 0xa, 0x87, 0xc3, 0xad, 0x7d, 0x7d, 0x7d, 0x7f, 0x23, 0x84, 0x78, 0x8c, 0x31, 0xaf, 0x55, 0x0, 0xc6, 0xc7, 0x14, 0x1e, 0x8f, 0xc7, 0xbf, 0x38, 0x3c, 0x3c, 0x6c, 0x9b, 0x9f, 0x9f, 0x6f, 0xb8, 0x82, 0x9b, 0xee, 0xe8, 0xe8, 0xf8, 0x12, 0x0, 0xbe, 0xd3, 0x2a, 0x8, 0xfc, 0x50, 0xd1, 0xf9, 0x7c, 0x9e, 0x8a, 0x46, 0xa3, 0x5f, 0x9d, 0x9e, 0x9e, 0x7e, 0xb2, 0xb0, 0xb0, 0x60, 0xe5, 0x79, 0x1e, 0xf1, 0xfc, 0x7f, 0x3a, 0x9, 0x21, 0x88, 0x10, 0x82, 0x26, 0x26, 0x26, 0xde, 0x77, 0x75, 0x75, 0x85, 0x59, 0x96, 0xfd, 0x5e, 0x6b, 0x20, 0xf0, 0x7d, 0x85, 0x4b, 0x92, 0xf4, 0xfa, 0xe0, 0xe0, 0xe0, 0xd3, 0xb9, 0xb9, 0xb9, 0x46, 0x49, 0x92, 0xea, 0x6f, 0xa, 0xbf, 0x7d, 0x8, 0x21, 0x68, 0x70, 0x70, 0xb0, 0x38, 0x39, 0x39, 0x79, 0xd6, 0xd9, 0xd9, 0xb9, 0xcf, 0x30, 0xcc, 0xa2, 0xd6, 0xad, 0x21, 0x2b, 0x1c, 0x0, 0x38, 0x41, 0x10, 0xfc, 0xdb, 0xdb, 0xdb, 0x27, 0x1e, 0x8f, 0x27, 0x4b, 0x8, 0x1, 0x84, 0x90, 0xea, 0xf, 0x21, 0x4, 0x3c, 0x1e, 0x4f, 0x76, 0x67, 0x67, 0x67, 0x3f, 0x9f, 0xcf, 0xff, 0x7c, 0x5, 0xf3, 0xd9, 0x0, 0xe0, 0x2, 0x81, 0xc0, 0xa9, 0xdb, 0xed, 0x2e, 0x94, 0x2b, 0x5c, 0xe, 0xc4, 0xca, 0xca, 0x8a, 0x18, 0x8d, 0x46, 0x3, 0x0, 0xc0, 0x69, 0x1e, 0x4, 0x0, 0x90, 0x48, 0x24, 0x12, 0xe4, 0x38, 0xee, 0x41, 0xc2, 0x6f, 0x43, 0xe0, 0x38, 0xe, 0xfc, 0x7e, 0xbf, 0x10, 0x8b, 0xc5, 0xd6, 0x35, 0xd, 0x22, 0x9b, 0xcd, 0x7a, 0x96, 0x97, 0x97, 0x33, 0xf, 0xad, 0x7c, 0x29, 0x10, 0x9b, 0x9b, 0x9b, 0xef, 0x2e, 0x2e, 0x2e, 0x7e, 0xd5, 0x1c, 0x8, 0x0, 0x20, 0xe1, 0x70, 0x38, 0xfc, 0x98, 0xd5, 0x57, 0x2, 0xe1, 0x76, 0xbb, 0xf3, 0xa1, 0x50, 0xe8, 0x38, 0x9b, 0xcd, 0xfe, 0xa2, 0x9, 0x8, 0x0, 0x40, 0x2e, 0x2f, 0x2f, 0x7d, 0x4b, 0x4b, 0x4b, 0xb9, 0x4a, 0x54, 0x5f, 0x9, 0xc4, 0xd2, 0xd2, 0x92, 0xb4, 0xb7, 0xb7, 0xf7, 0x36, 0x97, 0xcb, 0x4d, 0x3d, 0x29, 0x8, 0x0, 0xe0, 0x42, 0xa1, 0xd0, 0x71, 0xb5, 0xc4, 0xdf, 0xb6, 0xc5, 0x93, 0xe, 0x4a, 0x0, 0x20, 0xa9, 0x54, 0xea, 0x37, 0xb7, 0xdb, 0x5d, 0xa8, 0xa6, 0x78, 0x39, 0x10, 0x6b, 0x6b, 0x6b, 0xf1, 0x64, 0x32, 0xb9, 0x5a, 0x55, 0x10, 0x0, 0xc0, 0x6d, 0x6c, 0x6c, 0x9c, 0x57, 0xbb, 0xfa, 0x25, 0x40, 0x14, 0x3, 0x81, 0x40, 0x34, 0x93, 0xc9, 0x2c, 0x57, 0x1c, 0x4, 0x0, 0x90, 0x58, 0x2c, 0xb6, 0x5e, 0xe9, 0xc1, 0x77, 0x1f, 0x10, 0x53, 0x53, 0x53, 0x52, 0xc5, 0x83, 0x14, 0x0, 0x70, 0x7e, 0xbf, 0x5f, 0xd0, 0x42, 0xf5, 0x95, 0x40, 0xf8, 0x7c, 0xbe, 0xcb, 0xa3, 0xa3, 0xa3, 0x3f, 0x1e, 0xbd, 0x1b, 0x0, 0x80, 0x1c, 0x1f, 0x1f, 0x87, 0xb4, 0x56, 0xfd, 0xaa, 0x5, 0x29, 0x51, 0x14, 0xbf, 0xf5, 0xf9, 0x7c, 0x97, 0x5a, 0xad, 0xbe, 0x12, 0x88, 0xf5, 0xf5, 0xf5, 0xd8, 0x83, 0x83, 0x54, 0xb5, 0x42, 0x8f, 0x66, 0x83, 0x94, 0xd6, 0xbd, 0x5f, 0xce, 0x7c, 0x38, 0x3c, 0x3c, 0xfc, 0xb3, 0x50, 0x28, 0xb8, 0xcb, 0x2, 0x1, 0x0, 0xdc, 0xf4, 0xf4, 0xf4, 0xfe, 0x73, 0x15, 0x2f, 0x17, 0xa4, 0x22, 0x91, 0x48, 0x50, 0xb5, 0x2d, 0x0, 0x80, 0x9b, 0x99, 0x99, 0x79, 0xfb, 0xdc, 0x1, 0xc8, 0x5, 0xa9, 0x44, 0x22, 0xf1, 0xfb, 0x9d, 0x10, 0x0, 0x80, 0x9b, 0x9d, 0x9d, 0xd, 0xea, 0x5, 0xc0, 0xad, 0xfd, 0x43, 0x1a, 0x0, 0xb8, 0xdb, 0x9a, 0xa9, 0x8f, 0xb6, 0xa4, 0x46, 0xa3, 0xa4, 0xb7, 0xd5, 0x37, 0xcf, 0xf3, 0x68, 0x75, 0x75, 0xf5, 0x4c, 0xee, 0x99, 0x1c, 0x80, 0x9c, 0x1e, 0xf7, 0xff, 0x16, 0x8b, 0x45, 0x50, 0x5, 0xa0, 0xb7, 0xb7, 0xb7, 0x85, 0x10, 0xa2, 0x2b, 0xf1, 0x84, 0x10, 0xd4, 0xdf, 0xdf, 0x6f, 0x57, 0x3, 0x80, 0x37, 0x18, 0xc, 0x5, 0x3d, 0x2, 0xa0, 0x69, 0x3a, 0x8b, 0x10, 0xe2, 0x4b, 0x2, 0xc0, 0x18, 0xf3, 0xc1, 0x60, 0x70, 0x47, 0x8f, 0x16, 0x38, 0x3a, 0x3a, 0x5a, 0x93, 0x5b, 0xc3, 0x7f, 0x64, 0x81, 0xba, 0xba, 0x3a, 0x49, 0x8f, 0x0, 0x1a, 0x1a, 0x1a, 0xd4, 0xcd, 0x0, 0x93, 0xc9, 0xa4, 0xcb, 0x21, 0xe8, 0x74, 0x3a, 0xd5, 0x1, 0xa0, 0x69, 0x5a, 0x77, 0x1d, 0x80, 0x31, 0x2e, 0x38, 0x9d, 0x4e, 0xb1, 0x66, 0x1, 0x30, 0xc, 0x23, 0x28, 0x3d, 0x93, 0x9b, 0x1, 0xb9, 0x9a, 0x6, 0x60, 0x36, 0x9b, 0x75, 0xd7, 0x1, 0x4a, 0x21, 0xa8, 0x26, 0x0, 0x94, 0xa, 0x41, 0xb2, 0x0, 0x18, 0x86, 0xc9, 0xe9, 0xd, 0x80, 0x52, 0x8, 0x92, 0x5, 0x60, 0xb1, 0x58, 0x74, 0x67, 0x1, 0xa5, 0x10, 0xa4, 0x4, 0x40, 0x77, 0x43, 0xd0, 0xe1, 0x70, 0xa8, 0x9f, 0x1, 0x14, 0x45, 0x1, 0x45, 0x51, 0x79, 0x3d, 0x1, 0x68, 0x6e, 0x6e, 0x4e, 0xaa, 0x6, 0x80, 0x10, 0x42, 0x6, 0x83, 0x41, 0x37, 0x36, 0x28, 0x15, 0x82, 0x6a, 0x2, 0x0, 0x4d, 0xd3, 0xa9, 0x52, 0xcf, 0x95, 0x0, 0xe8, 0x66, 0xe, 0x98, 0xcd, 0x66, 0xa1, 0x6c, 0x0, 0x7a, 0x5a, 0x8b, 0x59, 0x2c, 0x96, 0x64, 0xcd, 0x2, 0xb8, 0x2b, 0x4, 0xe9, 0xde, 0x2, 0x77, 0x85, 0xa0, 0x9a, 0xb0, 0x40, 0xa9, 0x10, 0xa4, 0x8, 0xc0, 0x64, 0x32, 0xe9, 0x6, 0x40, 0xa9, 0x10, 0x54, 0xaa, 0x3, 0x74, 0xf3, 0x16, 0x70, 0xb9, 0x5c, 0xe5, 0x3, 0xe8, 0xe9, 0xe9, 0x69, 0xd5, 0xc3, 0x66, 0x18, 0x63, 0x5c, 0x68, 0x6a, 0x6a, 0x12, 0xcb, 0x5, 0xa0, 0x9b, 0xd5, 0x38, 0x4d, 0xd3, 0x29, 0x8a, 0xa2, 0xa0, 0x2c, 0x0, 0x18, 0x63, 0x3e, 0x14, 0xa, 0xfd, 0x55, 0xb, 0x21, 0x48, 0xd1, 0x2, 0x7a, 0x59, 0x8d, 0xdf, 0x1b, 0x80, 0x1e, 0x56, 0xe3, 0x84, 0x10, 0x34, 0x30, 0x30, 0x60, 0xbb, 0xeb, 0x77, 0x46, 0x5, 0xef, 0x48, 0xcf, 0x4d, 0xec, 0x8d, 0x99, 0x5, 0xf5, 0xf5, 0xf5, 0xef, 0x46, 0x47, 0x47, 0xb, 0x2e, 0x97, 0xeb, 0xbc, 0x54, 0x8, 0x52, 0x4, 0xc0, 0x30, 0x8c, 0xf4, 0x5c, 0x4, 0x9b, 0x4c, 0xa6, 0xf4, 0xf8, 0xf8, 0xb8, 0xc8, 0xb2, 0x6c, 0x32, 0x9d, 0x4e, 0xff, 0xd4, 0xdd, 0xdd, 0x7d, 0x66, 0x34, 0x1a, 0x8b, 0xd7, 0x3, 0xfd, 0xae, 0x5b, 0x29, 0xb2, 0x57, 0x66, 0xb6, 0xb6, 0xb6, 0xde, 0xc4, 0xe3, 0xf1, 0x6f, 0xae, 0xaf, 0xc1, 0x28, 0x5d, 0x85, 0x79, 0x2, 0xc1, 0x60, 0xb5, 0x5a, 0xa3, 0xa3, 0xa3, 0xa3, 0x45, 0xab, 0xd5, 0x9a, 0x2a, 0x16, 0x8b, 0x8b, 0x6d, 0x6d, 0x6d, 0xef, 0xd5, 0x8a, 0x55, 0xd, 0x20, 0x91, 0x48, 0xbc, 0x3e, 0x38, 0x38, 0xf8, 0xda, 0x6e, 0xb7, 0xf7, 0x5f, 0x5c, 0x5c, 0xd4, 0x7b, 0xbd, 0xde, 0xbc, 0x20, 0x8, 0xcd, 0x85, 0x42, 0x81, 0xfe, 0xf0, 0xae, 0xac, 0x10, 0x98, 0x9b, 0xd5, 0xc5, 0x18, 0x17, 0x59, 0x96, 0x3d, 0x1d, 0x19, 0x19, 0x1, 0x96, 0x65, 0x5, 0x8a, 0xa2, 0x7e, 0x6c, 0x69, 0x69, 0x49, 0x3d, 0x44, 0xb0, 0x2a, 0x0, 0x1f, 0xcc, 0x74, 0x75, 0x41, 0xea, 0xfa, 0x7b, 0x32, 0x99, 0x64, 0x76, 0x77, 0x77, 0x5d, 0xe, 0x87, 0xa3, 0x5f, 0x14, 0xc5, 0x57, 0x57, 0x60, 0x5a, 0x8b, 0xc5, 0xa2, 0xf1, 0xbe, 0x50, 0x6e, 0xa, 0x66, 0x18, 0x26, 0x31, 0x36, 0x36, 0x96, 0x65, 0x59, 0x36, 0x29, 0x49, 0x92, 0xb7, 0xbd, 0xbd, 0xfd, 0x9f, 0x72, 0xda, 0xf9, 0xd1, 0x1, 0xa8, 0x1, 0x93, 0xcf, 0xe7, 0xa9, 0x93, 0x93, 0x13, 0x1b, 0x4d, 0xd3, 0x9f, 0xb, 0x82, 0x60, 0xf5, 0x7a, 0xbd, 0xd9, 0x54, 0x2a, 0xe5, 0xcc, 0x64, 0x32, 0xe, 0xb9, 0x6e, 0xb9, 0x16, 0x8c, 0x31, 0x2e, 0xda, 0x6c, 0xb6, 0xc8, 0xd0, 0xd0, 0x10, 0x65, 0xb3, 0xd9, 0x92, 0x95, 0xa8, 0x6e, 0xc5, 0x0, 0xa8, 0xe9, 0x96, 0x68, 0x34, 0x6a, 0xdd, 0xdf, 0xdf, 0x6f, 0x76, 0xb9, 0x5c, 0x9f, 0x89, 0xa2, 0x58, 0xbf, 0xb8, 0xb8, 0x8, 0x26, 0x93, 0x29, 0x3b, 0x3c, 0x3c, 0x8c, 0xed, 0x76, 0x7b, 0xd2, 0x68, 0x34, 0xfe, 0xd0, 0xd8, 0xd8, 0x98, 0xae, 0xb6, 0xe0, 0x8a, 0x1, 0x50, 0xb, 0xe6, 0xa9, 0x5, 0xbf, 0x9c, 0x97, 0xf3, 0xff, 0xf3, 0x2f, 0x6a, 0x82, 0x7f, 0xf6, 0x4e, 0xca, 0x1b, 0xf5, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
@@ -66,8 +66,8 @@ class TestPhysics2DMainLoop : public MainLoop {
BodyShapeData body_shape_data[8];
void _create_body_shape_data() {
- VisualServer *vs = VisualServer::get_singleton();
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
// SEGMENT
@@ -86,13 +86,13 @@ class TestPhysics2DMainLoop : public MainLoop {
Ref<Image> image = memnew(Image(32, 2, 0, Image::FORMAT_LA8, pixels));
- body_shape_data[Physics2DServer::SHAPE_SEGMENT].image = vs->texture_2d_create(image);
+ body_shape_data[PhysicsServer2D::SHAPE_SEGMENT].image = vs->texture_2d_create(image);
RID segment_shape = ps->segment_shape_create();
Rect2 sg(Point2(-16, 0), Point2(16, 0));
ps->shape_set_data(segment_shape, sg);
- body_shape_data[Physics2DServer::SHAPE_SEGMENT].shape = segment_shape;
+ body_shape_data[PhysicsServer2D::SHAPE_SEGMENT].shape = segment_shape;
}
// CIRCLE
@@ -113,12 +113,12 @@ class TestPhysics2DMainLoop : public MainLoop {
Ref<Image> image = memnew(Image(32, 32, 0, Image::FORMAT_LA8, pixels));
- body_shape_data[Physics2DServer::SHAPE_CIRCLE].image = vs->texture_2d_create(image);
+ body_shape_data[PhysicsServer2D::SHAPE_CIRCLE].image = vs->texture_2d_create(image);
RID circle_shape = ps->circle_shape_create();
ps->shape_set_data(circle_shape, 16);
- body_shape_data[Physics2DServer::SHAPE_CIRCLE].shape = circle_shape;
+ body_shape_data[PhysicsServer2D::SHAPE_CIRCLE].shape = circle_shape;
}
// BOX
@@ -140,12 +140,12 @@ class TestPhysics2DMainLoop : public MainLoop {
Ref<Image> image = memnew(Image(32, 32, 0, Image::FORMAT_LA8, pixels));
- body_shape_data[Physics2DServer::SHAPE_RECTANGLE].image = vs->texture_2d_create(image);
+ body_shape_data[PhysicsServer2D::SHAPE_RECTANGLE].image = vs->texture_2d_create(image);
RID rectangle_shape = ps->rectangle_shape_create();
ps->shape_set_data(rectangle_shape, Vector2(16, 16));
- body_shape_data[Physics2DServer::SHAPE_RECTANGLE].shape = rectangle_shape;
+ body_shape_data[PhysicsServer2D::SHAPE_RECTANGLE].shape = rectangle_shape;
}
// CAPSULE
@@ -168,12 +168,12 @@ class TestPhysics2DMainLoop : public MainLoop {
Ref<Image> image = memnew(Image(32, 64, 0, Image::FORMAT_LA8, pixels));
- body_shape_data[Physics2DServer::SHAPE_CAPSULE].image = vs->texture_2d_create(image);
+ body_shape_data[PhysicsServer2D::SHAPE_CAPSULE].image = vs->texture_2d_create(image);
RID capsule_shape = ps->capsule_shape_create();
ps->shape_set_data(capsule_shape, Vector2(16, 32));
- body_shape_data[Physics2DServer::SHAPE_CAPSULE].shape = capsule_shape;
+ body_shape_data[PhysicsServer2D::SHAPE_CAPSULE].shape = capsule_shape;
}
// CONVEX
@@ -182,7 +182,7 @@ class TestPhysics2DMainLoop : public MainLoop {
Ref<Image> image = memnew(Image(convex_png));
- body_shape_data[Physics2DServer::SHAPE_CONVEX_POLYGON].image = vs->texture_2d_create(image);
+ body_shape_data[PhysicsServer2D::SHAPE_CONVEX_POLYGON].image = vs->texture_2d_create(image);
RID convex_polygon_shape = ps->convex_polygon_shape_create();
@@ -197,14 +197,14 @@ class TestPhysics2DMainLoop : public MainLoop {
arr.push_back(Point2(11, 7) - sb);
ps->shape_set_data(convex_polygon_shape, arr);
- body_shape_data[Physics2DServer::SHAPE_CONVEX_POLYGON].shape = convex_polygon_shape;
+ body_shape_data[PhysicsServer2D::SHAPE_CONVEX_POLYGON].shape = convex_polygon_shape;
}
}
void _do_ray_query() {
/*
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
ps->query_intersection_segment(ray_query,ray_from,ray_to);
*/
}
@@ -246,16 +246,16 @@ protected:
}
}
- RID _add_body(Physics2DServer::ShapeType p_shape, const Transform2D &p_xform) {
+ RID _add_body(PhysicsServer2D::ShapeType p_shape, const Transform2D &p_xform) {
- VisualServer *vs = VisualServer::get_singleton();
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
RID body = ps->body_create();
ps->body_add_shape(body, body_shape_data[p_shape].shape);
ps->body_set_space(body, space);
- ps->body_set_continuous_collision_detection_mode(body, Physics2DServer::CCD_MODE_CAST_SHAPE);
- ps->body_set_state(body, Physics2DServer::BODY_STATE_TRANSFORM, p_xform);
+ ps->body_set_continuous_collision_detection_mode(body, PhysicsServer2D::CCD_MODE_CAST_SHAPE);
+ ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, p_xform);
//print_line("add body with xform: "+p_xform);
RID sprite = vs->canvas_item_create();
@@ -273,7 +273,7 @@ protected:
void _add_plane(const Vector2 &p_normal, real_t p_d) {
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
Array arr;
arr.push_back(p_normal);
@@ -283,23 +283,23 @@ protected:
ps->shape_set_data(plane, arr);
RID plane_body = ps->body_create();
- ps->body_set_mode(plane_body, Physics2DServer::BODY_MODE_STATIC);
+ ps->body_set_mode(plane_body, PhysicsServer2D::BODY_MODE_STATIC);
ps->body_set_space(plane_body, space);
ps->body_add_shape(plane_body, plane);
}
void _add_concave(const Vector<Vector2> &p_points, const Transform2D &p_xform = Transform2D()) {
- Physics2DServer *ps = Physics2DServer::get_singleton();
- VisualServer *vs = VisualServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
RID concave = ps->concave_polygon_shape_create();
ps->shape_set_data(concave, p_points);
RID body = ps->body_create();
- ps->body_set_mode(body, Physics2DServer::BODY_MODE_STATIC);
+ ps->body_set_mode(body, PhysicsServer2D::BODY_MODE_STATIC);
ps->body_set_space(body, space);
ps->body_add_shape(body, concave);
- ps->body_set_state(body, Physics2DServer::BODY_STATE_TRANSFORM, p_xform);
+ ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, p_xform);
RID sprite = vs->canvas_item_create();
vs->canvas_item_set_parent(sprite, canvas);
@@ -310,8 +310,8 @@ protected:
}
void _body_moved(Object *p_state, RID p_sprite) {
- Physics2DDirectBodyState *state = (Physics2DDirectBodyState *)p_state;
- VisualServer::get_singleton()->canvas_item_set_transform(p_sprite, state->get_transform());
+ PhysicsDirectBodyState2D *state = (PhysicsDirectBodyState2D *)p_state;
+ RenderingServer::get_singleton()->canvas_item_set_transform(p_sprite, state->get_transform());
}
void _ray_query_callback(const RID &p_rid, ObjectID p_id, int p_shape, const Vector2 &p_point, const Vector2 &p_normal) {
@@ -324,7 +324,7 @@ protected:
ray_end = ray_to;
}
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
vs->canvas_item_clear(ray);
vs->canvas_item_add_line(ray, ray_from, ray_end, p_rid.is_valid() ? Color(0, 1, 0.4) : Color(1, 0.4, 0), 2);
@@ -341,14 +341,14 @@ protected:
public:
virtual void init() {
- VisualServer *vs = VisualServer::get_singleton();
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
space = ps->space_create();
ps->space_set_active(space, true);
ps->set_active(true);
- ps->area_set_param(space, Physics2DServer::AREA_PARAM_GRAVITY_VECTOR, Vector2(0, 1));
- ps->area_set_param(space, Physics2DServer::AREA_PARAM_GRAVITY, 98);
+ ps->area_set_param(space, PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR, Vector2(0, 1));
+ ps->area_set_param(space, PhysicsServer2D::AREA_PARAM_GRAVITY, 98);
{
@@ -378,25 +378,25 @@ public:
for (int i = 0; i < 32; i++) {
- Physics2DServer::ShapeType types[4] = {
- Physics2DServer::SHAPE_CIRCLE,
- Physics2DServer::SHAPE_CAPSULE,
- Physics2DServer::SHAPE_RECTANGLE,
- Physics2DServer::SHAPE_CONVEX_POLYGON,
+ PhysicsServer2D::ShapeType types[4] = {
+ PhysicsServer2D::SHAPE_CIRCLE,
+ PhysicsServer2D::SHAPE_CAPSULE,
+ PhysicsServer2D::SHAPE_RECTANGLE,
+ PhysicsServer2D::SHAPE_CONVEX_POLYGON,
};
- Physics2DServer::ShapeType type = types[i % 4];
- //type=Physics2DServer::SHAPE_SEGMENT;
+ PhysicsServer2D::ShapeType type = types[i % 4];
+ //type=PhysicsServer2D::SHAPE_SEGMENT;
_add_body(type, Transform2D(i * 0.8, Point2(152 + i * 40, 100 - 40 * i)));
/*
if (i==0)
- ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
+ ps->body_set_mode(b,PhysicsServer2D::BODY_MODE_STATIC);
*/
}
- //RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Transform2D(0,Point2(101,140)));
- //ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
+ //RID b= _add_body(PhysicsServer2D::SHAPE_CIRCLE,Transform2D(0,Point2(101,140)));
+ //ps->body_set_mode(b,PhysicsServer2D::BODY_MODE_STATIC);
Point2 prev;
diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp
index 0fbc5ea697..bcfcf61e25 100644
--- a/main/tests/test_render.cpp
+++ b/main/tests/test_render.cpp
@@ -37,7 +37,7 @@
#include "core/os/os.h"
#include "core/print_string.h"
#include "servers/display_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#define OBJECT_COUNT 50
@@ -75,7 +75,7 @@ public:
virtual void init() {
print_line("INITIALIZING TEST RENDER");
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
test_cube = vs->get_test_cube();
scenario = vs->scenario_create();
@@ -126,7 +126,7 @@ public:
print_line("ERR: " + itos(err));
test_cube = vs->mesh_create();
vs->mesh_add_surface_from_mesh_data(test_cube, md);
- //vs->scenario_set_debug(scenario,VS::SCENARIO_DEBUG_WIREFRAME);
+ //vs->scenario_set_debug(scenario,RS::SCENARIO_DEBUG_WIREFRAME);
/*
RID sm = vs->shader_create();
@@ -174,16 +174,16 @@ public:
vs->camera_set_perspective(camera, 60, 0.1, 1000);
/*
- RID lightaux = vs->light_create( VisualServer::LIGHT_OMNI );
- vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_RADIUS, 80 );
- vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_ATTENUATION, 1 );
- vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_ENERGY, 1.5 );
+ RID lightaux = vs->light_create( RenderingServer::LIGHT_OMNI );
+ vs->light_set_var( lightaux, RenderingServer::LIGHT_VAR_RADIUS, 80 );
+ vs->light_set_var( lightaux, RenderingServer::LIGHT_VAR_ATTENUATION, 1 );
+ vs->light_set_var( lightaux, RenderingServer::LIGHT_VAR_ENERGY, 1.5 );
light = vs->instance_create( lightaux );
*/
RID lightaux;
lightaux = vs->directional_light_create();
- //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) );
+ //vs->light_set_color( lightaux, RenderingServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) );
vs->light_set_color(lightaux, Color(1.0, 1.0, 1.0));
//vs->light_set_shadow( lightaux, true );
light = vs->instance_create2(lightaux, scenario);
@@ -194,10 +194,10 @@ public:
vs->instance_set_transform(light, lla);
lightaux = vs->omni_light_create();
- //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) );
+ //vs->light_set_color( lightaux, RenderingServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) );
vs->light_set_color(lightaux, Color(1.0, 1.0, 0.0));
- vs->light_set_param(lightaux, VisualServer::LIGHT_PARAM_RANGE, 4);
- vs->light_set_param(lightaux, VisualServer::LIGHT_PARAM_ENERGY, 8);
+ vs->light_set_param(lightaux, RenderingServer::LIGHT_PARAM_RANGE, 4);
+ vs->light_set_param(lightaux, RenderingServer::LIGHT_PARAM_ENERGY, 8);
//vs->light_set_shadow( lightaux, true );
//light = vs->instance_create( lightaux );
@@ -206,7 +206,7 @@ public:
}
virtual bool iteration(float p_time) {
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
//Transform t;
//t.rotate(Vector3(0, 1, 0), ofs);
//t.translate(Vector3(0,0,20 ));
diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp
index 941a6771bf..dd525d7653 100644
--- a/main/tests/test_shader_lang.cpp
+++ b/main/tests/test_shader_lang.cpp
@@ -37,7 +37,7 @@
#include "core/print_string.h"
#include "scene/gui/control.h"
#include "scene/gui/text_edit.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
typedef ShaderLanguage SL;
diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp
index 1482fe99eb..d163512bb3 100644
--- a/modules/assimp/editor_scene_importer_assimp.cpp
+++ b/modules/assimp/editor_scene_importer_assimp.cpp
@@ -1208,9 +1208,9 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
}
Array array_copy;
- array_copy.resize(VisualServer::ARRAY_MAX);
+ array_copy.resize(RenderingServer::ARRAY_MAX);
- for (int l = 0; l < VisualServer::ARRAY_MAX; l++) {
+ for (int l = 0; l < RenderingServer::ARRAY_MAX; l++) {
array_copy[l] = array_mesh[l].duplicate(true);
}
@@ -1224,13 +1224,13 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
Vector3 position = Vector3(ai_pos.x, ai_pos.y, ai_pos.z);
vertices.ptrw()[l] = position;
}
- PackedVector3Array new_vertices = array_copy[VisualServer::ARRAY_VERTEX].duplicate(true);
+ PackedVector3Array new_vertices = array_copy[RenderingServer::ARRAY_VERTEX].duplicate(true);
ERR_CONTINUE(vertices.size() != new_vertices.size());
for (int32_t l = 0; l < new_vertices.size(); l++) {
Vector3 *w = new_vertices.ptrw();
w[l] = vertices[l];
}
- array_copy[VisualServer::ARRAY_VERTEX] = new_vertices;
+ array_copy[RenderingServer::ARRAY_VERTEX] = new_vertices;
}
int32_t color_set = 0;
@@ -1242,13 +1242,13 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
Color color = Color(ai_color.r, ai_color.g, ai_color.b, ai_color.a);
colors.ptrw()[l] = color;
}
- PackedColorArray new_colors = array_copy[VisualServer::ARRAY_COLOR].duplicate(true);
+ PackedColorArray new_colors = array_copy[RenderingServer::ARRAY_COLOR].duplicate(true);
ERR_CONTINUE(colors.size() != new_colors.size());
for (int32_t l = 0; l < colors.size(); l++) {
Color *w = new_colors.ptrw();
w[l] = colors[l];
}
- array_copy[VisualServer::ARRAY_COLOR] = new_colors;
+ array_copy[RenderingServer::ARRAY_COLOR] = new_colors;
}
if (ai_mesh->mAnimMeshes[j]->HasNormals()) {
@@ -1259,13 +1259,13 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
Vector3 normal = Vector3(ai_normal.x, ai_normal.y, ai_normal.z);
normals.ptrw()[l] = normal;
}
- PackedVector3Array new_normals = array_copy[VisualServer::ARRAY_NORMAL].duplicate(true);
+ PackedVector3Array new_normals = array_copy[RenderingServer::ARRAY_NORMAL].duplicate(true);
ERR_CONTINUE(normals.size() != new_normals.size());
for (int l = 0; l < normals.size(); l++) {
Vector3 *w = new_normals.ptrw();
w[l] = normals[l];
}
- array_copy[VisualServer::ARRAY_NORMAL] = new_normals;
+ array_copy[RenderingServer::ARRAY_NORMAL] = new_normals;
}
if (ai_mesh->mAnimMeshes[j]->HasTangentsAndBitangents()) {
@@ -1275,7 +1275,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
for (size_t l = 0; l < num_vertices; l++) {
AssimpUtils::calc_tangent_from_mesh(ai_mesh, j, l, l, w);
}
- PackedFloat32Array new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true);
+ PackedFloat32Array new_tangents = array_copy[RenderingServer::ARRAY_TANGENT].duplicate(true);
ERR_CONTINUE(new_tangents.size() != tangents.size() * 4);
for (int32_t l = 0; l < tangents.size(); l++) {
new_tangents.ptrw()[l + 0] = tangents[l].r;
@@ -1283,7 +1283,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
new_tangents.ptrw()[l + 2] = tangents[l].b;
new_tangents.ptrw()[l + 3] = tangents[l].a;
}
- array_copy[VisualServer::ARRAY_TANGENT] = new_tangents;
+ array_copy[RenderingServer::ARRAY_TANGENT] = new_tangents;
}
morphs[j] = array_copy;
diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp
index c29e91b5aa..bf6bc1debd 100644
--- a/modules/basis_universal/register_types.cpp
+++ b/modules/basis_universal/register_types.cpp
@@ -31,7 +31,7 @@
#include "register_types.h"
#include "core/os/os.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#include "texture_basisu.h"
#ifdef TOOLS_ENABLED
@@ -164,10 +164,10 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
switch (*(uint32_t *)(ptr)) {
case BASIS_DECOMPRESS_RG: {
- if (VS::get_singleton()->has_os_feature("rgtc")) {
+ if (RS::get_singleton()->has_os_feature("rgtc")) {
format = basist::transcoder_texture_format::cTFBC5; // get this from renderer
imgfmt = Image::FORMAT_RGTC_RG;
- } else if (VS::get_singleton()->has_os_feature("etc2")) {
+ } else if (RS::get_singleton()->has_os_feature("etc2")) {
//unfortunately, basis universal does not support
//
ERR_FAIL_V(image); //unimplemented here
@@ -179,13 +179,13 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
}
} break;
case BASIS_DECOMPRESS_RGB: {
- if (VS::get_singleton()->has_os_feature("bptc")) {
+ if (RS::get_singleton()->has_os_feature("bptc")) {
format = basist::transcoder_texture_format::cTFBC7_M6_OPAQUE_ONLY; // get this from renderer
imgfmt = Image::FORMAT_BPTC_RGBA;
- } else if (VS::get_singleton()->has_os_feature("s3tc")) {
+ } else if (RS::get_singleton()->has_os_feature("s3tc")) {
format = basist::transcoder_texture_format::cTFBC1; // get this from renderer
imgfmt = Image::FORMAT_DXT1;
- } else if (VS::get_singleton()->has_os_feature("etc")) {
+ } else if (RS::get_singleton()->has_os_feature("etc")) {
format = basist::transcoder_texture_format::cTFETC1; // get this from renderer
imgfmt = Image::FORMAT_ETC;
@@ -196,13 +196,13 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
} break;
case BASIS_DECOMPRESS_RGBA: {
- if (VS::get_singleton()->has_os_feature("bptc")) {
+ if (RS::get_singleton()->has_os_feature("bptc")) {
format = basist::transcoder_texture_format::cTFBC7_M5; // get this from renderer
imgfmt = Image::FORMAT_BPTC_RGBA;
- } else if (VS::get_singleton()->has_os_feature("s3tc")) {
+ } else if (RS::get_singleton()->has_os_feature("s3tc")) {
format = basist::transcoder_texture_format::cTFBC3; // get this from renderer
imgfmt = Image::FORMAT_DXT5;
- } else if (VS::get_singleton()->has_os_feature("etc2")) {
+ } else if (RS::get_singleton()->has_os_feature("etc2")) {
format = basist::transcoder_texture_format::cTFETC2; // get this from renderer
imgfmt = Image::FORMAT_ETC2_RGBA8;
} else {
@@ -212,10 +212,10 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
}
} break;
case BASIS_DECOMPRESS_RG_AS_RA: {
- if (VS::get_singleton()->has_os_feature("s3tc")) {
+ if (RS::get_singleton()->has_os_feature("s3tc")) {
format = basist::transcoder_texture_format::cTFBC3; // get this from renderer
imgfmt = Image::FORMAT_DXT5_RA_AS_RG;
- } else if (VS::get_singleton()->has_os_feature("etc2")) {
+ } else if (RS::get_singleton()->has_os_feature("etc2")) {
format = basist::transcoder_texture_format::cTFETC2; // get this from renderer
imgfmt = Image::FORMAT_ETC2_RGBA8;
} else {
diff --git a/modules/basis_universal/texture_basisu.cpp b/modules/basis_universal/texture_basisu.cpp
index 12f3241c98..9c3cdac36c 100644
--- a/modules/basis_universal/texture_basisu.cpp
+++ b/modules/basis_universal/texture_basisu.cpp
@@ -72,7 +72,7 @@ bool TextureBasisU::has_alpha() const {
void TextureBasisU::set_flags(uint32_t p_flags) {
flags = p_flags;
- VisualServer::get_singleton()->texture_set_flags(texture, p_flags);
+ RenderingServer::get_singleton()->texture_set_flags(texture, p_flags);
};
uint32_t TextureBasisU::get_flags() const {
@@ -144,8 +144,8 @@ void TextureBasisU::set_basisu_data(const Vector<uint8_t>& p_data) {
img.instance();
img->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata);
- VisualServer::get_singleton()->texture_allocate(texture, tex_size.x, tex_size.y, 0, img->get_format(), VS::TEXTURE_TYPE_2D, flags);
- VisualServer::get_singleton()->texture_set_data(texture, img);
+ RenderingServer::get_singleton()->texture_allocate(texture, tex_size.x, tex_size.y, 0, img->get_format(), RS::TEXTURE_TYPE_2D, flags);
+ RenderingServer::get_singleton()->texture_set_data(texture, img);
};
Error TextureBasisU::import(const Ref<Image>& p_img) {
@@ -221,13 +221,13 @@ Vector<uint8_t> TextureBasisU::get_basisu_data() const {
TextureBasisU::TextureBasisU() {
flags = FLAGS_DEFAULT;
- texture = VisualServer::get_singleton()->texture_create();
+ texture = RenderingServer::get_singleton()->texture_create();
};
TextureBasisU::~TextureBasisU() {
- VisualServer::get_singleton()->free(texture);
+ RenderingServer::get_singleton()->free(texture);
};
#endif
diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp
index e8a5c1475a..4d727529ef 100644
--- a/modules/bullet/area_bullet.cpp
+++ b/modules/bullet/area_bullet.cpp
@@ -46,7 +46,7 @@
AreaBullet::AreaBullet() :
RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA),
monitorable(true),
- spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED),
+ spOv_mode(PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED),
spOv_gravityPoint(false),
spOv_gravityPointDistanceScale(0),
spOv_gravityPointAttenuation(1),
@@ -86,11 +86,11 @@ void AreaBullet::dispatch_callbacks() {
switch (otherObj.state) {
case OVERLAP_STATE_ENTER:
otherObj.state = OVERLAP_STATE_INSIDE;
- call_event(otherObj.object, PhysicsServer::AREA_BODY_ADDED);
+ call_event(otherObj.object, PhysicsServer3D::AREA_BODY_ADDED);
otherObj.object->on_enter_area(this);
break;
case OVERLAP_STATE_EXIT:
- call_event(otherObj.object, PhysicsServer::AREA_BODY_REMOVED);
+ call_event(otherObj.object, PhysicsServer3D::AREA_BODY_REMOVED);
otherObj.object->on_exit_area(this);
overlappingObjects.remove(i); // Remove after callback
break;
@@ -101,7 +101,7 @@ void AreaBullet::dispatch_callbacks() {
}
}
-void AreaBullet::call_event(CollisionObjectBullet *p_otherObject, PhysicsServer::AreaBodyStatus p_status) {
+void AreaBullet::call_event(CollisionObjectBullet *p_otherObject, PhysicsServer3D::AreaBodyStatus p_status) {
InOutEventCallback &event = eventsCallbacks[static_cast<int>(p_otherObject->getType())];
Object *areaGodoObject = ObjectDB::get_instance(event.event_callback_id);
@@ -130,7 +130,7 @@ void AreaBullet::scratch() {
void AreaBullet::clear_overlaps(bool p_notify) {
for (int i = overlappingObjects.size() - 1; 0 <= i; --i) {
if (p_notify)
- call_event(overlappingObjects[i].object, PhysicsServer::AREA_BODY_REMOVED);
+ call_event(overlappingObjects[i].object, PhysicsServer3D::AREA_BODY_REMOVED);
overlappingObjects[i].object->on_exit_area(this);
}
overlappingObjects.clear();
@@ -140,7 +140,7 @@ void AreaBullet::remove_overlap(CollisionObjectBullet *p_object, bool p_notify)
for (int i = overlappingObjects.size() - 1; 0 <= i; --i) {
if (overlappingObjects[i].object == p_object) {
if (p_notify)
- call_event(overlappingObjects[i].object, PhysicsServer::AREA_BODY_REMOVED);
+ call_event(overlappingObjects[i].object, PhysicsServer3D::AREA_BODY_REMOVED);
overlappingObjects[i].object->on_exit_area(this);
overlappingObjects.remove(i);
break;
@@ -218,30 +218,30 @@ void AreaBullet::put_overlap_as_inside(int p_index) {
}
}
-void AreaBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant &p_value) {
+void AreaBullet::set_param(PhysicsServer3D::AreaParameter p_param, const Variant &p_value) {
switch (p_param) {
- case PhysicsServer::AREA_PARAM_GRAVITY:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY:
set_spOv_gravityMag(p_value);
break;
- case PhysicsServer::AREA_PARAM_GRAVITY_VECTOR:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR:
set_spOv_gravityVec(p_value);
break;
- case PhysicsServer::AREA_PARAM_LINEAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_LINEAR_DAMP:
set_spOv_linearDump(p_value);
break;
- case PhysicsServer::AREA_PARAM_ANGULAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP:
set_spOv_angularDump(p_value);
break;
- case PhysicsServer::AREA_PARAM_PRIORITY:
+ case PhysicsServer3D::AREA_PARAM_PRIORITY:
set_spOv_priority(p_value);
break;
- case PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT:
set_spOv_gravityPoint(p_value);
break;
- case PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
set_spOv_gravityPointDistanceScale(p_value);
break;
- case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
set_spOv_gravityPointAttenuation(p_value);
break;
default:
@@ -249,23 +249,23 @@ void AreaBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant &
}
}
-Variant AreaBullet::get_param(PhysicsServer::AreaParameter p_param) const {
+Variant AreaBullet::get_param(PhysicsServer3D::AreaParameter p_param) const {
switch (p_param) {
- case PhysicsServer::AREA_PARAM_GRAVITY:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY:
return spOv_gravityMag;
- case PhysicsServer::AREA_PARAM_GRAVITY_VECTOR:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR:
return spOv_gravityVec;
- case PhysicsServer::AREA_PARAM_LINEAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_LINEAR_DAMP:
return spOv_linearDump;
- case PhysicsServer::AREA_PARAM_ANGULAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP:
return spOv_angularDump;
- case PhysicsServer::AREA_PARAM_PRIORITY:
+ case PhysicsServer3D::AREA_PARAM_PRIORITY:
return spOv_priority;
- case PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT:
return spOv_gravityPoint;
- case PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
return spOv_gravityPointDistanceScale;
- case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
return spOv_gravityPointAttenuation;
default:
WARN_PRINT("Area doesn't support this parameter in the Bullet backend: " + itos(p_param));
diff --git a/modules/bullet/area_bullet.h b/modules/bullet/area_bullet.h
index 18888c6725..56977d4451 100644
--- a/modules/bullet/area_bullet.h
+++ b/modules/bullet/area_bullet.h
@@ -33,7 +33,7 @@
#include "collision_object_bullet.h"
#include "core/vector.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include "space_bullet.h"
/**
@@ -88,7 +88,7 @@ private:
Vector<OverlappingObjectData> overlappingObjects;
bool monitorable;
- PhysicsServer::AreaSpaceOverrideMode spOv_mode;
+ PhysicsServer3D::AreaSpaceOverrideMode spOv_mode;
bool spOv_gravityPoint;
real_t spOv_gravityPointDistanceScale;
real_t spOv_gravityPointAttenuation;
@@ -114,8 +114,8 @@ public:
bool is_monitoring() const;
- _FORCE_INLINE_ void set_spOv_mode(PhysicsServer::AreaSpaceOverrideMode p_mode) { spOv_mode = p_mode; }
- _FORCE_INLINE_ PhysicsServer::AreaSpaceOverrideMode get_spOv_mode() { return spOv_mode; }
+ _FORCE_INLINE_ void set_spOv_mode(PhysicsServer3D::AreaSpaceOverrideMode p_mode) { spOv_mode = p_mode; }
+ _FORCE_INLINE_ PhysicsServer3D::AreaSpaceOverrideMode get_spOv_mode() { return spOv_mode; }
_FORCE_INLINE_ void set_spOv_gravityPoint(bool p_isGP) { spOv_gravityPoint = p_isGP; }
_FORCE_INLINE_ bool is_spOv_gravityPoint() { return spOv_gravityPoint; }
@@ -146,7 +146,7 @@ public:
virtual void set_space(SpaceBullet *p_space);
virtual void dispatch_callbacks();
- void call_event(CollisionObjectBullet *p_otherObject, PhysicsServer::AreaBodyStatus p_status);
+ void call_event(CollisionObjectBullet *p_otherObject, PhysicsServer3D::AreaBodyStatus p_status);
void set_on_state_change(ObjectID p_id, const StringName &p_method, const Variant &p_udata = Variant());
void scratch();
@@ -162,8 +162,8 @@ public:
void put_overlap_as_exit(int p_index);
void put_overlap_as_inside(int p_index);
- void set_param(PhysicsServer::AreaParameter p_param, const Variant &p_value);
- Variant get_param(PhysicsServer::AreaParameter p_param) const;
+ void set_param(PhysicsServer3D::AreaParameter p_param, const Variant &p_value);
+ Variant get_param(PhysicsServer3D::AreaParameter p_param) const;
void set_event_callback(Type p_callbackObjectType, ObjectID p_id, const StringName &p_method);
bool has_event_callback(Type p_callbackObjectType);
diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp
index 89868babc6..5b3fe1bfac 100644
--- a/modules/bullet/bullet_physics_server.cpp
+++ b/modules/bullet/bullet_physics_server.cpp
@@ -74,18 +74,18 @@
body->get_space()->add_constraint(joint, joint->is_disabled_collisions_between_bodies());
// <--------------- Joint creation asserts
-void BulletPhysicsServer::_bind_methods() {
- //ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest);
+void BulletPhysicsServer3D::_bind_methods() {
+ //ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer3D::DoTest);
}
-BulletPhysicsServer::BulletPhysicsServer() :
- PhysicsServer(),
+BulletPhysicsServer3D::BulletPhysicsServer3D() :
+ PhysicsServer3D(),
active(true),
active_spaces_count(0) {}
-BulletPhysicsServer::~BulletPhysicsServer() {}
+BulletPhysicsServer3D::~BulletPhysicsServer3D() {}
-RID BulletPhysicsServer::shape_create(ShapeType p_shape) {
+RID BulletPhysicsServer3D::shape_create(ShapeType p_shape) {
ShapeBullet *shape = NULL;
switch (p_shape) {
@@ -133,51 +133,51 @@ RID BulletPhysicsServer::shape_create(ShapeType p_shape) {
CreateThenReturnRID(shape_owner, shape)
}
-void BulletPhysicsServer::shape_set_data(RID p_shape, const Variant &p_data) {
+void BulletPhysicsServer3D::shape_set_data(RID p_shape, const Variant &p_data) {
ShapeBullet *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND(!shape);
shape->set_data(p_data);
}
-void BulletPhysicsServer::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) {
+void BulletPhysicsServer3D::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) {
//WARN_PRINT("Bias not supported by Bullet physics engine");
}
-PhysicsServer::ShapeType BulletPhysicsServer::shape_get_type(RID p_shape) const {
+PhysicsServer3D::ShapeType BulletPhysicsServer3D::shape_get_type(RID p_shape) const {
ShapeBullet *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND_V(!shape, PhysicsServer::SHAPE_CUSTOM);
+ ERR_FAIL_COND_V(!shape, PhysicsServer3D::SHAPE_CUSTOM);
return shape->get_type();
}
-Variant BulletPhysicsServer::shape_get_data(RID p_shape) const {
+Variant BulletPhysicsServer3D::shape_get_data(RID p_shape) const {
ShapeBullet *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, Variant());
return shape->get_data();
}
-void BulletPhysicsServer::shape_set_margin(RID p_shape, real_t p_margin) {
+void BulletPhysicsServer3D::shape_set_margin(RID p_shape, real_t p_margin) {
ShapeBullet *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND(!shape);
shape->set_margin(p_margin);
}
-real_t BulletPhysicsServer::shape_get_margin(RID p_shape) const {
+real_t BulletPhysicsServer3D::shape_get_margin(RID p_shape) const {
ShapeBullet *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0.0);
return shape->get_margin();
}
-real_t BulletPhysicsServer::shape_get_custom_solver_bias(RID p_shape) const {
+real_t BulletPhysicsServer3D::shape_get_custom_solver_bias(RID p_shape) const {
//WARN_PRINT("Bias not supported by Bullet physics engine");
return 0.;
}
-RID BulletPhysicsServer::space_create() {
+RID BulletPhysicsServer3D::space_create() {
SpaceBullet *space = bulletnew(SpaceBullet);
CreateThenReturnRID(space_owner, space);
}
-void BulletPhysicsServer::space_set_active(RID p_space, bool p_active) {
+void BulletPhysicsServer3D::space_set_active(RID p_space, bool p_active) {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND(!space);
@@ -195,61 +195,61 @@ void BulletPhysicsServer::space_set_active(RID p_space, bool p_active) {
}
}
-bool BulletPhysicsServer::space_is_active(RID p_space) const {
+bool BulletPhysicsServer3D::space_is_active(RID p_space) const {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, false);
return -1 != active_spaces.find(space);
}
-void BulletPhysicsServer::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) {
+void BulletPhysicsServer3D::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND(!space);
space->set_param(p_param, p_value);
}
-real_t BulletPhysicsServer::space_get_param(RID p_space, SpaceParameter p_param) const {
+real_t BulletPhysicsServer3D::space_get_param(RID p_space, SpaceParameter p_param) const {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, 0);
return space->get_param(p_param);
}
-PhysicsDirectSpaceState *BulletPhysicsServer::space_get_direct_state(RID p_space) {
+PhysicsDirectSpaceState3D *BulletPhysicsServer3D::space_get_direct_state(RID p_space) {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, NULL);
return space->get_direct_state();
}
-void BulletPhysicsServer::space_set_debug_contacts(RID p_space, int p_max_contacts) {
+void BulletPhysicsServer3D::space_set_debug_contacts(RID p_space, int p_max_contacts) {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND(!space);
space->set_debug_contacts(p_max_contacts);
}
-Vector<Vector3> BulletPhysicsServer::space_get_contacts(RID p_space) const {
+Vector<Vector3> BulletPhysicsServer3D::space_get_contacts(RID p_space) const {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, Vector<Vector3>());
return space->get_debug_contacts();
}
-int BulletPhysicsServer::space_get_contact_count(RID p_space) const {
+int BulletPhysicsServer3D::space_get_contact_count(RID p_space) const {
SpaceBullet *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, 0);
return space->get_debug_contact_count();
}
-RID BulletPhysicsServer::area_create() {
+RID BulletPhysicsServer3D::area_create() {
AreaBullet *area = bulletnew(AreaBullet);
area->set_collision_layer(1);
area->set_collision_mask(1);
CreateThenReturnRID(area_owner, area)
}
-void BulletPhysicsServer::area_set_space(RID p_area, RID p_space) {
+void BulletPhysicsServer3D::area_set_space(RID p_area, RID p_space) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
SpaceBullet *space = NULL;
@@ -260,26 +260,26 @@ void BulletPhysicsServer::area_set_space(RID p_area, RID p_space) {
area->set_space(space);
}
-RID BulletPhysicsServer::area_get_space(RID p_area) const {
+RID BulletPhysicsServer3D::area_get_space(RID p_area) const {
AreaBullet *area = area_owner.getornull(p_area);
return area->get_space()->get_self();
}
-void BulletPhysicsServer::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) {
+void BulletPhysicsServer3D::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_spOv_mode(p_mode);
}
-PhysicsServer::AreaSpaceOverrideMode BulletPhysicsServer::area_get_space_override_mode(RID p_area) const {
+PhysicsServer3D::AreaSpaceOverrideMode BulletPhysicsServer3D::area_get_space_override_mode(RID p_area) const {
AreaBullet *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED);
+ ERR_FAIL_COND_V(!area, PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED);
return area->get_spOv_mode();
}
-void BulletPhysicsServer::area_add_shape(RID p_area, RID p_shape, const Transform &p_transform, bool p_disabled) {
+void BulletPhysicsServer3D::area_add_shape(RID p_area, RID p_shape, const Transform &p_transform, bool p_disabled) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -289,7 +289,7 @@ void BulletPhysicsServer::area_add_shape(RID p_area, RID p_shape, const Transfor
area->add_shape(shape, p_transform, p_disabled);
}
-void BulletPhysicsServer::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {
+void BulletPhysicsServer3D::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -299,41 +299,41 @@ void BulletPhysicsServer::area_set_shape(RID p_area, int p_shape_idx, RID p_shap
area->set_shape(p_shape_idx, shape);
}
-void BulletPhysicsServer::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) {
+void BulletPhysicsServer3D::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_shape_transform(p_shape_idx, p_transform);
}
-int BulletPhysicsServer::area_get_shape_count(RID p_area) const {
+int BulletPhysicsServer3D::area_get_shape_count(RID p_area) const {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, 0);
return area->get_shape_count();
}
-RID BulletPhysicsServer::area_get_shape(RID p_area, int p_shape_idx) const {
+RID BulletPhysicsServer3D::area_get_shape(RID p_area, int p_shape_idx) const {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, RID());
return area->get_shape(p_shape_idx)->get_self();
}
-Transform BulletPhysicsServer::area_get_shape_transform(RID p_area, int p_shape_idx) const {
+Transform BulletPhysicsServer3D::area_get_shape_transform(RID p_area, int p_shape_idx) const {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, Transform());
return area->get_shape_transform(p_shape_idx);
}
-void BulletPhysicsServer::area_remove_shape(RID p_area, int p_shape_idx) {
+void BulletPhysicsServer3D::area_remove_shape(RID p_area, int p_shape_idx) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
return area->remove_shape_full(p_shape_idx);
}
-void BulletPhysicsServer::area_clear_shapes(RID p_area) {
+void BulletPhysicsServer3D::area_clear_shapes(RID p_area) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -341,14 +341,14 @@ void BulletPhysicsServer::area_clear_shapes(RID p_area) {
area->remove_shape_full(0);
}
-void BulletPhysicsServer::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) {
+void BulletPhysicsServer3D::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_shape_disabled(p_shape_idx, p_disabled);
}
-void BulletPhysicsServer::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
+void BulletPhysicsServer3D::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
if (space_owner.owns(p_area)) {
return;
}
@@ -357,7 +357,7 @@ void BulletPhysicsServer::area_attach_object_instance_id(RID p_area, ObjectID p_
area->set_instance_id(p_id);
}
-ObjectID BulletPhysicsServer::area_get_object_instance_id(RID p_area) const {
+ObjectID BulletPhysicsServer3D::area_get_object_instance_id(RID p_area) const {
if (space_owner.owns(p_area)) {
return ObjectID();
}
@@ -366,7 +366,7 @@ ObjectID BulletPhysicsServer::area_get_object_instance_id(RID p_area) const {
return area->get_instance_id();
}
-void BulletPhysicsServer::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) {
+void BulletPhysicsServer3D::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) {
if (space_owner.owns(p_area)) {
SpaceBullet *space = space_owner.getornull(p_area);
if (space) {
@@ -381,7 +381,7 @@ void BulletPhysicsServer::area_set_param(RID p_area, AreaParameter p_param, cons
}
}
-Variant BulletPhysicsServer::area_get_param(RID p_area, AreaParameter p_param) const {
+Variant BulletPhysicsServer3D::area_get_param(RID p_area, AreaParameter p_param) const {
if (space_owner.owns(p_area)) {
SpaceBullet *space = space_owner.getornull(p_area);
return space->get_param(p_param);
@@ -393,64 +393,64 @@ Variant BulletPhysicsServer::area_get_param(RID p_area, AreaParameter p_param) c
}
}
-void BulletPhysicsServer::area_set_transform(RID p_area, const Transform &p_transform) {
+void BulletPhysicsServer3D::area_set_transform(RID p_area, const Transform &p_transform) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_transform(p_transform);
}
-Transform BulletPhysicsServer::area_get_transform(RID p_area) const {
+Transform BulletPhysicsServer3D::area_get_transform(RID p_area) const {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, Transform());
return area->get_transform();
}
-void BulletPhysicsServer::area_set_collision_mask(RID p_area, uint32_t p_mask) {
+void BulletPhysicsServer3D::area_set_collision_mask(RID p_area, uint32_t p_mask) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_collision_mask(p_mask);
}
-void BulletPhysicsServer::area_set_collision_layer(RID p_area, uint32_t p_layer) {
+void BulletPhysicsServer3D::area_set_collision_layer(RID p_area, uint32_t p_layer) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_collision_layer(p_layer);
}
-void BulletPhysicsServer::area_set_monitorable(RID p_area, bool p_monitorable) {
+void BulletPhysicsServer3D::area_set_monitorable(RID p_area, bool p_monitorable) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_monitorable(p_monitorable);
}
-void BulletPhysicsServer::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
+void BulletPhysicsServer3D::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_event_callback(CollisionObjectBullet::TYPE_RIGID_BODY, p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
}
-void BulletPhysicsServer::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
+void BulletPhysicsServer3D::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_event_callback(CollisionObjectBullet::TYPE_AREA, p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
}
-void BulletPhysicsServer::area_set_ray_pickable(RID p_area, bool p_enable) {
+void BulletPhysicsServer3D::area_set_ray_pickable(RID p_area, bool p_enable) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_ray_pickable(p_enable);
}
-bool BulletPhysicsServer::area_is_ray_pickable(RID p_area) const {
+bool BulletPhysicsServer3D::area_is_ray_pickable(RID p_area) const {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, false);
return area->is_ray_pickable();
}
-RID BulletPhysicsServer::body_create(BodyMode p_mode, bool p_init_sleeping) {
+RID BulletPhysicsServer3D::body_create(BodyMode p_mode, bool p_init_sleeping) {
RigidBodyBullet *body = bulletnew(RigidBodyBullet);
body->set_mode(p_mode);
body->set_collision_layer(1);
@@ -460,7 +460,7 @@ RID BulletPhysicsServer::body_create(BodyMode p_mode, bool p_init_sleeping) {
CreateThenReturnRID(rigid_body_owner, body);
}
-void BulletPhysicsServer::body_set_space(RID p_body, RID p_space) {
+void BulletPhysicsServer3D::body_set_space(RID p_body, RID p_space) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
SpaceBullet *space = NULL;
@@ -476,7 +476,7 @@ void BulletPhysicsServer::body_set_space(RID p_body, RID p_space) {
body->set_space(space);
}
-RID BulletPhysicsServer::body_get_space(RID p_body) const {
+RID BulletPhysicsServer3D::body_get_space(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, RID());
@@ -486,19 +486,19 @@ RID BulletPhysicsServer::body_get_space(RID p_body) const {
return space->get_self();
}
-void BulletPhysicsServer::body_set_mode(RID p_body, PhysicsServer::BodyMode p_mode) {
+void BulletPhysicsServer3D::body_set_mode(RID p_body, PhysicsServer3D::BodyMode p_mode) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_mode(p_mode);
}
-PhysicsServer::BodyMode BulletPhysicsServer::body_get_mode(RID p_body) const {
+PhysicsServer3D::BodyMode BulletPhysicsServer3D::body_get_mode(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, BODY_MODE_STATIC);
return body->get_mode();
}
-void BulletPhysicsServer::body_add_shape(RID p_body, RID p_shape, const Transform &p_transform, bool p_disabled) {
+void BulletPhysicsServer3D::body_add_shape(RID p_body, RID p_shape, const Transform &p_transform, bool p_disabled) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -509,7 +509,7 @@ void BulletPhysicsServer::body_add_shape(RID p_body, RID p_shape, const Transfor
body->add_shape(shape, p_transform, p_disabled);
}
-void BulletPhysicsServer::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {
+void BulletPhysicsServer3D::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -519,20 +519,20 @@ void BulletPhysicsServer::body_set_shape(RID p_body, int p_shape_idx, RID p_shap
body->set_shape(p_shape_idx, shape);
}
-void BulletPhysicsServer::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) {
+void BulletPhysicsServer3D::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_shape_transform(p_shape_idx, p_transform);
}
-int BulletPhysicsServer::body_get_shape_count(RID p_body) const {
+int BulletPhysicsServer3D::body_get_shape_count(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_shape_count();
}
-RID BulletPhysicsServer::body_get_shape(RID p_body, int p_shape_idx) const {
+RID BulletPhysicsServer3D::body_get_shape(RID p_body, int p_shape_idx) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, RID());
@@ -542,113 +542,113 @@ RID BulletPhysicsServer::body_get_shape(RID p_body, int p_shape_idx) const {
return shape->get_self();
}
-Transform BulletPhysicsServer::body_get_shape_transform(RID p_body, int p_shape_idx) const {
+Transform BulletPhysicsServer3D::body_get_shape_transform(RID p_body, int p_shape_idx) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Transform());
return body->get_shape_transform(p_shape_idx);
}
-void BulletPhysicsServer::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
+void BulletPhysicsServer3D::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_shape_disabled(p_shape_idx, p_disabled);
}
-void BulletPhysicsServer::body_remove_shape(RID p_body, int p_shape_idx) {
+void BulletPhysicsServer3D::body_remove_shape(RID p_body, int p_shape_idx) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->remove_shape_full(p_shape_idx);
}
-void BulletPhysicsServer::body_clear_shapes(RID p_body) {
+void BulletPhysicsServer3D::body_clear_shapes(RID p_body) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->remove_all_shapes();
}
-void BulletPhysicsServer::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
+void BulletPhysicsServer3D::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
CollisionObjectBullet *body = get_collisin_object(p_body);
ERR_FAIL_COND(!body);
body->set_instance_id(p_id);
}
-ObjectID BulletPhysicsServer::body_get_object_instance_id(RID p_body) const {
+ObjectID BulletPhysicsServer3D::body_get_object_instance_id(RID p_body) const {
CollisionObjectBullet *body = get_collisin_object(p_body);
ERR_FAIL_COND_V(!body, ObjectID());
return body->get_instance_id();
}
-void BulletPhysicsServer::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) {
+void BulletPhysicsServer3D::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_continuous_collision_detection(p_enable);
}
-bool BulletPhysicsServer::body_is_continuous_collision_detection_enabled(RID p_body) const {
+bool BulletPhysicsServer3D::body_is_continuous_collision_detection_enabled(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
return body->is_continuous_collision_detection_enabled();
}
-void BulletPhysicsServer::body_set_collision_layer(RID p_body, uint32_t p_layer) {
+void BulletPhysicsServer3D::body_set_collision_layer(RID p_body, uint32_t p_layer) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_collision_layer(p_layer);
}
-uint32_t BulletPhysicsServer::body_get_collision_layer(RID p_body) const {
+uint32_t BulletPhysicsServer3D::body_get_collision_layer(RID p_body) const {
const RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_collision_layer();
}
-void BulletPhysicsServer::body_set_collision_mask(RID p_body, uint32_t p_mask) {
+void BulletPhysicsServer3D::body_set_collision_mask(RID p_body, uint32_t p_mask) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_collision_mask(p_mask);
}
-uint32_t BulletPhysicsServer::body_get_collision_mask(RID p_body) const {
+uint32_t BulletPhysicsServer3D::body_get_collision_mask(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_collision_mask();
}
-void BulletPhysicsServer::body_set_user_flags(RID p_body, uint32_t p_flags) {
+void BulletPhysicsServer3D::body_set_user_flags(RID p_body, uint32_t p_flags) {
// This function si not currently supported
}
-uint32_t BulletPhysicsServer::body_get_user_flags(RID p_body) const {
+uint32_t BulletPhysicsServer3D::body_get_user_flags(RID p_body) const {
// This function si not currently supported
return 0;
}
-void BulletPhysicsServer::body_set_param(RID p_body, BodyParameter p_param, float p_value) {
+void BulletPhysicsServer3D::body_set_param(RID p_body, BodyParameter p_param, float p_value) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_param(p_param, p_value);
}
-float BulletPhysicsServer::body_get_param(RID p_body, BodyParameter p_param) const {
+float BulletPhysicsServer3D::body_get_param(RID p_body, BodyParameter p_param) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_param(p_param);
}
-void BulletPhysicsServer::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) {
+void BulletPhysicsServer3D::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -658,7 +658,7 @@ void BulletPhysicsServer::body_set_kinematic_safe_margin(RID p_body, real_t p_ma
}
}
-real_t BulletPhysicsServer::body_get_kinematic_safe_margin(RID p_body) const {
+real_t BulletPhysicsServer3D::body_get_kinematic_safe_margin(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -670,90 +670,90 @@ real_t BulletPhysicsServer::body_get_kinematic_safe_margin(RID p_body) const {
return 0;
}
-void BulletPhysicsServer::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
+void BulletPhysicsServer3D::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_state(p_state, p_variant);
}
-Variant BulletPhysicsServer::body_get_state(RID p_body, BodyState p_state) const {
+Variant BulletPhysicsServer3D::body_get_state(RID p_body, BodyState p_state) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Variant());
return body->get_state(p_state);
}
-void BulletPhysicsServer::body_set_applied_force(RID p_body, const Vector3 &p_force) {
+void BulletPhysicsServer3D::body_set_applied_force(RID p_body, const Vector3 &p_force) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_applied_force(p_force);
}
-Vector3 BulletPhysicsServer::body_get_applied_force(RID p_body) const {
+Vector3 BulletPhysicsServer3D::body_get_applied_force(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Vector3());
return body->get_applied_force();
}
-void BulletPhysicsServer::body_set_applied_torque(RID p_body, const Vector3 &p_torque) {
+void BulletPhysicsServer3D::body_set_applied_torque(RID p_body, const Vector3 &p_torque) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_applied_torque(p_torque);
}
-Vector3 BulletPhysicsServer::body_get_applied_torque(RID p_body) const {
+Vector3 BulletPhysicsServer3D::body_get_applied_torque(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Vector3());
return body->get_applied_torque();
}
-void BulletPhysicsServer::body_add_central_force(RID p_body, const Vector3 &p_force) {
+void BulletPhysicsServer3D::body_add_central_force(RID p_body, const Vector3 &p_force) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->apply_central_force(p_force);
}
-void BulletPhysicsServer::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) {
+void BulletPhysicsServer3D::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->apply_force(p_force, p_pos);
}
-void BulletPhysicsServer::body_add_torque(RID p_body, const Vector3 &p_torque) {
+void BulletPhysicsServer3D::body_add_torque(RID p_body, const Vector3 &p_torque) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->apply_torque(p_torque);
}
-void BulletPhysicsServer::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) {
+void BulletPhysicsServer3D::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->apply_central_impulse(p_impulse);
}
-void BulletPhysicsServer::body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) {
+void BulletPhysicsServer3D::body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->apply_impulse(p_pos, p_impulse);
}
-void BulletPhysicsServer::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) {
+void BulletPhysicsServer3D::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->apply_torque_impulse(p_impulse);
}
-void BulletPhysicsServer::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) {
+void BulletPhysicsServer3D::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -764,19 +764,19 @@ void BulletPhysicsServer::body_set_axis_velocity(RID p_body, const Vector3 &p_ax
body->set_linear_velocity(v);
}
-void BulletPhysicsServer::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) {
+void BulletPhysicsServer3D::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_axis_lock(p_axis, p_lock);
}
-bool BulletPhysicsServer::body_is_axis_locked(RID p_body, BodyAxis p_axis) const {
+bool BulletPhysicsServer3D::body_is_axis_locked(RID p_body, BodyAxis p_axis) const {
const RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->is_axis_locked(p_axis);
}
-void BulletPhysicsServer::body_add_collision_exception(RID p_body, RID p_body_b) {
+void BulletPhysicsServer3D::body_add_collision_exception(RID p_body, RID p_body_b) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -786,7 +786,7 @@ void BulletPhysicsServer::body_add_collision_exception(RID p_body, RID p_body_b)
body->add_collision_exception(other_body);
}
-void BulletPhysicsServer::body_remove_collision_exception(RID p_body, RID p_body_b) {
+void BulletPhysicsServer3D::body_remove_collision_exception(RID p_body, RID p_body_b) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -796,7 +796,7 @@ void BulletPhysicsServer::body_remove_collision_exception(RID p_body, RID p_body
body->remove_collision_exception(other_body);
}
-void BulletPhysicsServer::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
+void BulletPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
for (int i = 0; i < body->get_exceptions().size(); i++) {
@@ -804,68 +804,68 @@ void BulletPhysicsServer::body_get_collision_exceptions(RID p_body, List<RID> *p
}
}
-void BulletPhysicsServer::body_set_max_contacts_reported(RID p_body, int p_contacts) {
+void BulletPhysicsServer3D::body_set_max_contacts_reported(RID p_body, int p_contacts) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_max_collisions_detection(p_contacts);
}
-int BulletPhysicsServer::body_get_max_contacts_reported(RID p_body) const {
+int BulletPhysicsServer3D::body_get_max_contacts_reported(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_max_collisions_detection();
}
-void BulletPhysicsServer::body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) {
+void BulletPhysicsServer3D::body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) {
// Not supported by bullet and even Godot
}
-float BulletPhysicsServer::body_get_contacts_reported_depth_threshold(RID p_body) const {
+float BulletPhysicsServer3D::body_get_contacts_reported_depth_threshold(RID p_body) const {
// Not supported by bullet and even Godot
return 0.;
}
-void BulletPhysicsServer::body_set_omit_force_integration(RID p_body, bool p_omit) {
+void BulletPhysicsServer3D::body_set_omit_force_integration(RID p_body, bool p_omit) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_omit_forces_integration(p_omit);
}
-bool BulletPhysicsServer::body_is_omitting_force_integration(RID p_body) const {
+bool BulletPhysicsServer3D::body_is_omitting_force_integration(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
return body->get_omit_forces_integration();
}
-void BulletPhysicsServer::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
+void BulletPhysicsServer3D::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method, p_udata);
}
-void BulletPhysicsServer::body_set_ray_pickable(RID p_body, bool p_enable) {
+void BulletPhysicsServer3D::body_set_ray_pickable(RID p_body, bool p_enable) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_ray_pickable(p_enable);
}
-bool BulletPhysicsServer::body_is_ray_pickable(RID p_body) const {
+bool BulletPhysicsServer3D::body_is_ray_pickable(RID p_body) const {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
return body->is_ray_pickable();
}
-PhysicsDirectBodyState *BulletPhysicsServer::body_get_direct_state(RID p_body) {
+PhysicsDirectBodyState3D *BulletPhysicsServer3D::body_get_direct_state(RID p_body) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, NULL);
return BulletPhysicsDirectBodyState::get_singleton(body);
}
-bool BulletPhysicsServer::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes) {
+bool BulletPhysicsServer3D::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
ERR_FAIL_COND_V(!body->get_space(), false);
@@ -873,7 +873,7 @@ bool BulletPhysicsServer::body_test_motion(RID p_body, const Transform &p_from,
return body->get_space()->test_body_motion(body, p_from, p_motion, p_infinite_inertia, r_result, p_exclude_raycast_shapes);
}
-int BulletPhysicsServer::body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) {
+int BulletPhysicsServer3D::body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) {
RigidBodyBullet *body = rigid_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
ERR_FAIL_COND_V(!body->get_space(), 0);
@@ -881,7 +881,7 @@ int BulletPhysicsServer::body_test_ray_separation(RID p_body, const Transform &p
return body->get_space()->test_ray_separation(body, p_transform, p_infinite_inertia, r_recover_motion, r_results, p_result_max, p_margin);
}
-RID BulletPhysicsServer::soft_body_create(bool p_init_sleeping) {
+RID BulletPhysicsServer3D::soft_body_create(bool p_init_sleeping) {
SoftBodyBullet *body = bulletnew(SoftBodyBullet);
body->set_collision_layer(1);
body->set_collision_mask(1);
@@ -890,14 +890,14 @@ RID BulletPhysicsServer::soft_body_create(bool p_init_sleeping) {
CreateThenReturnRID(soft_body_owner, body);
}
-void BulletPhysicsServer::soft_body_update_visual_server(RID p_body, class SoftBodyVisualServerHandler *p_visual_server_handler) {
+void BulletPhysicsServer3D::soft_body_update_rendering_server(RID p_body, class SoftBodyRenderingServerHandler *p_rendering_server_handler) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
- body->update_visual_server(p_visual_server_handler);
+ body->update_rendering_server(p_rendering_server_handler);
}
-void BulletPhysicsServer::soft_body_set_space(RID p_body, RID p_space) {
+void BulletPhysicsServer3D::soft_body_set_space(RID p_body, RID p_space) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
SpaceBullet *space = NULL;
@@ -913,7 +913,7 @@ void BulletPhysicsServer::soft_body_set_space(RID p_body, RID p_space) {
body->set_space(space);
}
-RID BulletPhysicsServer::soft_body_get_space(RID p_body) const {
+RID BulletPhysicsServer3D::soft_body_get_space(RID p_body) const {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, RID());
@@ -923,42 +923,42 @@ RID BulletPhysicsServer::soft_body_get_space(RID p_body) const {
return space->get_self();
}
-void BulletPhysicsServer::soft_body_set_mesh(RID p_body, const REF &p_mesh) {
+void BulletPhysicsServer3D::soft_body_set_mesh(RID p_body, const REF &p_mesh) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_soft_mesh(p_mesh);
}
-void BulletPhysicsServer::soft_body_set_collision_layer(RID p_body, uint32_t p_layer) {
+void BulletPhysicsServer3D::soft_body_set_collision_layer(RID p_body, uint32_t p_layer) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_collision_layer(p_layer);
}
-uint32_t BulletPhysicsServer::soft_body_get_collision_layer(RID p_body) const {
+uint32_t BulletPhysicsServer3D::soft_body_get_collision_layer(RID p_body) const {
const SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_collision_layer();
}
-void BulletPhysicsServer::soft_body_set_collision_mask(RID p_body, uint32_t p_mask) {
+void BulletPhysicsServer3D::soft_body_set_collision_mask(RID p_body, uint32_t p_mask) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_collision_mask(p_mask);
}
-uint32_t BulletPhysicsServer::soft_body_get_collision_mask(RID p_body) const {
+uint32_t BulletPhysicsServer3D::soft_body_get_collision_mask(RID p_body) const {
const SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return body->get_collision_mask();
}
-void BulletPhysicsServer::soft_body_add_collision_exception(RID p_body, RID p_body_b) {
+void BulletPhysicsServer3D::soft_body_add_collision_exception(RID p_body, RID p_body_b) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -971,7 +971,7 @@ void BulletPhysicsServer::soft_body_add_collision_exception(RID p_body, RID p_bo
body->add_collision_exception(other_body);
}
-void BulletPhysicsServer::soft_body_remove_collision_exception(RID p_body, RID p_body_b) {
+void BulletPhysicsServer3D::soft_body_remove_collision_exception(RID p_body, RID p_body_b) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -984,7 +984,7 @@ void BulletPhysicsServer::soft_body_remove_collision_exception(RID p_body, RID p
body->remove_collision_exception(other_body);
}
-void BulletPhysicsServer::soft_body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
+void BulletPhysicsServer3D::soft_body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
for (int i = 0; i < body->get_exceptions().size(); i++) {
@@ -992,25 +992,25 @@ void BulletPhysicsServer::soft_body_get_collision_exceptions(RID p_body, List<RI
}
}
-void BulletPhysicsServer::soft_body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
+void BulletPhysicsServer3D::soft_body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
// FIXME: Must be implemented.
WARN_PRINT("soft_body_state is not implemented yet in Bullet backend.");
}
-Variant BulletPhysicsServer::soft_body_get_state(RID p_body, BodyState p_state) const {
+Variant BulletPhysicsServer3D::soft_body_get_state(RID p_body, BodyState p_state) const {
// FIXME: Must be implemented.
WARN_PRINT("soft_body_state is not implemented yet in Bullet backend.");
return Variant();
}
-void BulletPhysicsServer::soft_body_set_transform(RID p_body, const Transform &p_transform) {
+void BulletPhysicsServer3D::soft_body_set_transform(RID p_body, const Transform &p_transform) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_soft_transform(p_transform);
}
-Vector3 BulletPhysicsServer::soft_body_get_vertex_position(RID p_body, int vertex_index) const {
+Vector3 BulletPhysicsServer3D::soft_body_get_vertex_position(RID p_body, int vertex_index) const {
const SoftBodyBullet *body = soft_body_owner.getornull(p_body);
Vector3 pos;
ERR_FAIL_COND_V(!body, pos);
@@ -1019,133 +1019,133 @@ Vector3 BulletPhysicsServer::soft_body_get_vertex_position(RID p_body, int verte
return pos;
}
-void BulletPhysicsServer::soft_body_set_ray_pickable(RID p_body, bool p_enable) {
+void BulletPhysicsServer3D::soft_body_set_ray_pickable(RID p_body, bool p_enable) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_ray_pickable(p_enable);
}
-bool BulletPhysicsServer::soft_body_is_ray_pickable(RID p_body) const {
+bool BulletPhysicsServer3D::soft_body_is_ray_pickable(RID p_body) const {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
return body->is_ray_pickable();
}
-void BulletPhysicsServer::soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) {
+void BulletPhysicsServer3D::soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_simulation_precision(p_simulation_precision);
}
-int BulletPhysicsServer::soft_body_get_simulation_precision(RID p_body) {
+int BulletPhysicsServer3D::soft_body_get_simulation_precision(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_simulation_precision();
}
-void BulletPhysicsServer::soft_body_set_total_mass(RID p_body, real_t p_total_mass) {
+void BulletPhysicsServer3D::soft_body_set_total_mass(RID p_body, real_t p_total_mass) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_total_mass(p_total_mass);
}
-real_t BulletPhysicsServer::soft_body_get_total_mass(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_total_mass(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_total_mass();
}
-void BulletPhysicsServer::soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) {
+void BulletPhysicsServer3D::soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_linear_stiffness(p_stiffness);
}
-real_t BulletPhysicsServer::soft_body_get_linear_stiffness(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_linear_stiffness(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_linear_stiffness();
}
-void BulletPhysicsServer::soft_body_set_areaAngular_stiffness(RID p_body, real_t p_stiffness) {
+void BulletPhysicsServer3D::soft_body_set_areaAngular_stiffness(RID p_body, real_t p_stiffness) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_areaAngular_stiffness(p_stiffness);
}
-real_t BulletPhysicsServer::soft_body_get_areaAngular_stiffness(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_areaAngular_stiffness(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_areaAngular_stiffness();
}
-void BulletPhysicsServer::soft_body_set_volume_stiffness(RID p_body, real_t p_stiffness) {
+void BulletPhysicsServer3D::soft_body_set_volume_stiffness(RID p_body, real_t p_stiffness) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_volume_stiffness(p_stiffness);
}
-real_t BulletPhysicsServer::soft_body_get_volume_stiffness(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_volume_stiffness(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_volume_stiffness();
}
-void BulletPhysicsServer::soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) {
+void BulletPhysicsServer3D::soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_pressure_coefficient(p_pressure_coefficient);
}
-real_t BulletPhysicsServer::soft_body_get_pressure_coefficient(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_pressure_coefficient(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_pressure_coefficient();
}
-void BulletPhysicsServer::soft_body_set_pose_matching_coefficient(RID p_body, real_t p_pose_matching_coefficient) {
+void BulletPhysicsServer3D::soft_body_set_pose_matching_coefficient(RID p_body, real_t p_pose_matching_coefficient) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
return body->set_pose_matching_coefficient(p_pose_matching_coefficient);
}
-real_t BulletPhysicsServer::soft_body_get_pose_matching_coefficient(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_pose_matching_coefficient(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_pose_matching_coefficient();
}
-void BulletPhysicsServer::soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) {
+void BulletPhysicsServer3D::soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_damping_coefficient(p_damping_coefficient);
}
-real_t BulletPhysicsServer::soft_body_get_damping_coefficient(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_damping_coefficient(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_damping_coefficient();
}
-void BulletPhysicsServer::soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) {
+void BulletPhysicsServer3D::soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_drag_coefficient(p_drag_coefficient);
}
-real_t BulletPhysicsServer::soft_body_get_drag_coefficient(RID p_body) {
+real_t BulletPhysicsServer3D::soft_body_get_drag_coefficient(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_drag_coefficient();
}
-void BulletPhysicsServer::soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) {
+void BulletPhysicsServer3D::soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_node_position(p_point_index, p_global_position);
}
-Vector3 BulletPhysicsServer::soft_body_get_point_global_position(RID p_body, int p_point_index) {
+Vector3 BulletPhysicsServer3D::soft_body_get_point_global_position(RID p_body, int p_point_index) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Vector3(0., 0., 0.));
Vector3 pos;
@@ -1153,7 +1153,7 @@ Vector3 BulletPhysicsServer::soft_body_get_point_global_position(RID p_body, int
return pos;
}
-Vector3 BulletPhysicsServer::soft_body_get_point_offset(RID p_body, int p_point_index) const {
+Vector3 BulletPhysicsServer3D::soft_body_get_point_offset(RID p_body, int p_point_index) const {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Vector3());
Vector3 res;
@@ -1161,54 +1161,54 @@ Vector3 BulletPhysicsServer::soft_body_get_point_offset(RID p_body, int p_point_
return res;
}
-void BulletPhysicsServer::soft_body_remove_all_pinned_points(RID p_body) {
+void BulletPhysicsServer3D::soft_body_remove_all_pinned_points(RID p_body) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->reset_all_node_mass();
}
-void BulletPhysicsServer::soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) {
+void BulletPhysicsServer3D::soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_node_mass(p_point_index, p_pin ? 0 : 1);
}
-bool BulletPhysicsServer::soft_body_is_point_pinned(RID p_body, int p_point_index) {
+bool BulletPhysicsServer3D::soft_body_is_point_pinned(RID p_body, int p_point_index) {
SoftBodyBullet *body = soft_body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0.f);
return body->get_node_mass(p_point_index);
}
-PhysicsServer::JointType BulletPhysicsServer::joint_get_type(RID p_joint) const {
+PhysicsServer3D::JointType BulletPhysicsServer3D::joint_get_type(RID p_joint) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, JOINT_PIN);
return joint->get_type();
}
-void BulletPhysicsServer::joint_set_solver_priority(RID p_joint, int p_priority) {
+void BulletPhysicsServer3D::joint_set_solver_priority(RID p_joint, int p_priority) {
// Joint priority not supported by bullet
}
-int BulletPhysicsServer::joint_get_solver_priority(RID p_joint) const {
+int BulletPhysicsServer3D::joint_get_solver_priority(RID p_joint) const {
// Joint priority not supported by bullet
return 0;
}
-void BulletPhysicsServer::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) {
+void BulletPhysicsServer3D::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
joint->disable_collisions_between_bodies(p_disable);
}
-bool BulletPhysicsServer::joint_is_disabled_collisions_between_bodies(RID p_joint) const {
+bool BulletPhysicsServer3D::joint_is_disabled_collisions_between_bodies(RID p_joint) const {
JointBullet *joint(joint_owner.getornull(p_joint));
ERR_FAIL_COND_V(!joint, false);
return joint->is_disabled_collisions_between_bodies();
}
-RID BulletPhysicsServer::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) {
+RID BulletPhysicsServer3D::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) {
RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A);
ERR_FAIL_COND_V(!body_A, RID());
@@ -1229,7 +1229,7 @@ RID BulletPhysicsServer::joint_create_pin(RID p_body_A, const Vector3 &p_local_A
CreateThenReturnRID(joint_owner, joint);
}
-void BulletPhysicsServer::pin_joint_set_param(RID p_joint, PinJointParam p_param, float p_value) {
+void BulletPhysicsServer3D::pin_joint_set_param(RID p_joint, PinJointParam p_param, float p_value) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
@@ -1237,7 +1237,7 @@ void BulletPhysicsServer::pin_joint_set_param(RID p_joint, PinJointParam p_param
pin_joint->set_param(p_param, p_value);
}
-float BulletPhysicsServer::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
+float BulletPhysicsServer3D::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, 0);
ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, 0);
@@ -1245,7 +1245,7 @@ float BulletPhysicsServer::pin_joint_get_param(RID p_joint, PinJointParam p_para
return pin_joint->get_param(p_param);
}
-void BulletPhysicsServer::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) {
+void BulletPhysicsServer3D::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
@@ -1253,7 +1253,7 @@ void BulletPhysicsServer::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A)
pin_joint->setPivotInA(p_A);
}
-Vector3 BulletPhysicsServer::pin_joint_get_local_a(RID p_joint) const {
+Vector3 BulletPhysicsServer3D::pin_joint_get_local_a(RID p_joint) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, Vector3());
ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
@@ -1261,7 +1261,7 @@ Vector3 BulletPhysicsServer::pin_joint_get_local_a(RID p_joint) const {
return pin_joint->getPivotInA();
}
-void BulletPhysicsServer::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) {
+void BulletPhysicsServer3D::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
@@ -1269,7 +1269,7 @@ void BulletPhysicsServer::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B)
pin_joint->setPivotInB(p_B);
}
-Vector3 BulletPhysicsServer::pin_joint_get_local_b(RID p_joint) const {
+Vector3 BulletPhysicsServer3D::pin_joint_get_local_b(RID p_joint) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, Vector3());
ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
@@ -1277,7 +1277,7 @@ Vector3 BulletPhysicsServer::pin_joint_get_local_b(RID p_joint) const {
return pin_joint->getPivotInB();
}
-RID BulletPhysicsServer::joint_create_hinge(RID p_body_A, const Transform &p_hinge_A, RID p_body_B, const Transform &p_hinge_B) {
+RID BulletPhysicsServer3D::joint_create_hinge(RID p_body_A, const Transform &p_hinge_A, RID p_body_B, const Transform &p_hinge_B) {
RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A);
ERR_FAIL_COND_V(!body_A, RID());
JointAssertSpace(body_A, "A", RID());
@@ -1297,7 +1297,7 @@ RID BulletPhysicsServer::joint_create_hinge(RID p_body_A, const Transform &p_hin
CreateThenReturnRID(joint_owner, joint);
}
-RID BulletPhysicsServer::joint_create_hinge_simple(RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) {
+RID BulletPhysicsServer3D::joint_create_hinge_simple(RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) {
RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A);
ERR_FAIL_COND_V(!body_A, RID());
JointAssertSpace(body_A, "A", RID());
@@ -1317,7 +1317,7 @@ RID BulletPhysicsServer::joint_create_hinge_simple(RID p_body_A, const Vector3 &
CreateThenReturnRID(joint_owner, joint);
}
-void BulletPhysicsServer::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, float p_value) {
+void BulletPhysicsServer3D::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, float p_value) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_HINGE);
@@ -1325,7 +1325,7 @@ void BulletPhysicsServer::hinge_joint_set_param(RID p_joint, HingeJointParam p_p
hinge_joint->set_param(p_param, p_value);
}
-float BulletPhysicsServer::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const {
+float BulletPhysicsServer3D::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, 0);
ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, 0);
@@ -1333,7 +1333,7 @@ float BulletPhysicsServer::hinge_joint_get_param(RID p_joint, HingeJointParam p_
return hinge_joint->get_param(p_param);
}
-void BulletPhysicsServer::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) {
+void BulletPhysicsServer3D::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_HINGE);
@@ -1341,7 +1341,7 @@ void BulletPhysicsServer::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_fla
hinge_joint->set_flag(p_flag, p_value);
}
-bool BulletPhysicsServer::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const {
+bool BulletPhysicsServer3D::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, false);
ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, false);
@@ -1349,7 +1349,7 @@ bool BulletPhysicsServer::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_fla
return hinge_joint->get_flag(p_flag);
}
-RID BulletPhysicsServer::joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
+RID BulletPhysicsServer3D::joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A);
ERR_FAIL_COND_V(!body_A, RID());
JointAssertSpace(body_A, "A", RID());
@@ -1369,7 +1369,7 @@ RID BulletPhysicsServer::joint_create_slider(RID p_body_A, const Transform &p_lo
CreateThenReturnRID(joint_owner, joint);
}
-void BulletPhysicsServer::slider_joint_set_param(RID p_joint, SliderJointParam p_param, float p_value) {
+void BulletPhysicsServer3D::slider_joint_set_param(RID p_joint, SliderJointParam p_param, float p_value) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_SLIDER);
@@ -1377,7 +1377,7 @@ void BulletPhysicsServer::slider_joint_set_param(RID p_joint, SliderJointParam p
slider_joint->set_param(p_param, p_value);
}
-float BulletPhysicsServer::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const {
+float BulletPhysicsServer3D::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, 0);
ERR_FAIL_COND_V(joint->get_type() != JOINT_SLIDER, 0);
@@ -1385,7 +1385,7 @@ float BulletPhysicsServer::slider_joint_get_param(RID p_joint, SliderJointParam
return slider_joint->get_param(p_param);
}
-RID BulletPhysicsServer::joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
+RID BulletPhysicsServer3D::joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A);
ERR_FAIL_COND_V(!body_A, RID());
JointAssertSpace(body_A, "A", RID());
@@ -1403,7 +1403,7 @@ RID BulletPhysicsServer::joint_create_cone_twist(RID p_body_A, const Transform &
CreateThenReturnRID(joint_owner, joint);
}
-void BulletPhysicsServer::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, float p_value) {
+void BulletPhysicsServer3D::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, float p_value) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_CONE_TWIST);
@@ -1411,7 +1411,7 @@ void BulletPhysicsServer::cone_twist_joint_set_param(RID p_joint, ConeTwistJoint
coneTwist_joint->set_param(p_param, p_value);
}
-float BulletPhysicsServer::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const {
+float BulletPhysicsServer3D::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, 0.);
ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0.);
@@ -1419,7 +1419,7 @@ float BulletPhysicsServer::cone_twist_joint_get_param(RID p_joint, ConeTwistJoin
return coneTwist_joint->get_param(p_param);
}
-RID BulletPhysicsServer::joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
+RID BulletPhysicsServer3D::joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A);
ERR_FAIL_COND_V(!body_A, RID());
JointAssertSpace(body_A, "A", RID());
@@ -1439,7 +1439,7 @@ RID BulletPhysicsServer::joint_create_generic_6dof(RID p_body_A, const Transform
CreateThenReturnRID(joint_owner, joint);
}
-void BulletPhysicsServer::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, float p_value) {
+void BulletPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, float p_value) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
@@ -1447,7 +1447,7 @@ void BulletPhysicsServer::generic_6dof_joint_set_param(RID p_joint, Vector3::Axi
generic_6dof_joint->set_param(p_axis, p_param, p_value);
}
-float BulletPhysicsServer::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) {
+float BulletPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, 0);
ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0);
@@ -1455,7 +1455,7 @@ float BulletPhysicsServer::generic_6dof_joint_get_param(RID p_joint, Vector3::Ax
return generic_6dof_joint->get_param(p_axis, p_param);
}
-void BulletPhysicsServer::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) {
+void BulletPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
@@ -1463,7 +1463,7 @@ void BulletPhysicsServer::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis
generic_6dof_joint->set_flag(p_axis, p_flag, p_enable);
}
-bool BulletPhysicsServer::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) {
+bool BulletPhysicsServer3D::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, false);
ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, false);
@@ -1471,7 +1471,7 @@ bool BulletPhysicsServer::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis
return generic_6dof_joint->get_flag(p_axis, p_flag);
}
-void BulletPhysicsServer::generic_6dof_joint_set_precision(RID p_joint, int p_precision) {
+void BulletPhysicsServer3D::generic_6dof_joint_set_precision(RID p_joint, int p_precision) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
@@ -1479,7 +1479,7 @@ void BulletPhysicsServer::generic_6dof_joint_set_precision(RID p_joint, int p_pr
generic_6dof_joint->set_precision(p_precision);
}
-int BulletPhysicsServer::generic_6dof_joint_get_precision(RID p_joint) {
+int BulletPhysicsServer3D::generic_6dof_joint_get_precision(RID p_joint) {
JointBullet *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, 0);
ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0);
@@ -1487,7 +1487,7 @@ int BulletPhysicsServer::generic_6dof_joint_get_precision(RID p_joint) {
return generic_6dof_joint->get_precision();
}
-void BulletPhysicsServer::free(RID p_rid) {
+void BulletPhysicsServer3D::free(RID p_rid) {
if (shape_owner.owns(p_rid)) {
ShapeBullet *shape = shape_owner.getornull(p_rid);
@@ -1552,11 +1552,11 @@ void BulletPhysicsServer::free(RID p_rid) {
}
}
-void BulletPhysicsServer::init() {
+void BulletPhysicsServer3D::init() {
BulletPhysicsDirectBodyState::initSingleton();
}
-void BulletPhysicsServer::step(float p_deltaTime) {
+void BulletPhysicsServer3D::step(float p_deltaTime) {
if (!active)
return;
@@ -1568,21 +1568,21 @@ void BulletPhysicsServer::step(float p_deltaTime) {
}
}
-void BulletPhysicsServer::sync() {
+void BulletPhysicsServer3D::sync() {
}
-void BulletPhysicsServer::flush_queries() {
+void BulletPhysicsServer3D::flush_queries() {
}
-void BulletPhysicsServer::finish() {
+void BulletPhysicsServer3D::finish() {
BulletPhysicsDirectBodyState::destroySingleton();
}
-int BulletPhysicsServer::get_process_info(ProcessInfo p_info) {
+int BulletPhysicsServer3D::get_process_info(ProcessInfo p_info) {
return 0;
}
-CollisionObjectBullet *BulletPhysicsServer::get_collisin_object(RID p_object) const {
+CollisionObjectBullet *BulletPhysicsServer3D::get_collisin_object(RID p_object) const {
if (rigid_body_owner.owns(p_object)) {
return rigid_body_owner.getornull(p_object);
}
@@ -1595,7 +1595,7 @@ CollisionObjectBullet *BulletPhysicsServer::get_collisin_object(RID p_object) co
return NULL;
}
-RigidCollisionObjectBullet *BulletPhysicsServer::get_rigid_collisin_object(RID p_object) const {
+RigidCollisionObjectBullet *BulletPhysicsServer3D::get_rigid_collisin_object(RID p_object) const {
if (rigid_body_owner.owns(p_object)) {
return rigid_body_owner.getornull(p_object);
}
diff --git a/modules/bullet/bullet_physics_server.h b/modules/bullet/bullet_physics_server.h
index 6ea9a7a974..1269dac78b 100644
--- a/modules/bullet/bullet_physics_server.h
+++ b/modules/bullet/bullet_physics_server.h
@@ -36,7 +36,7 @@
#include "core/rid_owner.h"
#include "joint_bullet.h"
#include "rigid_body_bullet.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include "shape_bullet.h"
#include "soft_body_bullet.h"
#include "space_bullet.h"
@@ -44,8 +44,8 @@
@author AndreaCatania
*/
-class BulletPhysicsServer : public PhysicsServer {
- GDCLASS(BulletPhysicsServer, PhysicsServer);
+class BulletPhysicsServer3D : public PhysicsServer3D {
+ GDCLASS(BulletPhysicsServer3D, PhysicsServer3D);
friend class BulletPhysicsDirectSpaceState;
@@ -64,8 +64,8 @@ protected:
static void _bind_methods();
public:
- BulletPhysicsServer();
- ~BulletPhysicsServer();
+ BulletPhysicsServer3D();
+ ~BulletPhysicsServer3D();
_FORCE_INLINE_ RID_PtrOwner<SpaceBullet> *get_space_owner() {
return &space_owner;
@@ -111,7 +111,7 @@ public:
/// Not supported
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const;
- virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space);
+ virtual PhysicsDirectSpaceState3D *space_get_direct_state(RID p_space);
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts);
virtual Vector<Vector3> space_get_contacts(RID p_space) const;
@@ -252,7 +252,7 @@ public:
virtual bool body_is_ray_pickable(RID p_body) const;
// this function only works on physics process, errors and returns null otherwise
- virtual PhysicsDirectBodyState *body_get_direct_state(RID p_body);
+ virtual PhysicsDirectBodyState3D *body_get_direct_state(RID p_body);
virtual bool body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result = NULL, bool p_exclude_raycast_shapes = true);
virtual int body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin = 0.001);
@@ -261,7 +261,7 @@ public:
virtual RID soft_body_create(bool p_init_sleeping = false);
- virtual void soft_body_update_visual_server(RID p_body, class SoftBodyVisualServerHandler *p_visual_server_handler);
+ virtual void soft_body_update_rendering_server(RID p_body, class SoftBodyRenderingServerHandler *p_rendering_server_handler);
virtual void soft_body_set_space(RID p_body, RID p_space);
virtual RID soft_body_get_space(RID p_body) const;
@@ -387,7 +387,7 @@ public:
}
static bool singleton_isActive() {
- return static_cast<BulletPhysicsServer *>(get_singleton())->active;
+ return static_cast<BulletPhysicsServer3D *>(get_singleton())->active;
}
bool isActive() {
diff --git a/modules/bullet/collision_object_bullet.cpp b/modules/bullet/collision_object_bullet.cpp
index 5b7e7281e4..0ce57811d7 100644
--- a/modules/bullet/collision_object_bullet.cpp
+++ b/modules/bullet/collision_object_bullet.cpp
@@ -60,7 +60,7 @@ void CollisionObjectBullet::ShapeWrapper::set_transform(const btTransform &p_tra
}
btTransform CollisionObjectBullet::ShapeWrapper::get_adjusted_transform() const {
- if (shape->get_type() == PhysicsServer::SHAPE_HEIGHTMAP) {
+ if (shape->get_type() == PhysicsServer3D::SHAPE_HEIGHTMAP) {
const HeightMapShapeBullet *hm_shape = (const HeightMapShapeBullet *)shape; // should be safe to cast now
btTransform adjusted_transform;
diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp
index 23eb39fe7e..aac51034b8 100644
--- a/modules/bullet/cone_twist_joint_bullet.cpp
+++ b/modules/bullet/cone_twist_joint_bullet.cpp
@@ -64,43 +64,43 @@ ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet
setup(coneConstraint);
}
-void ConeTwistJointBullet::set_param(PhysicsServer::ConeTwistJointParam p_param, real_t p_value) {
+void ConeTwistJointBullet::set_param(PhysicsServer3D::ConeTwistJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN:
+ case PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN:
coneConstraint->setLimit(5, p_value);
coneConstraint->setLimit(4, p_value);
break;
- case PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN:
+ case PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN:
coneConstraint->setLimit(3, p_value);
break;
- case PhysicsServer::CONE_TWIST_JOINT_BIAS:
+ case PhysicsServer3D::CONE_TWIST_JOINT_BIAS:
coneConstraint->setLimit(coneConstraint->getSwingSpan1(), coneConstraint->getSwingSpan2(), coneConstraint->getTwistSpan(), coneConstraint->getLimitSoftness(), p_value, coneConstraint->getRelaxationFactor());
break;
- case PhysicsServer::CONE_TWIST_JOINT_SOFTNESS:
+ case PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS:
coneConstraint->setLimit(coneConstraint->getSwingSpan1(), coneConstraint->getSwingSpan2(), coneConstraint->getTwistSpan(), p_value, coneConstraint->getBiasFactor(), coneConstraint->getRelaxationFactor());
break;
- case PhysicsServer::CONE_TWIST_JOINT_RELAXATION:
+ case PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION:
coneConstraint->setLimit(coneConstraint->getSwingSpan1(), coneConstraint->getSwingSpan2(), coneConstraint->getTwistSpan(), coneConstraint->getLimitSoftness(), coneConstraint->getBiasFactor(), p_value);
break;
- case PhysicsServer::CONE_TWIST_MAX:
+ case PhysicsServer3D::CONE_TWIST_MAX:
// Internal size value, nothing to do.
break;
}
}
-real_t ConeTwistJointBullet::get_param(PhysicsServer::ConeTwistJointParam p_param) const {
+real_t ConeTwistJointBullet::get_param(PhysicsServer3D::ConeTwistJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN:
+ case PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN:
return coneConstraint->getSwingSpan1();
- case PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN:
+ case PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN:
return coneConstraint->getTwistSpan();
- case PhysicsServer::CONE_TWIST_JOINT_BIAS:
+ case PhysicsServer3D::CONE_TWIST_JOINT_BIAS:
return coneConstraint->getBiasFactor();
- case PhysicsServer::CONE_TWIST_JOINT_SOFTNESS:
+ case PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS:
return coneConstraint->getLimitSoftness();
- case PhysicsServer::CONE_TWIST_JOINT_RELAXATION:
+ case PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION:
return coneConstraint->getRelaxationFactor();
- case PhysicsServer::CONE_TWIST_MAX:
+ case PhysicsServer3D::CONE_TWIST_MAX:
// Internal size value, nothing to do.
return 0;
}
diff --git a/modules/bullet/cone_twist_joint_bullet.h b/modules/bullet/cone_twist_joint_bullet.h
index 134706f8bb..ed4baa9d1b 100644
--- a/modules/bullet/cone_twist_joint_bullet.h
+++ b/modules/bullet/cone_twist_joint_bullet.h
@@ -45,9 +45,9 @@ class ConeTwistJointBullet : public JointBullet {
public:
ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame);
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_CONE_TWIST; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_CONE_TWIST; }
- void set_param(PhysicsServer::ConeTwistJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::ConeTwistJointParam p_param) const;
+ void set_param(PhysicsServer3D::ConeTwistJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::ConeTwistJointParam p_param) const;
};
#endif
diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp
index 45ab3d3bb2..a6a01ebaa8 100644
--- a/modules/bullet/generic_6dof_joint_bullet.cpp
+++ b/modules/bullet/generic_6dof_joint_bullet.cpp
@@ -118,62 +118,62 @@ void Generic6DOFJointBullet::set_angular_upper_limit(const Vector3 &angularUpper
sixDOFConstraint->setAngularUpperLimit(btVec);
}
-void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value) {
+void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value) {
ERR_FAIL_INDEX(p_axis, 3);
switch (p_param) {
- case PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT:
limits_lower[0][p_axis] = p_value;
- set_flag(p_axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, flags[p_axis][PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT]); // Reload bullet parameter
+ set_flag(p_axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, flags[p_axis][PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT]); // Reload bullet parameter
break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT:
limits_upper[0][p_axis] = p_value;
- set_flag(p_axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, flags[p_axis][PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT]); // Reload bullet parameter
+ set_flag(p_axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, flags[p_axis][PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT]); // Reload bullet parameter
break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY:
sixDOFConstraint->getTranslationalLimitMotor()->m_targetVelocity.m_floats[p_axis] = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT:
sixDOFConstraint->getTranslationalLimitMotor()->m_maxMotorForce.m_floats[p_axis] = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING:
sixDOFConstraint->getTranslationalLimitMotor()->m_springDamping.m_floats[p_axis] = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS:
sixDOFConstraint->getTranslationalLimitMotor()->m_springStiffness.m_floats[p_axis] = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT:
sixDOFConstraint->getTranslationalLimitMotor()->m_equilibriumPoint.m_floats[p_axis] = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT:
limits_lower[1][p_axis] = p_value;
- set_flag(p_axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, flags[p_axis][PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT]); // Reload bullet parameter
+ set_flag(p_axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, flags[p_axis][PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT]); // Reload bullet parameter
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT:
limits_upper[1][p_axis] = p_value;
- set_flag(p_axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, flags[p_axis][PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT]); // Reload bullet parameter
+ set_flag(p_axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, flags[p_axis][PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT]); // Reload bullet parameter
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_bounce = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_ERP:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_stopERP = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_targetVelocity = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_maxMotorForce = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_springStiffness = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_springDamping = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_MAX:
+ case PhysicsServer3D::G6DOF_JOINT_MAX:
// Internal size value, nothing to do.
break;
default:
@@ -182,42 +182,42 @@ void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer::G6DO
}
}
-real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param) const {
+real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const {
ERR_FAIL_INDEX_V(p_axis, 3, 0.);
switch (p_param) {
- case PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT:
return limits_lower[0][p_axis];
- case PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT:
return limits_upper[0][p_axis];
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY:
return sixDOFConstraint->getTranslationalLimitMotor()->m_targetVelocity.m_floats[p_axis];
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT:
return sixDOFConstraint->getTranslationalLimitMotor()->m_maxMotorForce.m_floats[p_axis];
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING:
return sixDOFConstraint->getTranslationalLimitMotor()->m_springDamping.m_floats[p_axis];
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS:
return sixDOFConstraint->getTranslationalLimitMotor()->m_springStiffness.m_floats[p_axis];
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT:
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT:
return sixDOFConstraint->getTranslationalLimitMotor()->m_equilibriumPoint.m_floats[p_axis];
- case PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT:
return limits_lower[1][p_axis];
- case PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT:
return limits_upper[1][p_axis];
- case PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_bounce;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_ERP:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_stopERP;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_targetVelocity;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_maxMotorForce;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_springStiffness;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_springDamping;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT:
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT:
return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint;
- case PhysicsServer::G6DOF_JOINT_MAX:
+ case PhysicsServer3D::G6DOF_JOINT_MAX:
// Internal size value, nothing to do.
return 0;
default:
@@ -226,45 +226,45 @@ real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer::G6
}
}
-void Generic6DOFJointBullet::set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag, bool p_value) {
+void Generic6DOFJointBullet::set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value) {
ERR_FAIL_INDEX(p_axis, 3);
flags[p_axis][p_flag] = p_value;
switch (p_flag) {
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT:
if (flags[p_axis][p_flag]) {
sixDOFConstraint->setLimit(p_axis, limits_lower[0][p_axis], limits_upper[0][p_axis]);
} else {
sixDOFConstraint->setLimit(p_axis, 0, -1); // Free
}
break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT:
if (flags[p_axis][p_flag]) {
sixDOFConstraint->setLimit(p_axis + 3, limits_lower[1][p_axis], limits_upper[1][p_axis]);
} else {
sixDOFConstraint->setLimit(p_axis + 3, 0, -1); // Free
}
break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableSpring = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING:
sixDOFConstraint->getTranslationalLimitMotor()->m_enableSpring[p_axis] = p_value;
break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableMotor = flags[p_axis][p_flag];
break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR:
sixDOFConstraint->getTranslationalLimitMotor()->m_enableMotor[p_axis] = flags[p_axis][p_flag];
break;
- case PhysicsServer::G6DOF_JOINT_FLAG_MAX:
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_MAX:
// Internal size value, nothing to do.
break;
}
}
-bool Generic6DOFJointBullet::get_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag) const {
+bool Generic6DOFJointBullet::get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const {
ERR_FAIL_INDEX_V(p_axis, 3, false);
return flags[p_axis][p_flag];
}
diff --git a/modules/bullet/generic_6dof_joint_bullet.h b/modules/bullet/generic_6dof_joint_bullet.h
index 75c8005811..316708bb11 100644
--- a/modules/bullet/generic_6dof_joint_bullet.h
+++ b/modules/bullet/generic_6dof_joint_bullet.h
@@ -45,12 +45,12 @@ class Generic6DOFJointBullet : public JointBullet {
// First is linear second is angular
Vector3 limits_lower[2];
Vector3 limits_upper[2];
- bool flags[3][PhysicsServer::G6DOF_JOINT_FLAG_MAX];
+ bool flags[3][PhysicsServer3D::G6DOF_JOINT_FLAG_MAX];
public:
Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB);
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_6DOF; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_6DOF; }
Transform getFrameOffsetA() const;
Transform getFrameOffsetB() const;
@@ -63,11 +63,11 @@ public:
void set_angular_lower_limit(const Vector3 &angularLower);
void set_angular_upper_limit(const Vector3 &angularUpper);
- void set_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value);
- real_t get_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param) const;
+ void set_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value);
+ real_t get_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const;
- void set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag, bool p_value);
- bool get_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag) const;
+ void set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value);
+ bool get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const;
void set_precision(int p_precision);
int get_precision() const;
diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp
index 20467e3ef3..ad054e3027 100644
--- a/modules/bullet/godot_result_callbacks.cpp
+++ b/modules/bullet/godot_result_callbacks.cpp
@@ -107,7 +107,7 @@ btScalar GodotAllConvexResultCallback::addSingleResult(btCollisionWorld::LocalCo
CollisionObjectBullet *gObj = static_cast<CollisionObjectBullet *>(convexResult.m_hitCollisionObject->getUserPointer());
- PhysicsDirectSpaceState::ShapeResult &result = m_results[count];
+ PhysicsDirectSpaceState3D::ShapeResult &result = m_results[count];
result.shape = convexResult.m_localShapeInfo->m_triangleIndex; // "m_triangleIndex" Is a odd name but contains the compound shape ID
result.rid = gObj->get_self();
@@ -207,7 +207,7 @@ btScalar GodotAllContactResultCallback::addSingleResult(btManifoldPoint &cp, con
if (cp.getDistance() <= 0) {
- PhysicsDirectSpaceState::ShapeResult &result = m_results[m_count];
+ PhysicsDirectSpaceState3D::ShapeResult &result = m_results[m_count];
// Penetrated
CollisionObjectBullet *colObj;
diff --git a/modules/bullet/godot_result_callbacks.h b/modules/bullet/godot_result_callbacks.h
index 4f634ed6f0..7e74a2b22e 100644
--- a/modules/bullet/godot_result_callbacks.h
+++ b/modules/bullet/godot_result_callbacks.h
@@ -31,7 +31,7 @@
#ifndef GODOT_RESULT_CALLBACKS_H
#define GODOT_RESULT_CALLBACKS_H
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
#include <btBulletDynamicsCommon.h>
@@ -85,12 +85,12 @@ public:
// store all colliding object
struct GodotAllConvexResultCallback : public btCollisionWorld::ConvexResultCallback {
public:
- PhysicsDirectSpaceState::ShapeResult *m_results;
+ PhysicsDirectSpaceState3D::ShapeResult *m_results;
int m_resultMax;
const Set<RID> *m_exclude;
int count;
- GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) :
+ GodotAllConvexResultCallback(PhysicsDirectSpaceState3D::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) :
m_results(p_results),
m_resultMax(p_resultMax),
m_exclude(p_exclude),
@@ -137,7 +137,7 @@ public:
struct GodotAllContactResultCallback : public btCollisionWorld::ContactResultCallback {
public:
const btCollisionObject *m_self_object;
- PhysicsDirectSpaceState::ShapeResult *m_results;
+ PhysicsDirectSpaceState3D::ShapeResult *m_results;
int m_resultMax;
const Set<RID> *m_exclude;
int m_count;
@@ -145,7 +145,7 @@ public:
bool collide_with_bodies;
bool collide_with_areas;
- GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) :
+ GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState3D::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) :
m_self_object(p_self_object),
m_results(p_results),
m_resultMax(p_resultMax),
@@ -188,7 +188,7 @@ public:
struct GodotRestInfoContactResultCallback : public btCollisionWorld::ContactResultCallback {
public:
const btCollisionObject *m_self_object;
- PhysicsDirectSpaceState::ShapeRestInfo *m_result;
+ PhysicsDirectSpaceState3D::ShapeRestInfo *m_result;
const Set<RID> *m_exclude;
bool m_collided;
real_t m_min_distance;
@@ -197,7 +197,7 @@ public:
bool collide_with_bodies;
bool collide_with_areas;
- GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) :
+ GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState3D::ShapeRestInfo *p_result, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) :
m_self_object(p_self_object),
m_result(p_result),
m_exclude(p_exclude),
diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp
index 970732688a..eaac1d650d 100644
--- a/modules/bullet/hinge_joint_bullet.cpp
+++ b/modules/bullet/hinge_joint_bullet.cpp
@@ -93,58 +93,58 @@ real_t HingeJointBullet::get_hinge_angle() {
return hingeConstraint->getHingeAngle();
}
-void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t p_value) {
+void HingeJointBullet::set_param(PhysicsServer3D::HingeJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::HINGE_JOINT_BIAS:
+ case PhysicsServer3D::HINGE_JOINT_BIAS:
WARN_DEPRECATED_MSG("The HingeJoint parameter \"bias\" is deprecated.");
break;
- case PhysicsServer::HINGE_JOINT_LIMIT_UPPER:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER:
hingeConstraint->setLimit(hingeConstraint->getLowerLimit(), p_value, hingeConstraint->getLimitSoftness(), hingeConstraint->getLimitBiasFactor(), hingeConstraint->getLimitRelaxationFactor());
break;
- case PhysicsServer::HINGE_JOINT_LIMIT_LOWER:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER:
hingeConstraint->setLimit(p_value, hingeConstraint->getUpperLimit(), hingeConstraint->getLimitSoftness(), hingeConstraint->getLimitBiasFactor(), hingeConstraint->getLimitRelaxationFactor());
break;
- case PhysicsServer::HINGE_JOINT_LIMIT_BIAS:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS:
hingeConstraint->setLimit(hingeConstraint->getLowerLimit(), hingeConstraint->getUpperLimit(), hingeConstraint->getLimitSoftness(), p_value, hingeConstraint->getLimitRelaxationFactor());
break;
- case PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS:
hingeConstraint->setLimit(hingeConstraint->getLowerLimit(), hingeConstraint->getUpperLimit(), p_value, hingeConstraint->getLimitBiasFactor(), hingeConstraint->getLimitRelaxationFactor());
break;
- case PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION:
hingeConstraint->setLimit(hingeConstraint->getLowerLimit(), hingeConstraint->getUpperLimit(), hingeConstraint->getLimitSoftness(), hingeConstraint->getLimitBiasFactor(), p_value);
break;
- case PhysicsServer::HINGE_JOINT_MOTOR_TARGET_VELOCITY:
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_TARGET_VELOCITY:
hingeConstraint->setMotorTargetVelocity(p_value);
break;
- case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE:
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_MAX_IMPULSE:
hingeConstraint->setMaxMotorImpulse(p_value);
break;
- case PhysicsServer::HINGE_JOINT_MAX:
+ case PhysicsServer3D::HINGE_JOINT_MAX:
// Internal size value, nothing to do.
break;
}
}
-real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const {
+real_t HingeJointBullet::get_param(PhysicsServer3D::HingeJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::HINGE_JOINT_BIAS:
+ case PhysicsServer3D::HINGE_JOINT_BIAS:
WARN_DEPRECATED_MSG("The HingeJoint parameter \"bias\" is deprecated.");
return 0;
- case PhysicsServer::HINGE_JOINT_LIMIT_UPPER:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER:
return hingeConstraint->getUpperLimit();
- case PhysicsServer::HINGE_JOINT_LIMIT_LOWER:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER:
return hingeConstraint->getLowerLimit();
- case PhysicsServer::HINGE_JOINT_LIMIT_BIAS:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS:
return hingeConstraint->getLimitBiasFactor();
- case PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS:
return hingeConstraint->getLimitSoftness();
- case PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION:
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION:
return hingeConstraint->getLimitRelaxationFactor();
- case PhysicsServer::HINGE_JOINT_MOTOR_TARGET_VELOCITY:
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_TARGET_VELOCITY:
return hingeConstraint->getMotorTargetVelocity();
- case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE:
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_MAX_IMPULSE:
return hingeConstraint->getMaxMotorImpulse();
- case PhysicsServer::HINGE_JOINT_MAX:
+ case PhysicsServer3D::HINGE_JOINT_MAX:
// Internal size value, nothing to do.
return 0;
}
@@ -152,25 +152,25 @@ real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const
return 0;
}
-void HingeJointBullet::set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value) {
+void HingeJointBullet::set_flag(PhysicsServer3D::HingeJointFlag p_flag, bool p_value) {
switch (p_flag) {
- case PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT:
+ case PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT:
if (!p_value) {
hingeConstraint->setLimit(-Math_PI, Math_PI);
}
break;
- case PhysicsServer::HINGE_JOINT_FLAG_ENABLE_MOTOR:
+ case PhysicsServer3D::HINGE_JOINT_FLAG_ENABLE_MOTOR:
hingeConstraint->enableMotor(p_value);
break;
- case PhysicsServer::HINGE_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::HINGE_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
}
}
-bool HingeJointBullet::get_flag(PhysicsServer::HingeJointFlag p_flag) const {
+bool HingeJointBullet::get_flag(PhysicsServer3D::HingeJointFlag p_flag) const {
switch (p_flag) {
- case PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT:
+ case PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT:
return true;
- case PhysicsServer::HINGE_JOINT_FLAG_ENABLE_MOTOR:
+ case PhysicsServer3D::HINGE_JOINT_FLAG_ENABLE_MOTOR:
return hingeConstraint->getEnableAngularMotor();
default:
return false;
diff --git a/modules/bullet/hinge_joint_bullet.h b/modules/bullet/hinge_joint_bullet.h
index d1061fe52f..120c40e5c0 100644
--- a/modules/bullet/hinge_joint_bullet.h
+++ b/modules/bullet/hinge_joint_bullet.h
@@ -44,14 +44,14 @@ public:
HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB);
HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB);
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_HINGE; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_HINGE; }
real_t get_hinge_angle();
- void set_param(PhysicsServer::HingeJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::HingeJointParam p_param) const;
+ void set_param(PhysicsServer3D::HingeJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::HingeJointParam p_param) const;
- void set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value);
- bool get_flag(PhysicsServer::HingeJointFlag p_flag) const;
+ void set_flag(PhysicsServer3D::HingeJointFlag p_flag, bool p_value);
+ bool get_flag(PhysicsServer3D::HingeJointFlag p_flag) const;
};
#endif
diff --git a/modules/bullet/joint_bullet.h b/modules/bullet/joint_bullet.h
index c840eb8f14..9cb8aab276 100644
--- a/modules/bullet/joint_bullet.h
+++ b/modules/bullet/joint_bullet.h
@@ -32,7 +32,7 @@
#define JOINT_BULLET_H
#include "constraint_bullet.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
/**
@author AndreaCatania
@@ -47,6 +47,6 @@ public:
JointBullet();
virtual ~JointBullet();
- virtual PhysicsServer::JointType get_type() const = 0;
+ virtual PhysicsServer3D::JointType get_type() const = 0;
};
#endif
diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp
index 8d109f1866..68b40d7405 100644
--- a/modules/bullet/pin_joint_bullet.cpp
+++ b/modules/bullet/pin_joint_bullet.cpp
@@ -62,27 +62,27 @@ PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a
PinJointBullet::~PinJointBullet() {}
-void PinJointBullet::set_param(PhysicsServer::PinJointParam p_param, real_t p_value) {
+void PinJointBullet::set_param(PhysicsServer3D::PinJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::PIN_JOINT_BIAS:
+ case PhysicsServer3D::PIN_JOINT_BIAS:
p2pConstraint->m_setting.m_tau = p_value;
break;
- case PhysicsServer::PIN_JOINT_DAMPING:
+ case PhysicsServer3D::PIN_JOINT_DAMPING:
p2pConstraint->m_setting.m_damping = p_value;
break;
- case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP:
+ case PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP:
p2pConstraint->m_setting.m_impulseClamp = p_value;
break;
}
}
-real_t PinJointBullet::get_param(PhysicsServer::PinJointParam p_param) const {
+real_t PinJointBullet::get_param(PhysicsServer3D::PinJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::PIN_JOINT_BIAS:
+ case PhysicsServer3D::PIN_JOINT_BIAS:
return p2pConstraint->m_setting.m_tau;
- case PhysicsServer::PIN_JOINT_DAMPING:
+ case PhysicsServer3D::PIN_JOINT_DAMPING:
return p2pConstraint->m_setting.m_damping;
- case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP:
+ case PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP:
return p2pConstraint->m_setting.m_impulseClamp;
}
// Compiler doesn't seem to notice that all code paths are fulfilled...
diff --git a/modules/bullet/pin_joint_bullet.h b/modules/bullet/pin_joint_bullet.h
index d6e7a945b5..e7d05f34d4 100644
--- a/modules/bullet/pin_joint_bullet.h
+++ b/modules/bullet/pin_joint_bullet.h
@@ -46,10 +46,10 @@ public:
PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b);
~PinJointBullet();
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_PIN; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_PIN; }
- void set_param(PhysicsServer::PinJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::PinJointParam p_param) const;
+ void set_param(PhysicsServer3D::PinJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::PinJointParam p_param) const;
void setPivotInA(const Vector3 &p_pos);
void setPivotInB(const Vector3 &p_pos);
diff --git a/modules/bullet/register_types.cpp b/modules/bullet/register_types.cpp
index 7819b67cad..009d0dff63 100644
--- a/modules/bullet/register_types.cpp
+++ b/modules/bullet/register_types.cpp
@@ -39,15 +39,15 @@
*/
#ifndef _3D_DISABLED
-PhysicsServer *_createBulletPhysicsCallback() {
- return memnew(BulletPhysicsServer);
+PhysicsServer3D *_createBulletPhysicsCallback() {
+ return memnew(BulletPhysicsServer3D);
}
#endif
void register_bullet_types() {
#ifndef _3D_DISABLED
- PhysicsServerManager::register_server("Bullet", &_createBulletPhysicsCallback);
- PhysicsServerManager::set_default_server("Bullet", 1);
+ PhysicsServer3DManager::register_server("Bullet", &_createBulletPhysicsCallback);
+ PhysicsServer3DManager::set_default_server("Bullet", 1);
GLOBAL_DEF("physics/3d/active_soft_world", true);
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/active_soft_world", PropertyInfo(Variant::BOOL, "physics/3d/active_soft_world"));
diff --git a/modules/bullet/rid_bullet.h b/modules/bullet/rid_bullet.h
index b76641ca54..3551ca05f9 100644
--- a/modules/bullet/rid_bullet.h
+++ b/modules/bullet/rid_bullet.h
@@ -37,17 +37,17 @@
@author AndreaCatania
*/
-class BulletPhysicsServer;
+class BulletPhysicsServer3D;
class RIDBullet {
RID self;
- BulletPhysicsServer *physicsServer;
+ BulletPhysicsServer3D *physicsServer;
public:
_FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; }
_FORCE_INLINE_ RID get_self() const { return self; }
- _FORCE_INLINE_ void _set_physics_server(BulletPhysicsServer *p_physicsServer) { physicsServer = p_physicsServer; }
- _FORCE_INLINE_ BulletPhysicsServer *get_physics_server() const { return physicsServer; }
+ _FORCE_INLINE_ void _set_physics_server(BulletPhysicsServer3D *p_physicsServer) { physicsServer = p_physicsServer; }
+ _FORCE_INLINE_ BulletPhysicsServer3D *get_physics_server() const { return physicsServer; }
};
#endif
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 80f42c8441..b92166e653 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -194,7 +194,7 @@ Vector3 BulletPhysicsDirectBodyState::get_contact_collider_velocity_at_position(
return velocityAtPoint;
}
-PhysicsDirectSpaceState *BulletPhysicsDirectBodyState::get_space_state() {
+PhysicsDirectSpaceState3D *BulletPhysicsDirectBodyState::get_space_state() {
return body->get_space()->get_direct_state();
}
@@ -231,12 +231,12 @@ void RigidBodyBullet::KinematicUtilities::copyAllOwnerShapes() {
shapes.write[i].transform = shape_wrapper->transform;
shapes.write[i].transform.getOrigin() *= owner_scale;
switch (shape_wrapper->shape->get_type()) {
- case PhysicsServer::SHAPE_SPHERE:
- case PhysicsServer::SHAPE_BOX:
- case PhysicsServer::SHAPE_CAPSULE:
- case PhysicsServer::SHAPE_CYLINDER:
- case PhysicsServer::SHAPE_CONVEX_POLYGON:
- case PhysicsServer::SHAPE_RAY: {
+ case PhysicsServer3D::SHAPE_SPHERE:
+ case PhysicsServer3D::SHAPE_BOX:
+ case PhysicsServer3D::SHAPE_CAPSULE:
+ case PhysicsServer3D::SHAPE_CYLINDER:
+ case PhysicsServer3D::SHAPE_CONVEX_POLYGON:
+ case PhysicsServer3D::SHAPE_RAY: {
shapes.write[i].shape = static_cast<btConvexShape *>(shape_wrapper->shape->create_bt_shape(owner_scale * shape_wrapper->scale, safe_margin));
} break;
default:
@@ -286,7 +286,7 @@ RigidBodyBullet::RigidBodyBullet() :
reload_shapes();
setupBulletCollisionObject(btBody);
- set_mode(PhysicsServer::BODY_MODE_RIGID);
+ set_mode(PhysicsServer3D::BODY_MODE_RIGID);
reload_axis_lock();
areasWhereIam.resize(maxAreasWhereIam);
@@ -487,29 +487,29 @@ void RigidBodyBullet::set_omit_forces_integration(bool p_omit) {
omit_forces_integration = p_omit;
}
-void RigidBodyBullet::set_param(PhysicsServer::BodyParameter p_param, real_t p_value) {
+void RigidBodyBullet::set_param(PhysicsServer3D::BodyParameter p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::BODY_PARAM_BOUNCE:
+ case PhysicsServer3D::BODY_PARAM_BOUNCE:
btBody->setRestitution(p_value);
break;
- case PhysicsServer::BODY_PARAM_FRICTION:
+ case PhysicsServer3D::BODY_PARAM_FRICTION:
btBody->setFriction(p_value);
break;
- case PhysicsServer::BODY_PARAM_MASS: {
+ case PhysicsServer3D::BODY_PARAM_MASS: {
ERR_FAIL_COND(p_value < 0);
mass = p_value;
_internal_set_mass(p_value);
break;
}
- case PhysicsServer::BODY_PARAM_LINEAR_DAMP:
+ case PhysicsServer3D::BODY_PARAM_LINEAR_DAMP:
linearDamp = p_value;
btBody->setDamping(linearDamp, angularDamp);
break;
- case PhysicsServer::BODY_PARAM_ANGULAR_DAMP:
+ case PhysicsServer3D::BODY_PARAM_ANGULAR_DAMP:
angularDamp = p_value;
btBody->setDamping(linearDamp, angularDamp);
break;
- case PhysicsServer::BODY_PARAM_GRAVITY_SCALE:
+ case PhysicsServer3D::BODY_PARAM_GRAVITY_SCALE:
gravity_scale = p_value;
/// The Bullet gravity will be is set by reload_space_override_modificator
scratch_space_override_modificator();
@@ -519,21 +519,21 @@ void RigidBodyBullet::set_param(PhysicsServer::BodyParameter p_param, real_t p_v
}
}
-real_t RigidBodyBullet::get_param(PhysicsServer::BodyParameter p_param) const {
+real_t RigidBodyBullet::get_param(PhysicsServer3D::BodyParameter p_param) const {
switch (p_param) {
- case PhysicsServer::BODY_PARAM_BOUNCE:
+ case PhysicsServer3D::BODY_PARAM_BOUNCE:
return btBody->getRestitution();
- case PhysicsServer::BODY_PARAM_FRICTION:
+ case PhysicsServer3D::BODY_PARAM_FRICTION:
return btBody->getFriction();
- case PhysicsServer::BODY_PARAM_MASS: {
+ case PhysicsServer3D::BODY_PARAM_MASS: {
const btScalar invMass = btBody->getInvMass();
return 0 == invMass ? 0 : 1 / invMass;
}
- case PhysicsServer::BODY_PARAM_LINEAR_DAMP:
+ case PhysicsServer3D::BODY_PARAM_LINEAR_DAMP:
return linearDamp;
- case PhysicsServer::BODY_PARAM_ANGULAR_DAMP:
+ case PhysicsServer3D::BODY_PARAM_ANGULAR_DAMP:
return angularDamp;
- case PhysicsServer::BODY_PARAM_GRAVITY_SCALE:
+ case PhysicsServer3D::BODY_PARAM_GRAVITY_SCALE:
return gravity_scale;
default:
WARN_PRINT("Parameter " + itos(p_param) + " not supported by bullet");
@@ -541,31 +541,31 @@ real_t RigidBodyBullet::get_param(PhysicsServer::BodyParameter p_param) const {
}
}
-void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) {
+void RigidBodyBullet::set_mode(PhysicsServer3D::BodyMode p_mode) {
// This is necessary to block force_integration untile next move
can_integrate_forces = false;
destroy_kinematic_utilities();
// The mode change is relevant to its mass
switch (p_mode) {
- case PhysicsServer::BODY_MODE_KINEMATIC:
- mode = PhysicsServer::BODY_MODE_KINEMATIC;
+ case PhysicsServer3D::BODY_MODE_KINEMATIC:
+ mode = PhysicsServer3D::BODY_MODE_KINEMATIC;
reload_axis_lock();
_internal_set_mass(0);
init_kinematic_utilities();
break;
- case PhysicsServer::BODY_MODE_STATIC:
- mode = PhysicsServer::BODY_MODE_STATIC;
+ case PhysicsServer3D::BODY_MODE_STATIC:
+ mode = PhysicsServer3D::BODY_MODE_STATIC;
reload_axis_lock();
_internal_set_mass(0);
break;
- case PhysicsServer::BODY_MODE_RIGID:
- mode = PhysicsServer::BODY_MODE_RIGID;
+ case PhysicsServer3D::BODY_MODE_RIGID:
+ mode = PhysicsServer3D::BODY_MODE_RIGID;
reload_axis_lock();
_internal_set_mass(0 == mass ? 1 : mass);
scratch_space_override_modificator();
break;
- case PhysicsServer::BODY_MODE_CHARACTER:
- mode = PhysicsServer::BODY_MODE_CHARACTER;
+ case PhysicsServer3D::BODY_MODE_CHARACTER:
+ mode = PhysicsServer3D::BODY_MODE_CHARACTER;
reload_axis_lock();
_internal_set_mass(0 == mass ? 1 : mass);
scratch_space_override_modificator();
@@ -575,26 +575,26 @@ void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) {
btBody->setAngularVelocity(btVector3(0, 0, 0));
btBody->setLinearVelocity(btVector3(0, 0, 0));
}
-PhysicsServer::BodyMode RigidBodyBullet::get_mode() const {
+PhysicsServer3D::BodyMode RigidBodyBullet::get_mode() const {
return mode;
}
-void RigidBodyBullet::set_state(PhysicsServer::BodyState p_state, const Variant &p_variant) {
+void RigidBodyBullet::set_state(PhysicsServer3D::BodyState p_state, const Variant &p_variant) {
switch (p_state) {
- case PhysicsServer::BODY_STATE_TRANSFORM:
+ case PhysicsServer3D::BODY_STATE_TRANSFORM:
set_transform(p_variant);
break;
- case PhysicsServer::BODY_STATE_LINEAR_VELOCITY:
+ case PhysicsServer3D::BODY_STATE_LINEAR_VELOCITY:
set_linear_velocity(p_variant);
break;
- case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY:
+ case PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY:
set_angular_velocity(p_variant);
break;
- case PhysicsServer::BODY_STATE_SLEEPING:
+ case PhysicsServer3D::BODY_STATE_SLEEPING:
set_activation_state(!bool(p_variant));
break;
- case PhysicsServer::BODY_STATE_CAN_SLEEP:
+ case PhysicsServer3D::BODY_STATE_CAN_SLEEP:
can_sleep = bool(p_variant);
if (!can_sleep) {
// Can't sleep
@@ -606,17 +606,17 @@ void RigidBodyBullet::set_state(PhysicsServer::BodyState p_state, const Variant
}
}
-Variant RigidBodyBullet::get_state(PhysicsServer::BodyState p_state) const {
+Variant RigidBodyBullet::get_state(PhysicsServer3D::BodyState p_state) const {
switch (p_state) {
- case PhysicsServer::BODY_STATE_TRANSFORM:
+ case PhysicsServer3D::BODY_STATE_TRANSFORM:
return get_transform();
- case PhysicsServer::BODY_STATE_LINEAR_VELOCITY:
+ case PhysicsServer3D::BODY_STATE_LINEAR_VELOCITY:
return get_linear_velocity();
- case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY:
+ case PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY:
return get_angular_velocity();
- case PhysicsServer::BODY_STATE_SLEEPING:
+ case PhysicsServer3D::BODY_STATE_SLEEPING:
return !is_active();
- case PhysicsServer::BODY_STATE_CAN_SLEEP:
+ case PhysicsServer3D::BODY_STATE_CAN_SLEEP:
return can_sleep;
default:
WARN_PRINT("This state " + itos(p_state) + " is not supported by Bullet");
@@ -714,7 +714,7 @@ Vector3 RigidBodyBullet::get_applied_torque() const {
return gTotTorq;
}
-void RigidBodyBullet::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock) {
+void RigidBodyBullet::set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool lock) {
if (lock) {
locked_axis |= p_axis;
} else {
@@ -724,18 +724,18 @@ void RigidBodyBullet::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock) {
reload_axis_lock();
}
-bool RigidBodyBullet::is_axis_locked(PhysicsServer::BodyAxis p_axis) const {
+bool RigidBodyBullet::is_axis_locked(PhysicsServer3D::BodyAxis p_axis) const {
return locked_axis & p_axis;
}
void RigidBodyBullet::reload_axis_lock() {
- btBody->setLinearFactor(btVector3(float(!is_axis_locked(PhysicsServer::BODY_AXIS_LINEAR_X)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_LINEAR_Y)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_LINEAR_Z))));
- if (PhysicsServer::BODY_MODE_CHARACTER == mode) {
+ btBody->setLinearFactor(btVector3(float(!is_axis_locked(PhysicsServer3D::BODY_AXIS_LINEAR_X)), float(!is_axis_locked(PhysicsServer3D::BODY_AXIS_LINEAR_Y)), float(!is_axis_locked(PhysicsServer3D::BODY_AXIS_LINEAR_Z))));
+ if (PhysicsServer3D::BODY_MODE_CHARACTER == mode) {
/// When character angular is always locked
btBody->setAngularFactor(btVector3(0., 0., 0.));
} else {
- btBody->setAngularFactor(btVector3(float(!is_axis_locked(PhysicsServer::BODY_AXIS_ANGULAR_X)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_ANGULAR_Y)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_ANGULAR_Z))));
+ btBody->setAngularFactor(btVector3(float(!is_axis_locked(PhysicsServer3D::BODY_AXIS_ANGULAR_X)), float(!is_axis_locked(PhysicsServer3D::BODY_AXIS_ANGULAR_Y)), float(!is_axis_locked(PhysicsServer3D::BODY_AXIS_ANGULAR_Z))));
}
}
@@ -794,7 +794,7 @@ Vector3 RigidBodyBullet::get_angular_velocity() const {
}
void RigidBodyBullet::set_transform__bullet(const btTransform &p_global_transform) {
- if (mode == PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC) {
if (space && space->get_delta_time() != 0)
btBody->setLinearVelocity((p_global_transform.getOrigin() - btBody->getWorldTransform().getOrigin()) / space->get_delta_time());
// The kinematic use MotionState class
@@ -862,7 +862,7 @@ void RigidBodyBullet::on_enter_area(AreaBullet *p_area) {
}
}
}
- if (PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED != p_area->get_spOv_mode()) {
+ if (PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED != p_area->get_spOv_mode()) {
scratch_space_override_modificator();
}
@@ -895,7 +895,7 @@ void RigidBodyBullet::on_exit_area(AreaBullet *p_area) {
--areaWhereIamCount;
areasWhereIam.write[areaWhereIamCount] = NULL; // Even if this is not required, I clear the last element to be safe
- if (PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED != p_area->get_spOv_mode()) {
+ if (PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED != p_area->get_spOv_mode()) {
scratch_space_override_modificator();
}
}
@@ -904,7 +904,7 @@ void RigidBodyBullet::on_exit_area(AreaBullet *p_area) {
void RigidBodyBullet::reload_space_override_modificator() {
// Make sure that kinematic bodies have their total gravity calculated
- if (!is_active() && PhysicsServer::BODY_MODE_KINEMATIC != mode)
+ if (!is_active() && PhysicsServer3D::BODY_MODE_KINEMATIC != mode)
return;
Vector3 newGravity(space->get_gravity_direction() * space->get_gravity_magnitude());
@@ -920,7 +920,7 @@ void RigidBodyBullet::reload_space_override_modificator() {
currentArea = areasWhereIam[i];
- if (!currentArea || PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED == currentArea->get_spOv_mode()) {
+ if (!currentArea || PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED == currentArea->get_spOv_mode()) {
continue;
}
@@ -954,11 +954,11 @@ void RigidBodyBullet::reload_space_override_modificator() {
}
switch (currentArea->get_spOv_mode()) {
- case PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED:
/// This area does not affect gravity/damp. These are generally areas
/// that exist only to detect collisions, and objects entering or exiting them.
break;
- case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_COMBINE:
/// This area adds its gravity/damp values to whatever has been
/// calculated so far. This way, many overlapping areas can combine
/// their physics to make interesting
@@ -967,7 +967,7 @@ void RigidBodyBullet::reload_space_override_modificator() {
newAngularDamp += currentArea->get_spOv_angularDamp();
++countCombined;
break;
- case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_COMBINE_REPLACE:
/// This area adds its gravity/damp values to whatever has been calculated
/// so far. Then stops taking into account the rest of the areas, even the
/// default one.
@@ -976,7 +976,7 @@ void RigidBodyBullet::reload_space_override_modificator() {
newAngularDamp += currentArea->get_spOv_angularDamp();
++countCombined;
goto endAreasCycle;
- case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_REPLACE:
/// This area replaces any gravity/damp, even the default one, and
/// stops taking into account the rest of the areas.
newGravity = support_gravity;
@@ -984,7 +984,7 @@ void RigidBodyBullet::reload_space_override_modificator() {
newAngularDamp = currentArea->get_spOv_angularDamp();
countCombined = 1;
goto endAreasCycle;
- case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE_COMBINE:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_REPLACE_COMBINE:
/// This area replaces any gravity/damp calculated so far, but keeps
/// calculating the rest of the areas, down to the default one.
newGravity = support_gravity;
@@ -1032,14 +1032,14 @@ void RigidBodyBullet::_internal_set_mass(real_t p_mass) {
const bool isDynamic = p_mass != 0.f;
if (isDynamic) {
- if (PhysicsServer::BODY_MODE_RIGID != mode && PhysicsServer::BODY_MODE_CHARACTER != mode)
+ if (PhysicsServer3D::BODY_MODE_RIGID != mode && PhysicsServer3D::BODY_MODE_CHARACTER != mode)
return;
m_isStatic = false;
if (mainShape)
mainShape->calculateLocalInertia(p_mass, localInertia);
- if (PhysicsServer::BODY_MODE_RIGID == mode) {
+ if (PhysicsServer3D::BODY_MODE_RIGID == mode) {
btBody->setCollisionFlags(clearedCurrentFlags); // Just set the flags without Kin and Static
} else {
@@ -1054,11 +1054,11 @@ void RigidBodyBullet::_internal_set_mass(real_t p_mass) {
}
} else {
- if (PhysicsServer::BODY_MODE_STATIC != mode && PhysicsServer::BODY_MODE_KINEMATIC != mode)
+ if (PhysicsServer3D::BODY_MODE_STATIC != mode && PhysicsServer3D::BODY_MODE_KINEMATIC != mode)
return;
m_isStatic = true;
- if (PhysicsServer::BODY_MODE_STATIC == mode) {
+ if (PhysicsServer3D::BODY_MODE_STATIC == mode) {
btBody->setCollisionFlags(clearedCurrentFlags | btCollisionObject::CF_STATIC_OBJECT);
} else {
diff --git a/modules/bullet/rigid_body_bullet.h b/modules/bullet/rigid_body_bullet.h
index ca599f7a77..bce3511282 100644
--- a/modules/bullet/rigid_body_bullet.h
+++ b/modules/bullet/rigid_body_bullet.h
@@ -51,10 +51,10 @@ class BulletPhysicsDirectBodyState;
/// is set to be only in one single thread.
///
/// In the system there is only one object at a time that manage all bodies and is
-/// created by BulletPhysicsServer and is held by the "singleton" variable of this class
+/// created by BulletPhysicsServer3D and is held by the "singleton" variable of this class
/// Each time something require it, the body must be set again.
-class BulletPhysicsDirectBodyState : public PhysicsDirectBodyState {
- GDCLASS(BulletPhysicsDirectBodyState, PhysicsDirectBodyState);
+class BulletPhysicsDirectBodyState : public PhysicsDirectBodyState3D {
+ GDCLASS(BulletPhysicsDirectBodyState, PhysicsDirectBodyState3D);
static BulletPhysicsDirectBodyState *singleton;
@@ -138,7 +138,7 @@ public:
// Skip the execution of this function
}
- virtual PhysicsDirectSpaceState *get_space_state();
+ virtual PhysicsDirectSpaceState3D *get_space_state();
};
class RigidBodyBullet : public RigidCollisionObjectBullet {
@@ -192,7 +192,7 @@ private:
// This is required only for Kinematic movement
KinematicUtilities *kinematic_utilities;
- PhysicsServer::BodyMode mode;
+ PhysicsServer3D::BodyMode mode;
GodotMotionState *godotMotionState;
btRigidBody *btBody;
uint16_t locked_axis;
@@ -278,14 +278,14 @@ public:
void set_omit_forces_integration(bool p_omit);
_FORCE_INLINE_ bool get_omit_forces_integration() const { return omit_forces_integration; }
- void set_param(PhysicsServer::BodyParameter p_param, real_t);
- real_t get_param(PhysicsServer::BodyParameter p_param) const;
+ void set_param(PhysicsServer3D::BodyParameter p_param, real_t);
+ real_t get_param(PhysicsServer3D::BodyParameter p_param) const;
- void set_mode(PhysicsServer::BodyMode p_mode);
- PhysicsServer::BodyMode get_mode() const;
+ void set_mode(PhysicsServer3D::BodyMode p_mode);
+ PhysicsServer3D::BodyMode get_mode() const;
- void set_state(PhysicsServer::BodyState p_state, const Variant &p_variant);
- Variant get_state(PhysicsServer::BodyState p_state) const;
+ void set_state(PhysicsServer3D::BodyState p_state, const Variant &p_variant);
+ Variant get_state(PhysicsServer3D::BodyState p_state) const;
void apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse);
void apply_central_impulse(const Vector3 &p_impulse);
@@ -300,8 +300,8 @@ public:
void set_applied_torque(const Vector3 &p_torque);
Vector3 get_applied_torque() const;
- void set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock);
- bool is_axis_locked(PhysicsServer::BodyAxis p_axis) const;
+ void set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool lock);
+ bool is_axis_locked(PhysicsServer3D::BodyAxis p_axis) const;
void reload_axis_lock();
/// Doc:
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp
index 6780f89d9e..6b73525d10 100644
--- a/modules/bullet/shape_bullet.cpp
+++ b/modules/bullet/shape_bullet.cpp
@@ -150,7 +150,7 @@ btHeightfieldTerrainShape *ShapeBullet::create_shape_height_field(Vector<real_t>
btHeightfieldTerrainShape *heightfield = bulletnew(btHeightfieldTerrainShape(p_width, p_depth, heightsPtr, ignoredHeightScale, p_min_height, p_max_height, YAxis, PHY_FLOAT, flipQuadEdges));
- // The shape can be created without params when you do PhysicsServer.shape_create(PhysicsServer.SHAPE_HEIGHTMAP)
+ // The shape can be created without params when you do PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_HEIGHTMAP)
if (heightsPtr)
heightfield->buildAccelerator(16);
@@ -176,8 +176,8 @@ Variant PlaneShapeBullet::get_data() const {
return plane;
}
-PhysicsServer::ShapeType PlaneShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_PLANE;
+PhysicsServer3D::ShapeType PlaneShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_PLANE;
}
void PlaneShapeBullet::setup(const Plane &p_plane) {
@@ -204,8 +204,8 @@ Variant SphereShapeBullet::get_data() const {
return radius;
}
-PhysicsServer::ShapeType SphereShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_SPHERE;
+PhysicsServer3D::ShapeType SphereShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_SPHERE;
}
void SphereShapeBullet::setup(real_t p_radius) {
@@ -231,8 +231,8 @@ Variant BoxShapeBullet::get_data() const {
return g_half_extents;
}
-PhysicsServer::ShapeType BoxShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_BOX;
+PhysicsServer3D::ShapeType BoxShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_BOX;
}
void BoxShapeBullet::setup(const Vector3 &p_half_extents) {
@@ -263,8 +263,8 @@ Variant CapsuleShapeBullet::get_data() const {
return d;
}
-PhysicsServer::ShapeType CapsuleShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_CAPSULE;
+PhysicsServer3D::ShapeType CapsuleShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_CAPSULE;
}
void CapsuleShapeBullet::setup(real_t p_height, real_t p_radius) {
@@ -296,8 +296,8 @@ Variant CylinderShapeBullet::get_data() const {
return d;
}
-PhysicsServer::ShapeType CylinderShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_CYLINDER;
+PhysicsServer3D::ShapeType CylinderShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_CYLINDER;
}
void CylinderShapeBullet::setup(real_t p_height, real_t p_radius) {
@@ -334,8 +334,8 @@ Variant ConvexPolygonShapeBullet::get_data() const {
return out_vertices;
}
-PhysicsServer::ShapeType ConvexPolygonShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_CONVEX_POLYGON;
+PhysicsServer3D::ShapeType ConvexPolygonShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_CONVEX_POLYGON;
}
void ConvexPolygonShapeBullet::setup(const Vector<Vector3> &p_vertices) {
@@ -381,8 +381,8 @@ Variant ConcavePolygonShapeBullet::get_data() const {
return faces;
}
-PhysicsServer::ShapeType ConcavePolygonShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_CONCAVE_POLYGON;
+PhysicsServer3D::ShapeType ConcavePolygonShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_CONCAVE_POLYGON;
}
void ConcavePolygonShapeBullet::setup(Vector<Vector3> p_faces) {
@@ -536,8 +536,8 @@ Variant HeightMapShapeBullet::get_data() const {
ERR_FAIL_V(Variant());
}
-PhysicsServer::ShapeType HeightMapShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_HEIGHTMAP;
+PhysicsServer3D::ShapeType HeightMapShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_HEIGHTMAP;
}
void HeightMapShapeBullet::setup(Vector<real_t> &p_heights, int p_width, int p_depth, real_t p_min_height, real_t p_max_height) {
@@ -580,8 +580,8 @@ Variant RayShapeBullet::get_data() const {
return d;
}
-PhysicsServer::ShapeType RayShapeBullet::get_type() const {
- return PhysicsServer::SHAPE_RAY;
+PhysicsServer3D::ShapeType RayShapeBullet::get_type() const {
+ return PhysicsServer3D::SHAPE_RAY;
}
void RayShapeBullet::setup(real_t p_length, bool p_slips_on_slope) {
diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h
index c8b5ca102a..0dbc616fe5 100644
--- a/modules/bullet/shape_bullet.h
+++ b/modules/bullet/shape_bullet.h
@@ -34,7 +34,7 @@
#include "core/math/geometry.h"
#include "core/variant.h"
#include "rid_bullet.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include <LinearMath/btAlignedObjectArray.h>
#include <LinearMath/btScalar.h>
@@ -78,7 +78,7 @@ public:
virtual void set_data(const Variant &p_data) = 0;
virtual Variant get_data() const = 0;
- virtual PhysicsServer::ShapeType get_type() const = 0;
+ virtual PhysicsServer3D::ShapeType get_type() const = 0;
public:
static class btEmptyShape *create_shape_empty();
@@ -103,7 +103,7 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -120,7 +120,7 @@ public:
_FORCE_INLINE_ real_t get_radius() { return radius; }
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -137,7 +137,7 @@ public:
_FORCE_INLINE_ const btVector3 &get_half_extents() { return half_extents; }
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -156,7 +156,7 @@ public:
_FORCE_INLINE_ real_t get_radius() { return radius; }
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -175,7 +175,7 @@ public:
_FORCE_INLINE_ real_t get_radius() { return radius; }
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_margin = 0);
private:
@@ -192,7 +192,7 @@ public:
virtual void set_data(const Variant &p_data);
void get_vertices(Vector<Vector3> &out_vertices);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -210,7 +210,7 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -230,7 +230,7 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
@@ -247,7 +247,7 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- virtual PhysicsServer::ShapeType get_type() const;
+ virtual PhysicsServer3D::ShapeType get_type() const;
virtual btCollisionShape *create_bt_shape(const btVector3 &p_implicit_scale, real_t p_extra_edge = 0);
private:
diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp
index d9ebb9d580..f193daef39 100644
--- a/modules/bullet/slider_joint_bullet.cpp
+++ b/modules/bullet/slider_joint_bullet.cpp
@@ -342,58 +342,58 @@ real_t SliderJointBullet::getLinearPos() {
;
}
-void SliderJointBullet::set_param(PhysicsServer::SliderJointParam p_param, real_t p_value) {
+void SliderJointBullet::set_param(PhysicsServer3D::SliderJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER: setUpperLinLimit(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER: setLowerLinLimit(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: setSoftnessLimLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: setRestitutionLimLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: setDampingLimLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: setSoftnessDirLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: setRestitutionDirLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_DAMPING: setDampingDirLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: setSoftnessOrthoLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: setRestitutionOrthoLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: setDampingOrthoLin(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: setUpperAngLimit(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: setLowerAngLimit(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: setSoftnessLimAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: setRestitutionLimAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: setDampingLimAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: setSoftnessDirAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: setRestitutionDirAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: setDampingDirAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: setSoftnessOrthoAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: setRestitutionOrthoAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: setDampingOrthoAng(p_value); break;
- case PhysicsServer::SLIDER_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER: setUpperLinLimit(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER: setLowerLinLimit(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: setSoftnessLimLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: setRestitutionLimLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: setDampingLimLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: setSoftnessDirLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: setRestitutionDirLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_DAMPING: setDampingDirLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: setSoftnessOrthoLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: setRestitutionOrthoLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: setDampingOrthoLin(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: setUpperAngLimit(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: setLowerAngLimit(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: setSoftnessLimAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: setRestitutionLimAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: setDampingLimAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: setSoftnessDirAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: setRestitutionDirAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: setDampingDirAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: setSoftnessOrthoAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: setRestitutionOrthoAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: setDampingOrthoAng(p_value); break;
+ case PhysicsServer3D::SLIDER_JOINT_MAX: break; // Can't happen, but silences warning
}
}
-real_t SliderJointBullet::get_param(PhysicsServer::SliderJointParam p_param) const {
+real_t SliderJointBullet::get_param(PhysicsServer3D::SliderJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER: return getUpperLinLimit();
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER: return getLowerLinLimit();
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: return getSoftnessLimLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: return getRestitutionLimLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: return getDampingLimLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: return getSoftnessDirLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: return getRestitutionDirLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_DAMPING: return getDampingDirLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: return getSoftnessOrthoLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: return getRestitutionOrthoLin();
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: return getDampingOrthoLin();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: return getUpperAngLimit();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: return getLowerAngLimit();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: return getSoftnessLimAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: return getRestitutionLimAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: return getDampingLimAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: return getSoftnessDirAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: return getRestitutionDirAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: return getDampingDirAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: return getSoftnessOrthoAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: return getRestitutionOrthoAng();
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: return getDampingOrthoAng();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER: return getUpperLinLimit();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER: return getLowerLinLimit();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: return getSoftnessLimLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: return getRestitutionLimLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: return getDampingLimLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: return getSoftnessDirLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: return getRestitutionDirLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_DAMPING: return getDampingDirLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: return getSoftnessOrthoLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: return getRestitutionOrthoLin();
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: return getDampingOrthoLin();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: return getUpperAngLimit();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: return getLowerAngLimit();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: return getSoftnessLimAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: return getRestitutionLimAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: return getDampingLimAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: return getSoftnessDirAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: return getRestitutionDirAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: return getDampingDirAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: return getSoftnessOrthoAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: return getRestitutionOrthoAng();
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: return getDampingOrthoAng();
default:
return 0;
}
diff --git a/modules/bullet/slider_joint_bullet.h b/modules/bullet/slider_joint_bullet.h
index d98a1b8c95..6410b952ed 100644
--- a/modules/bullet/slider_joint_bullet.h
+++ b/modules/bullet/slider_joint_bullet.h
@@ -46,7 +46,7 @@ public:
/// Reference frame is A
SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB);
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_SLIDER; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_SLIDER; }
const RigidBodyBullet *getRigidBodyA() const;
const RigidBodyBullet *getRigidBodyB() const;
@@ -115,7 +115,7 @@ public:
real_t getMaxAngMotorForce();
real_t getLinearPos();
- void set_param(PhysicsServer::SliderJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::SliderJointParam p_param) const;
+ void set_param(PhysicsServer3D::SliderJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::SliderJointParam p_param) const;
};
#endif
diff --git a/modules/bullet/soft_body_bullet.cpp b/modules/bullet/soft_body_bullet.cpp
index fb36a0d3e1..2984bf9c2b 100644
--- a/modules/bullet/soft_body_bullet.cpp
+++ b/modules/bullet/soft_body_bullet.cpp
@@ -76,7 +76,7 @@ void SoftBodyBullet::on_enter_area(AreaBullet *p_area) {}
void SoftBodyBullet::on_exit_area(AreaBullet *p_area) {}
-void SoftBodyBullet::update_visual_server(SoftBodyVisualServerHandler *p_visual_server_handler) {
+void SoftBodyBullet::update_rendering_server(SoftBodyRenderingServerHandler *p_rendering_server_handler) {
if (!bt_soft_body)
return;
@@ -96,8 +96,8 @@ void SoftBodyBullet::update_visual_server(SoftBodyVisualServerHandler *p_visual_
const int vs_indices_size(vs_indices->size());
for (int x = 0; x < vs_indices_size; ++x) {
- p_visual_server_handler->set_vertex((*vs_indices)[x], vertex_position);
- p_visual_server_handler->set_normal((*vs_indices)[x], vertex_normal);
+ p_rendering_server_handler->set_vertex((*vs_indices)[x], vertex_position);
+ p_rendering_server_handler->set_normal((*vs_indices)[x], vertex_normal);
}
}
@@ -112,7 +112,7 @@ void SoftBodyBullet::update_visual_server(SoftBodyVisualServerHandler *p_visual_
B_TO_G(aabb_min, aabb.position);
B_TO_G(size, aabb.size);
- p_visual_server_handler->set_aabb(aabb);
+ p_rendering_server_handler->set_aabb(aabb);
}
void SoftBodyBullet::set_soft_mesh(const Ref<Mesh> &p_mesh) {
@@ -129,8 +129,8 @@ void SoftBodyBullet::set_soft_mesh(const Ref<Mesh> &p_mesh) {
}
Array arrays = soft_mesh->surface_get_arrays(0);
- ERR_FAIL_COND(!(soft_mesh->surface_get_format(0) & VS::ARRAY_FORMAT_INDEX));
- set_trimesh_body_shape(arrays[VS::ARRAY_INDEX], arrays[VS::ARRAY_VERTEX]);
+ ERR_FAIL_COND(!(soft_mesh->surface_get_format(0) & RS::ARRAY_FORMAT_INDEX));
+ set_trimesh_body_shape(arrays[RS::ARRAY_INDEX], arrays[RS::ARRAY_VERTEX]);
}
void SoftBodyBullet::destroy_soft_body() {
@@ -184,7 +184,7 @@ void SoftBodyBullet::get_node_offset(int p_node_index, Vector3 &r_offset) const
return;
Array arrays = soft_mesh->surface_get_arrays(0);
- Vector<Vector3> vertices(arrays[VS::ARRAY_VERTEX]);
+ Vector<Vector3> vertices(arrays[RS::ARRAY_VERTEX]);
if (0 <= p_node_index && vertices.size() > p_node_index) {
r_offset = vertices[p_node_index];
@@ -230,7 +230,7 @@ void SoftBodyBullet::reset_all_node_positions() {
return;
Array arrays = soft_mesh->surface_get_arrays(0);
- Vector<Vector3> vs_vertices(arrays[VS::ARRAY_VERTEX]);
+ Vector<Vector3> vs_vertices(arrays[RS::ARRAY_VERTEX]);
const Vector3 *vs_vertices_read = vs_vertices.ptr();
for (int vertex_index = bt_soft_body->m_nodes.size() - 1; 0 <= vertex_index; --vertex_index) {
diff --git a/modules/bullet/soft_body_bullet.h b/modules/bullet/soft_body_bullet.h
index 05d7e6ce3f..3c6871e0d6 100644
--- a/modules/bullet/soft_body_bullet.h
+++ b/modules/bullet/soft_body_bullet.h
@@ -43,7 +43,7 @@
#include "BulletSoftBody/btSoftBodyHelpers.h"
#include "collision_object_bullet.h"
#include "scene/resources/mesh.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#ifdef x11_None
/// This is required to re add the macro None defined by x11 compiler
@@ -100,7 +100,7 @@ public:
_FORCE_INLINE_ btSoftBody *get_bt_soft_body() const { return bt_soft_body; }
- void update_visual_server(class SoftBodyVisualServerHandler *p_visual_server_handler);
+ void update_rendering_server(class SoftBodyRenderingServerHandler *p_rendering_server_handler);
void set_soft_mesh(const Ref<Mesh> &p_mesh);
void destroy_soft_body();
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index f6df97f11d..c40a1500f0 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -39,7 +39,7 @@
#include "godot_collision_configuration.h"
#include "godot_collision_dispatcher.h"
#include "rigid_body_bullet.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include "soft_body_bullet.h"
#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
@@ -59,7 +59,7 @@
*/
BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) :
- PhysicsDirectSpaceState(),
+ PhysicsDirectSpaceState3D(),
space(p_space) {}
int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
@@ -366,27 +366,27 @@ void SpaceBullet::step(real_t p_delta_time) {
dynamicsWorld->stepSimulation(p_delta_time, 0, 0);
}
-void SpaceBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant &p_value) {
+void SpaceBullet::set_param(PhysicsServer3D::AreaParameter p_param, const Variant &p_value) {
assert(dynamicsWorld);
switch (p_param) {
- case PhysicsServer::AREA_PARAM_GRAVITY:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY:
gravityMagnitude = p_value;
update_gravity();
break;
- case PhysicsServer::AREA_PARAM_GRAVITY_VECTOR:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR:
gravityDirection = p_value;
update_gravity();
break;
- case PhysicsServer::AREA_PARAM_LINEAR_DAMP:
- case PhysicsServer::AREA_PARAM_ANGULAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_LINEAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP:
break; // No damp
- case PhysicsServer::AREA_PARAM_PRIORITY:
+ case PhysicsServer3D::AREA_PARAM_PRIORITY:
// Priority is always 0, the lower
break;
- case PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT:
- case PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
- case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
break;
default:
WARN_PRINT("This set parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
@@ -394,22 +394,22 @@ void SpaceBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant
}
}
-Variant SpaceBullet::get_param(PhysicsServer::AreaParameter p_param) {
+Variant SpaceBullet::get_param(PhysicsServer3D::AreaParameter p_param) {
switch (p_param) {
- case PhysicsServer::AREA_PARAM_GRAVITY:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY:
return gravityMagnitude;
- case PhysicsServer::AREA_PARAM_GRAVITY_VECTOR:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR:
return gravityDirection;
- case PhysicsServer::AREA_PARAM_LINEAR_DAMP:
- case PhysicsServer::AREA_PARAM_ANGULAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_LINEAR_DAMP:
+ case PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP:
return 0; // No damp
- case PhysicsServer::AREA_PARAM_PRIORITY:
+ case PhysicsServer3D::AREA_PARAM_PRIORITY:
return 0; // Priority is always 0, the lower
- case PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT:
return false;
- case PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE:
return 0;
- case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
return 0;
default:
WARN_PRINT("This get parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
@@ -417,32 +417,32 @@ Variant SpaceBullet::get_param(PhysicsServer::AreaParameter p_param) {
}
}
-void SpaceBullet::set_param(PhysicsServer::SpaceParameter p_param, real_t p_value) {
+void SpaceBullet::set_param(PhysicsServer3D::SpaceParameter p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS:
- case PhysicsServer::SPACE_PARAM_CONTACT_MAX_SEPARATION:
- case PhysicsServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION:
- case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD:
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD:
- case PhysicsServer::SPACE_PARAM_BODY_TIME_TO_SLEEP:
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO:
- case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS:
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_RECYCLE_RADIUS:
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_MAX_SEPARATION:
+ case PhysicsServer3D::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION:
+ case PhysicsServer3D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD:
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD:
+ case PhysicsServer3D::SPACE_PARAM_BODY_TIME_TO_SLEEP:
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO:
+ case PhysicsServer3D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS:
default:
WARN_PRINT("This set parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
break;
}
}
-real_t SpaceBullet::get_param(PhysicsServer::SpaceParameter p_param) {
+real_t SpaceBullet::get_param(PhysicsServer3D::SpaceParameter p_param) {
switch (p_param) {
- case PhysicsServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS:
- case PhysicsServer::SPACE_PARAM_CONTACT_MAX_SEPARATION:
- case PhysicsServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION:
- case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD:
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD:
- case PhysicsServer::SPACE_PARAM_BODY_TIME_TO_SLEEP:
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO:
- case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS:
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_RECYCLE_RADIUS:
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_MAX_SEPARATION:
+ case PhysicsServer3D::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION:
+ case PhysicsServer3D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD:
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD:
+ case PhysicsServer3D::SPACE_PARAM_BODY_TIME_TO_SLEEP:
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO:
+ case PhysicsServer3D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS:
default:
WARN_PRINT("The SpaceBullet doesn't support this get parameter (" + itos(p_param) + "), 0 is returned.");
return 0.f;
@@ -891,7 +891,7 @@ static Ref<StandardMaterial3D> red_mat;
static Ref<StandardMaterial3D> blue_mat;
#endif
-bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, PhysicsServer::MotionResult *r_result, bool p_exclude_raycast_shapes) {
+bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, PhysicsServer3D::MotionResult *r_result, bool p_exclude_raycast_shapes) {
#if debug_test_motion
/// Yes I know this is not good, but I've used it as fast debugging hack.
@@ -1042,7 +1042,7 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
return has_penetration;
}
-int SpaceBullet::test_ray_separation(RigidBodyBullet *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer::SeparationResult *r_results, int p_result_max, float p_margin) {
+int SpaceBullet::test_ray_separation(RigidBodyBullet *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer3D::SeparationResult *r_results, int p_result_max, float p_margin) {
btTransform body_transform;
G_TO_B(p_transform, body_transform);
@@ -1054,7 +1054,7 @@ int SpaceBullet::test_ray_separation(RigidBodyBullet *p_body, const Transform &p
int rays_found_this_round = 0;
for (int t(RECOVERING_MOVEMENT_CYCLES); 0 < t; --t) {
- PhysicsServer::SeparationResult *next_results = &r_results[rays_found];
+ PhysicsServer3D::SeparationResult *next_results = &r_results[rays_found];
rays_found_this_round = recover_from_penetration_ray(p_body, body_transform, RECOVERING_MOVEMENT_SCALE, p_infinite_inertia, p_result_max - rays_found, recover_motion, next_results);
rays_found += rays_found_this_round;
@@ -1333,7 +1333,7 @@ bool SpaceBullet::RFP_convex_world_test(const btConvexShape *p_shapeA, const btC
return false;
}
-int SpaceBullet::add_separation_result(PhysicsServer::SeparationResult *r_result, const SpaceBullet::RecoverResult &p_recover_result, int p_shape_id, const btCollisionObject *p_other_object) const {
+int SpaceBullet::add_separation_result(PhysicsServer3D::SeparationResult *r_result, const SpaceBullet::RecoverResult &p_recover_result, int p_shape_id, const btCollisionObject *p_other_object) const {
// optimize results (ignore non-colliding)
if (p_recover_result.penetration_distance < 0.0) {
@@ -1355,7 +1355,7 @@ int SpaceBullet::add_separation_result(PhysicsServer::SeparationResult *r_result
}
}
-int SpaceBullet::recover_from_penetration_ray(RigidBodyBullet *p_body, const btTransform &p_body_position, btScalar p_recover_movement_scale, bool p_infinite_inertia, int p_result_max, btVector3 &r_delta_recover_movement, PhysicsServer::SeparationResult *r_results) {
+int SpaceBullet::recover_from_penetration_ray(RigidBodyBullet *p_body, const btTransform &p_body_position, btScalar p_recover_movement_scale, bool p_infinite_inertia, int p_result_max, btVector3 &r_delta_recover_movement, PhysicsServer3D::SeparationResult *r_results) {
// Calculate the cumulative AABB of all shapes of the kinematic body
btVector3 aabb_min, aabb_max;
diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h
index 32372f1630..fce715b48d 100644
--- a/modules/bullet/space_bullet.h
+++ b/modules/bullet/space_bullet.h
@@ -35,7 +35,7 @@
#include "core/vector.h"
#include "godot_result_callbacks.h"
#include "rid_bullet.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
#include <BulletCollision/BroadphaseCollision/btOverlappingPairCache.h>
@@ -67,8 +67,8 @@ class btGjkEpaPenetrationDepthSolver;
extern ContactAddedCallback gContactAddedCallback;
-class BulletPhysicsDirectSpaceState : public PhysicsDirectSpaceState {
- GDCLASS(BulletPhysicsDirectSpaceState, PhysicsDirectSpaceState);
+class BulletPhysicsDirectSpaceState : public PhysicsDirectSpaceState3D {
+ GDCLASS(BulletPhysicsDirectSpaceState, PhysicsDirectSpaceState3D);
private:
SpaceBullet *space;
@@ -131,15 +131,15 @@ public:
/// @param p_param:
/// AREA_PARAM_GRAVITY to set the gravity magnitude of entire world
/// AREA_PARAM_GRAVITY_VECTOR to set the gravity direction of entire world
- void set_param(PhysicsServer::AreaParameter p_param, const Variant &p_value);
+ void set_param(PhysicsServer3D::AreaParameter p_param, const Variant &p_value);
/// Used to get some parameters to Bullet world
/// @param p_param:
/// AREA_PARAM_GRAVITY to get the gravity magnitude of entire world
/// AREA_PARAM_GRAVITY_VECTOR to get the gravity direction of entire world
- Variant get_param(PhysicsServer::AreaParameter p_param);
+ Variant get_param(PhysicsServer3D::AreaParameter p_param);
- void set_param(PhysicsServer::SpaceParameter p_param, real_t p_value);
- real_t get_param(PhysicsServer::SpaceParameter p_param);
+ void set_param(PhysicsServer3D::SpaceParameter p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::SpaceParameter p_param);
void add_area(AreaBullet *p_area);
void remove_area(AreaBullet *p_area);
@@ -177,8 +177,8 @@ public:
void update_gravity();
- bool test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, PhysicsServer::MotionResult *r_result, bool p_exclude_raycast_shapes);
- int test_ray_separation(RigidBodyBullet *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer::SeparationResult *r_results, int p_result_max, float p_margin);
+ bool test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, PhysicsServer3D::MotionResult *r_result, bool p_exclude_raycast_shapes);
+ int test_ray_separation(RigidBodyBullet *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer3D::SeparationResult *r_results, int p_result_max, float p_margin);
private:
void create_empty_world(bool p_create_soft_world);
@@ -213,7 +213,7 @@ private:
/// Using this we leave Bullet to select the best algorithm, For example GJK in case we have Convex Convex, or a Bullet accelerated algorithm
bool RFP_convex_world_test(const btConvexShape *p_shapeA, const btCollisionShape *p_shapeB, btCollisionObject *p_objectA, btCollisionObject *p_objectB, int p_shapeId_A, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_recover_movement_scale, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result = NULL);
- int add_separation_result(PhysicsServer::SeparationResult *r_results, const SpaceBullet::RecoverResult &p_recover_result, int p_shape_id, const btCollisionObject *p_other_object) const;
- int recover_from_penetration_ray(RigidBodyBullet *p_body, const btTransform &p_body_position, btScalar p_recover_movement_scale, bool p_infinite_inertia, int p_result_max, btVector3 &r_delta_recover_movement, PhysicsServer::SeparationResult *r_results);
+ int add_separation_result(PhysicsServer3D::SeparationResult *r_results, const SpaceBullet::RecoverResult &p_recover_result, int p_shape_id, const btCollisionObject *p_other_object) const;
+ int recover_from_penetration_ray(RigidBodyBullet *p_body, const btTransform &p_body_position, btScalar p_recover_movement_scale, bool p_infinite_inertia, int p_result_max, btVector3 &r_delta_recover_movement, PhysicsServer3D::SeparationResult *r_results);
};
#endif
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index d052eba41c..848b865efb 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -43,16 +43,16 @@ void CSGShape3D::set_use_collision(bool p_enable) {
if (use_collision) {
root_collision_shape.instance();
- root_collision_instance = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
- PhysicsServer::get_singleton()->body_set_state(root_collision_instance, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
- PhysicsServer::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid());
- PhysicsServer::get_singleton()->body_set_space(root_collision_instance, get_world()->get_space());
- PhysicsServer::get_singleton()->body_attach_object_instance_id(root_collision_instance, get_instance_id());
+ root_collision_instance = PhysicsServer3D::get_singleton()->body_create(PhysicsServer3D::BODY_MODE_STATIC);
+ PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid());
+ PhysicsServer3D::get_singleton()->body_set_space(root_collision_instance, get_world()->get_space());
+ PhysicsServer3D::get_singleton()->body_attach_object_instance_id(root_collision_instance, get_instance_id());
set_collision_layer(collision_layer);
set_collision_mask(collision_mask);
_make_dirty(); //force update
} else {
- PhysicsServer::get_singleton()->free(root_collision_instance);
+ PhysicsServer3D::get_singleton()->free(root_collision_instance);
root_collision_instance = RID();
root_collision_shape.unref();
}
@@ -66,7 +66,7 @@ bool CSGShape3D::is_using_collision() const {
void CSGShape3D::set_collision_layer(uint32_t p_layer) {
collision_layer = p_layer;
if (root_collision_instance.is_valid()) {
- PhysicsServer::get_singleton()->body_set_collision_layer(root_collision_instance, p_layer);
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(root_collision_instance, p_layer);
}
}
@@ -79,7 +79,7 @@ void CSGShape3D::set_collision_mask(uint32_t p_mask) {
collision_mask = p_mask;
if (root_collision_instance.is_valid()) {
- PhysicsServer::get_singleton()->body_set_collision_mask(root_collision_instance, p_mask);
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(root_collision_instance, p_mask);
}
}
@@ -506,11 +506,11 @@ void CSGShape3D::_notification(int p_what) {
if (use_collision && is_root_shape()) {
root_collision_shape.instance();
- root_collision_instance = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
- PhysicsServer::get_singleton()->body_set_state(root_collision_instance, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
- PhysicsServer::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid());
- PhysicsServer::get_singleton()->body_set_space(root_collision_instance, get_world()->get_space());
- PhysicsServer::get_singleton()->body_attach_object_instance_id(root_collision_instance, get_instance_id());
+ root_collision_instance = PhysicsServer3D::get_singleton()->body_create(PhysicsServer3D::BODY_MODE_STATIC);
+ PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid());
+ PhysicsServer3D::get_singleton()->body_set_space(root_collision_instance, get_world()->get_space());
+ PhysicsServer3D::get_singleton()->body_attach_object_instance_id(root_collision_instance, get_instance_id());
set_collision_layer(collision_layer);
set_collision_mask(collision_mask);
}
@@ -539,7 +539,7 @@ void CSGShape3D::_notification(int p_what) {
parent = NULL;
if (use_collision && is_root_shape() && root_collision_instance.is_valid()) {
- PhysicsServer::get_singleton()->free(root_collision_instance);
+ PhysicsServer3D::get_singleton()->free(root_collision_instance);
root_collision_instance = RID();
root_collision_shape.unref();
}
diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp
index 0f0c864df2..faa891e624 100644
--- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp
+++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp
@@ -31,7 +31,7 @@
#include "arvr_interface_gdnative.h"
#include "core/input/input_filter.h"
#include "servers/arvr/arvr_positional_tracker.h"
-#include "servers/visual/visual_server_globals.h"
+#include "servers/rendering/rendering_server_globals.h"
void ARVRInterfaceGDNative::_bind_methods() {
ADD_PROPERTY_DEFAULT("interface_is_initialized", false);
@@ -292,7 +292,7 @@ void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_re
#warning this needs to be redone
#endif
#if 0
- VSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0);
+ RSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0);
#endif
}
@@ -302,13 +302,13 @@ godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) {
#if 0
RID *render_target = (RID *)p_render_target;
- RID eye_texture = VSG::storage->render_target_get_texture(*render_target);
+ RID eye_texture = RSG::storage->render_target_get_texture(*render_target);
#endif
#ifndef _MSC_VER
#warning need to obtain this ID again
#endif
- uint32_t texid = 0; //VS::get_singleton()->texture_get_texid(eye_texture);
+ uint32_t texid = 0; //RS::get_singleton()->texture_get_texid(eye_texture);
return texid;
}
diff --git a/modules/gdnavigation/gd_navigation_server.cpp b/modules/gdnavigation/gd_navigation_server.cpp
index a1f6ddfedc..cade6c8a6d 100644
--- a/modules/gdnavigation/gd_navigation_server.cpp
+++ b/modules/gdnavigation/gd_navigation_server.cpp
@@ -114,7 +114,7 @@
void GdNavigationServer::MERGE(_cmd_, F_NAME)(T_0 D_0, T_1 D_1, T_2 D_2, T_3 D_3)
GdNavigationServer::GdNavigationServer() :
- NavigationServer(),
+ NavigationServer3D(),
active(true) {
}
diff --git a/modules/gdnavigation/gd_navigation_server.h b/modules/gdnavigation/gd_navigation_server.h
index e9f5c1ffe6..01d1a4fba9 100644
--- a/modules/gdnavigation/gd_navigation_server.h
+++ b/modules/gdnavigation/gd_navigation_server.h
@@ -33,7 +33,7 @@
#include "core/rid.h"
#include "core/rid_owner.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
#include "nav_map.h"
#include "nav_region.h"
@@ -67,7 +67,7 @@ struct SetCommand {
virtual void exec(GdNavigationServer *server) = 0;
};
-class GdNavigationServer : public NavigationServer {
+class GdNavigationServer : public NavigationServer3D {
Mutex commands_mutex;
/// Mutex used to make any operation threadsafe.
Mutex operations_mutex;
diff --git a/modules/gdnavigation/register_types.cpp b/modules/gdnavigation/register_types.cpp
index d717733787..9965a89fde 100644
--- a/modules/gdnavigation/register_types.cpp
+++ b/modules/gdnavigation/register_types.cpp
@@ -32,7 +32,7 @@
#include "core/engine.h"
#include "gd_navigation_server.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
#ifndef _3D_DISABLED
#include "navigation_mesh_generator.h"
@@ -50,12 +50,12 @@
NavigationMeshGenerator *_nav_mesh_generator = NULL;
#endif
-NavigationServer *new_server() {
+NavigationServer3D *new_server() {
return memnew(GdNavigationServer);
}
void register_gdnavigation_types() {
- NavigationServerManager::set_default_server(new_server);
+ NavigationServer3DManager::set_default_server(new_server);
#ifndef _3D_DISABLED
_nav_mesh_generator = memnew(NavigationMeshGenerator);
diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp
index d2b4a18fc7..2540ba476c 100644
--- a/modules/glslang/register_types.cpp
+++ b/modules/glslang/register_types.cpp
@@ -30,7 +30,7 @@
#include "register_types.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rendering_device.h"
#include <SPIRV/GlslangToSpv.h>
#include <glslang/Include/Types.h>
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 61f18fbfee..35c214d3cf 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -36,8 +36,8 @@
#include "scene/resources/mesh_library.h"
#include "scene/resources/surface_tool.h"
#include "scene/scene_string_names.h"
-#include "servers/navigation_server.h"
-#include "servers/visual_server.h"
+#include "servers/navigation_server_3d.h"
+#include "servers/rendering_server.h"
bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
@@ -76,12 +76,12 @@ bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
BakedMesh bm;
bm.mesh = meshes[i];
ERR_CONTINUE(!bm.mesh.is_valid());
- bm.instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->get_singleton()->instance_set_base(bm.instance, bm.mesh->get_rid());
- VS::get_singleton()->instance_attach_object_instance_id(bm.instance, get_instance_id());
+ bm.instance = RS::get_singleton()->instance_create();
+ RS::get_singleton()->get_singleton()->instance_set_base(bm.instance, bm.mesh->get_rid());
+ RS::get_singleton()->instance_attach_object_instance_id(bm.instance, get_instance_id());
if (is_inside_tree()) {
- VS::get_singleton()->instance_set_scenario(bm.instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(bm.instance, get_global_transform());
+ RS::get_singleton()->instance_set_scenario(bm.instance, get_world()->get_scenario());
+ RS::get_singleton()->instance_set_transform(bm.instance, get_global_transform());
}
baked_meshes.push_back(bm);
}
@@ -306,17 +306,17 @@ void GridMap::set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot) {
//create octant because it does not exist
Octant *g = memnew(Octant);
g->dirty = true;
- g->static_body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
- PhysicsServer::get_singleton()->body_attach_object_instance_id(g->static_body, get_instance_id());
- PhysicsServer::get_singleton()->body_set_collision_layer(g->static_body, collision_layer);
- PhysicsServer::get_singleton()->body_set_collision_mask(g->static_body, collision_mask);
+ g->static_body = PhysicsServer3D::get_singleton()->body_create(PhysicsServer3D::BODY_MODE_STATIC);
+ PhysicsServer3D::get_singleton()->body_attach_object_instance_id(g->static_body, get_instance_id());
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(g->static_body, collision_layer);
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(g->static_body, collision_mask);
SceneTree *st = SceneTree::get_singleton();
if (st && st->is_debugging_collisions_hint()) {
- g->collision_debug = VisualServer::get_singleton()->mesh_create();
- g->collision_debug_instance = VisualServer::get_singleton()->instance_create();
- VisualServer::get_singleton()->instance_set_base(g->collision_debug_instance, g->collision_debug);
+ g->collision_debug = RenderingServer::get_singleton()->mesh_create();
+ g->collision_debug_instance = RenderingServer::get_singleton()->instance_create();
+ RenderingServer::get_singleton()->instance_set_base(g->collision_debug_instance, g->collision_debug);
}
octant_map[octantkey] = g;
@@ -392,14 +392,14 @@ void GridMap::_octant_transform(const OctantKey &p_key) {
ERR_FAIL_COND(!octant_map.has(p_key));
Octant &g = *octant_map[p_key];
- PhysicsServer::get_singleton()->body_set_state(g.static_body, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_set_state(g.static_body, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
if (g.collision_debug_instance.is_valid()) {
- VS::get_singleton()->instance_set_transform(g.collision_debug_instance, get_global_transform());
+ RS::get_singleton()->instance_set_transform(g.collision_debug_instance, get_global_transform());
}
for (int i = 0; i < g.multimesh_instances.size(); i++) {
- VS::get_singleton()->instance_set_transform(g.multimesh_instances[i].instance, get_global_transform());
+ RS::get_singleton()->instance_set_transform(g.multimesh_instances[i].instance, get_global_transform());
}
}
@@ -410,17 +410,17 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
return false;
//erase body shapes
- PhysicsServer::get_singleton()->body_clear_shapes(g.static_body);
+ PhysicsServer3D::get_singleton()->body_clear_shapes(g.static_body);
//erase body shapes debug
if (g.collision_debug.is_valid()) {
- VS::get_singleton()->mesh_clear(g.collision_debug);
+ RS::get_singleton()->mesh_clear(g.collision_debug);
}
//erase navigation
for (Map<IndexKey, Octant::NavMesh>::Element *E = g.navmesh_ids.front(); E; E = E->next()) {
- NavigationServer::get_singleton()->free(E->get().region);
+ NavigationServer3D::get_singleton()->free(E->get().region);
}
g.navmesh_ids.clear();
@@ -428,8 +428,8 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
for (int i = 0; i < g.multimesh_instances.size(); i++) {
- VS::get_singleton()->free(g.multimesh_instances[i].instance);
- VS::get_singleton()->free(g.multimesh_instances[i].multimesh);
+ RS::get_singleton()->free(g.multimesh_instances[i].instance);
+ RS::get_singleton()->free(g.multimesh_instances[i].multimesh);
}
g.multimesh_instances.clear();
@@ -484,7 +484,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
// add the item's shape
if (!shapes[i].shape.is_valid())
continue;
- PhysicsServer::get_singleton()->body_add_shape(g.static_body, shapes[i].shape->get_rid(), xform * shapes[i].local_transform);
+ PhysicsServer3D::get_singleton()->body_add_shape(g.static_body, shapes[i].shape->get_rid(), xform * shapes[i].local_transform);
if (g.collision_debug.is_valid()) {
shapes.write[i].shape->add_vertices_to_array(col_debug, xform * shapes[i].local_transform);
}
@@ -497,10 +497,10 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
nm.xform = xform * mesh_library->get_item_navmesh_transform(c.item);
if (navigation) {
- RID region = NavigationServer::get_singleton()->region_create();
- NavigationServer::get_singleton()->region_set_navmesh(region, navmesh);
- NavigationServer::get_singleton()->region_set_transform(region, navigation->get_global_transform() * nm.xform);
- NavigationServer::get_singleton()->region_set_map(region, navigation->get_rid());
+ RID region = NavigationServer3D::get_singleton()->region_create();
+ NavigationServer3D::get_singleton()->region_set_navmesh(region, navmesh);
+ NavigationServer3D::get_singleton()->region_set_transform(region, navigation->get_global_transform() * nm.xform);
+ NavigationServer3D::get_singleton()->region_set_map(region, navigation->get_rid());
nm.region = region;
}
g.navmesh_ids[E->get()] = nm;
@@ -513,13 +513,13 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
for (Map<int, List<Pair<Transform, IndexKey>>>::Element *E = multimesh_items.front(); E; E = E->next()) {
Octant::MultimeshInstance mmi;
- RID mm = VS::get_singleton()->multimesh_create();
- VS::get_singleton()->multimesh_allocate(mm, E->get().size(), VS::MULTIMESH_TRANSFORM_3D);
- VS::get_singleton()->multimesh_set_mesh(mm, mesh_library->get_item_mesh(E->key())->get_rid());
+ RID mm = RS::get_singleton()->multimesh_create();
+ RS::get_singleton()->multimesh_allocate(mm, E->get().size(), RS::MULTIMESH_TRANSFORM_3D);
+ RS::get_singleton()->multimesh_set_mesh(mm, mesh_library->get_item_mesh(E->key())->get_rid());
int idx = 0;
for (List<Pair<Transform, IndexKey>>::Element *F = E->get().front(); F; F = F->next()) {
- VS::get_singleton()->multimesh_instance_set_transform(mm, idx, F->get().first);
+ RS::get_singleton()->multimesh_instance_set_transform(mm, idx, F->get().first);
#ifdef TOOLS_ENABLED
Octant::MultimeshInstance::Item it;
@@ -532,12 +532,12 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
idx++;
}
- RID instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(instance, mm);
+ RID instance = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(instance, mm);
if (is_inside_tree()) {
- VS::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(instance, get_global_transform());
+ RS::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario());
+ RS::get_singleton()->instance_set_transform(instance, get_global_transform());
}
mmi.multimesh = mm;
@@ -550,13 +550,13 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
if (col_debug.size()) {
Array arr;
- arr.resize(VS::ARRAY_MAX);
- arr[VS::ARRAY_VERTEX] = col_debug;
+ arr.resize(RS::ARRAY_MAX);
+ arr[RS::ARRAY_VERTEX] = col_debug;
- VS::get_singleton()->mesh_add_surface_from_arrays(g.collision_debug, VS::PRIMITIVE_LINES, arr);
+ RS::get_singleton()->mesh_add_surface_from_arrays(g.collision_debug, RS::PRIMITIVE_LINES, arr);
SceneTree *st = SceneTree::get_singleton();
if (st) {
- VS::get_singleton()->mesh_surface_set_material(g.collision_debug, 0, st->get_debug_collision_material()->get_rid());
+ RS::get_singleton()->mesh_surface_set_material(g.collision_debug, 0, st->get_debug_collision_material()->get_rid());
}
}
@@ -567,8 +567,8 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
void GridMap::_reset_physic_bodies_collision_filters() {
for (Map<OctantKey, Octant *>::Element *E = octant_map.front(); E; E = E->next()) {
- PhysicsServer::get_singleton()->body_set_collision_layer(E->get()->static_body, collision_layer);
- PhysicsServer::get_singleton()->body_set_collision_mask(E->get()->static_body, collision_mask);
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(E->get()->static_body, collision_layer);
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(E->get()->static_body, collision_mask);
}
}
@@ -576,17 +576,17 @@ void GridMap::_octant_enter_world(const OctantKey &p_key) {
ERR_FAIL_COND(!octant_map.has(p_key));
Octant &g = *octant_map[p_key];
- PhysicsServer::get_singleton()->body_set_state(g.static_body, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
- PhysicsServer::get_singleton()->body_set_space(g.static_body, get_world()->get_space());
+ PhysicsServer3D::get_singleton()->body_set_state(g.static_body, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_set_space(g.static_body, get_world()->get_space());
if (g.collision_debug_instance.is_valid()) {
- VS::get_singleton()->instance_set_scenario(g.collision_debug_instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(g.collision_debug_instance, get_global_transform());
+ RS::get_singleton()->instance_set_scenario(g.collision_debug_instance, get_world()->get_scenario());
+ RS::get_singleton()->instance_set_transform(g.collision_debug_instance, get_global_transform());
}
for (int i = 0; i < g.multimesh_instances.size(); i++) {
- VS::get_singleton()->instance_set_scenario(g.multimesh_instances[i].instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(g.multimesh_instances[i].instance, get_global_transform());
+ RS::get_singleton()->instance_set_scenario(g.multimesh_instances[i].instance, get_world()->get_scenario());
+ RS::get_singleton()->instance_set_transform(g.multimesh_instances[i].instance, get_global_transform());
}
if (navigation && mesh_library.is_valid()) {
@@ -595,10 +595,10 @@ void GridMap::_octant_enter_world(const OctantKey &p_key) {
if (cell_map.has(F->key()) && F->get().region.is_valid() == false) {
Ref<NavigationMesh> nm = mesh_library->get_item_navmesh(cell_map[F->key()].item);
if (nm.is_valid()) {
- RID region = NavigationServer::get_singleton()->region_create();
- NavigationServer::get_singleton()->region_set_navmesh(region, nm);
- NavigationServer::get_singleton()->region_set_transform(region, navigation->get_global_transform() * F->get().xform);
- NavigationServer::get_singleton()->region_set_map(region, navigation->get_rid());
+ RID region = NavigationServer3D::get_singleton()->region_create();
+ NavigationServer3D::get_singleton()->region_set_navmesh(region, nm);
+ NavigationServer3D::get_singleton()->region_set_transform(region, navigation->get_global_transform() * F->get().xform);
+ NavigationServer3D::get_singleton()->region_set_map(region, navigation->get_rid());
F->get().region = region;
}
}
@@ -610,23 +610,23 @@ void GridMap::_octant_exit_world(const OctantKey &p_key) {
ERR_FAIL_COND(!octant_map.has(p_key));
Octant &g = *octant_map[p_key];
- PhysicsServer::get_singleton()->body_set_state(g.static_body, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
- PhysicsServer::get_singleton()->body_set_space(g.static_body, RID());
+ PhysicsServer3D::get_singleton()->body_set_state(g.static_body, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_set_space(g.static_body, RID());
if (g.collision_debug_instance.is_valid()) {
- VS::get_singleton()->instance_set_scenario(g.collision_debug_instance, RID());
+ RS::get_singleton()->instance_set_scenario(g.collision_debug_instance, RID());
}
for (int i = 0; i < g.multimesh_instances.size(); i++) {
- VS::get_singleton()->instance_set_scenario(g.multimesh_instances[i].instance, RID());
+ RS::get_singleton()->instance_set_scenario(g.multimesh_instances[i].instance, RID());
}
if (navigation) {
for (Map<IndexKey, Octant::NavMesh>::Element *F = g.navmesh_ids.front(); F; F = F->next()) {
if (F->get().region.is_valid()) {
- NavigationServer::get_singleton()->free(F->get().region);
+ NavigationServer3D::get_singleton()->free(F->get().region);
F->get().region = RID();
}
}
@@ -639,15 +639,15 @@ void GridMap::_octant_clean_up(const OctantKey &p_key) {
Octant &g = *octant_map[p_key];
if (g.collision_debug.is_valid())
- VS::get_singleton()->free(g.collision_debug);
+ RS::get_singleton()->free(g.collision_debug);
if (g.collision_debug_instance.is_valid())
- VS::get_singleton()->free(g.collision_debug_instance);
+ RS::get_singleton()->free(g.collision_debug_instance);
- PhysicsServer::get_singleton()->free(g.static_body);
+ PhysicsServer3D::get_singleton()->free(g.static_body);
// Erase navigation
for (Map<IndexKey, Octant::NavMesh>::Element *E = g.navmesh_ids.front(); E; E = E->next()) {
- NavigationServer::get_singleton()->free(E->get().region);
+ NavigationServer3D::get_singleton()->free(E->get().region);
}
g.navmesh_ids.clear();
@@ -655,8 +655,8 @@ void GridMap::_octant_clean_up(const OctantKey &p_key) {
for (int i = 0; i < g.multimesh_instances.size(); i++) {
- VS::get_singleton()->free(g.multimesh_instances[i].instance);
- VS::get_singleton()->free(g.multimesh_instances[i].multimesh);
+ RS::get_singleton()->free(g.multimesh_instances[i].instance);
+ RS::get_singleton()->free(g.multimesh_instances[i].multimesh);
}
g.multimesh_instances.clear();
}
@@ -684,8 +684,8 @@ void GridMap::_notification(int p_what) {
}
for (int i = 0; i < baked_meshes.size(); i++) {
- VS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
+ RS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, get_world()->get_scenario());
+ RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
}
} break;
@@ -702,7 +702,7 @@ void GridMap::_notification(int p_what) {
last_transform = new_xform;
for (int i = 0; i < baked_meshes.size(); i++) {
- VS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
+ RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
}
} break;
@@ -718,7 +718,7 @@ void GridMap::_notification(int p_what) {
//_update_octants_callback();
//_update_area_instances();
for (int i = 0; i < baked_meshes.size(); i++) {
- VS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, RID());
+ RS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, RID());
}
} break;
@@ -738,7 +738,7 @@ void GridMap::_update_visibility() {
Octant *octant = e->value();
for (int i = 0; i < octant->multimesh_instances.size(); i++) {
const Octant::MultimeshInstance &mi = octant->multimesh_instances[i];
- VS::get_singleton()->instance_set_visible(mi.instance, is_visible());
+ RS::get_singleton()->instance_set_visible(mi.instance, is_visible());
}
}
}
@@ -975,7 +975,7 @@ Vector3 GridMap::_get_offset() const {
void GridMap::clear_baked_meshes() {
for (int i = 0; i < baked_meshes.size(); i++) {
- VS::get_singleton()->free(baked_meshes[i].instance);
+ RS::get_singleton()->free(baked_meshes[i].instance);
}
baked_meshes.clear();
@@ -1050,12 +1050,12 @@ void GridMap::make_baked_meshes(bool p_gen_lightmap_uv, float p_lightmap_uv_texe
BakedMesh bm;
bm.mesh = mesh;
- bm.instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->get_singleton()->instance_set_base(bm.instance, bm.mesh->get_rid());
- VS::get_singleton()->instance_attach_object_instance_id(bm.instance, get_instance_id());
+ bm.instance = RS::get_singleton()->instance_create();
+ RS::get_singleton()->get_singleton()->instance_set_base(bm.instance, bm.mesh->get_rid());
+ RS::get_singleton()->instance_attach_object_instance_id(bm.instance, get_instance_id());
if (is_inside_tree()) {
- VS::get_singleton()->instance_set_scenario(bm.instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(bm.instance, get_global_transform());
+ RS::get_singleton()->instance_set_scenario(bm.instance, get_world()->get_scenario());
+ RS::get_singleton()->instance_set_transform(bm.instance, get_global_transform());
}
if (p_gen_lightmap_uv) {
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 43f4c09715..3f3da09fe9 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -166,10 +166,10 @@ class GridMap : public Node3D {
struct BakeLight {
- VS::LightType type;
+ RS::LightType type;
Vector3 pos;
Vector3 dir;
- float param[VS::LIGHT_PARAM_MAX];
+ float param[RS::LIGHT_PARAM_MAX];
};
_FORCE_INLINE_ Vector3 _octant_get_offset(const OctantKey &p_key) const {
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index a2479e764f..4a6cb8762f 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -281,8 +281,8 @@ void GridMapEditor::_update_cursor_transform() {
cursor_transform = node->get_global_transform() * cursor_transform;
if (cursor_instance.is_valid()) {
- VisualServer::get_singleton()->instance_set_transform(cursor_instance, cursor_transform);
- VisualServer::get_singleton()->instance_set_visible(cursor_instance, cursor_visible);
+ RenderingServer::get_singleton()->instance_set_transform(cursor_instance, cursor_transform);
+ RenderingServer::get_singleton()->instance_set_visible(cursor_instance, cursor_visible);
}
}
@@ -292,9 +292,9 @@ void GridMapEditor::_update_selection_transform() {
if (!selection.active) {
- VisualServer::get_singleton()->instance_set_transform(selection_instance, xf_zero);
+ RenderingServer::get_singleton()->instance_set_transform(selection_instance, xf_zero);
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf_zero);
+ RenderingServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf_zero);
}
return;
}
@@ -303,11 +303,11 @@ void GridMapEditor::_update_selection_transform() {
xf.scale((Vector3(1, 1, 1) + (selection.end - selection.begin)) * node->get_cell_size());
xf.origin = selection.begin * node->get_cell_size();
- VisualServer::get_singleton()->instance_set_transform(selection_instance, node->get_global_transform() * xf);
+ RenderingServer::get_singleton()->instance_set_transform(selection_instance, node->get_global_transform() * xf);
for (int i = 0; i < 3; i++) {
if (i != edit_axis || (edit_floor[edit_axis] < selection.begin[edit_axis]) || (edit_floor[edit_axis] > selection.end[edit_axis] + 1)) {
- VisualServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf_zero);
+ RenderingServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf_zero);
} else {
Vector3 scale = (selection.end - selection.begin + Vector3(1, 1, 1));
@@ -322,7 +322,7 @@ void GridMapEditor::_update_selection_transform() {
xf2.basis.scale(scale);
xf2.origin = pos;
- VisualServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf2);
+ RenderingServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf2);
}
}
}
@@ -416,7 +416,7 @@ bool GridMapEditor::do_input_action(Camera3D *p_camera, const Point2 &p_point, b
}
}
- VS::get_singleton()->instance_set_transform(grid_instance[edit_axis], node->get_global_transform() * edit_grid_xform);
+ RS::get_singleton()->instance_set_transform(grid_instance[edit_axis], node->get_global_transform() * edit_grid_xform);
if (cursor_instance.is_valid()) {
@@ -528,7 +528,7 @@ void GridMapEditor::_clear_clipboard_data() {
for (List<ClipboardItem>::Element *E = clipboard_items.front(); E; E = E->next()) {
- VisualServer::get_singleton()->free(E->get().instance);
+ RenderingServer::get_singleton()->free(E->get().instance);
}
clipboard_items.clear();
@@ -556,7 +556,7 @@ void GridMapEditor::_set_clipboard_data() {
item.cell_item = itm;
item.grid_offset = Vector3(i, j, k) - selection.begin;
item.orientation = node->get_cell_item_orientation(i, j, k);
- item.instance = VisualServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world()->get_scenario());
+ item.instance = RenderingServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world()->get_scenario());
clipboard_items.push_back(item);
}
@@ -570,7 +570,7 @@ void GridMapEditor::_update_paste_indicator() {
Transform xf;
xf.basis.set_zero();
- VisualServer::get_singleton()->instance_set_transform(paste_instance, xf);
+ RenderingServer::get_singleton()->instance_set_transform(paste_instance, xf);
return;
}
@@ -584,7 +584,7 @@ void GridMapEditor::_update_paste_indicator() {
xf.basis = rot * xf.basis;
xf.translate((-center * node->get_cell_size()) / scale);
- VisualServer::get_singleton()->instance_set_transform(paste_instance, node->get_global_transform() * xf);
+ RenderingServer::get_singleton()->instance_set_transform(paste_instance, node->get_global_transform() * xf);
for (List<ClipboardItem>::Element *E = clipboard_items.front(); E; E = E->next()) {
@@ -599,7 +599,7 @@ void GridMapEditor::_update_paste_indicator() {
item_rot.set_orthogonal_index(item.orientation);
xf.basis = item_rot * xf.basis * node->get_cell_scale();
- VisualServer::get_singleton()->instance_set_transform(item.instance, node->get_global_transform() * xf);
+ RenderingServer::get_singleton()->instance_set_transform(item.instance, node->get_global_transform() * xf);
}
}
@@ -969,11 +969,11 @@ void GridMapEditor::edit(GridMap *p_gridmap) {
if (!node) {
set_process(false);
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], false);
}
if (cursor_instance.is_valid()) {
- VisualServer::get_singleton()->instance_set_visible(cursor_instance, false);
+ RenderingServer::get_singleton()->instance_set_visible(cursor_instance, false);
}
return;
@@ -1011,7 +1011,7 @@ void GridMapEditor::update_grid() {
edit_grid_xform.basis = Basis();
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], i == edit_axis);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], i == edit_axis);
}
updating = true;
@@ -1023,7 +1023,7 @@ void GridMapEditor::_draw_grids(const Vector3 &cell_size) {
Vector3 edited_floor = node->has_meta("_editor_floor_") ? node->get_meta("_editor_floor_") : Variant();
for (int i = 0; i < 3; i++) {
- VS::get_singleton()->mesh_clear(grid[i]);
+ RS::get_singleton()->mesh_clear(grid[i]);
edit_floor[i] = edited_floor[i];
}
@@ -1065,11 +1065,11 @@ void GridMapEditor::_draw_grids(const Vector3 &cell_size) {
}
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VS::ARRAY_VERTEX] = grid_points[i];
- d[VS::ARRAY_COLOR] = grid_colors[i];
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], VisualServer::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid());
+ d.resize(RS::ARRAY_MAX);
+ d[RS::ARRAY_VERTEX] = grid_points[i];
+ d[RS::ARRAY_COLOR] = grid_colors[i];
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], RenderingServer::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid());
}
}
@@ -1082,13 +1082,13 @@ void GridMapEditor::_notification(int p_what) {
mesh_library_palette->connect("item_selected", callable_mp(this, &GridMapEditor::_item_selected_cbk));
for (int i = 0; i < 3; i++) {
- grid[i] = VS::get_singleton()->mesh_create();
- grid_instance[i] = VS::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario());
- selection_level_instance[i] = VisualServer::get_singleton()->instance_create2(selection_level_mesh[i], get_tree()->get_root()->get_world()->get_scenario());
+ grid[i] = RS::get_singleton()->mesh_create();
+ grid_instance[i] = RS::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario());
+ selection_level_instance[i] = RenderingServer::get_singleton()->instance_create2(selection_level_mesh[i], get_tree()->get_root()->get_world()->get_scenario());
}
- selection_instance = VisualServer::get_singleton()->instance_create2(selection_mesh, get_tree()->get_root()->get_world()->get_scenario());
- paste_instance = VisualServer::get_singleton()->instance_create2(paste_mesh, get_tree()->get_root()->get_world()->get_scenario());
+ selection_instance = RenderingServer::get_singleton()->instance_create2(selection_mesh, get_tree()->get_root()->get_world()->get_scenario());
+ paste_instance = RenderingServer::get_singleton()->instance_create2(paste_mesh, get_tree()->get_root()->get_world()->get_scenario());
_update_selection_transform();
_update_paste_indicator();
@@ -1100,15 +1100,15 @@ void GridMapEditor::_notification(int p_what) {
for (int i = 0; i < 3; i++) {
- VS::get_singleton()->free(grid_instance[i]);
- VS::get_singleton()->free(grid[i]);
+ RS::get_singleton()->free(grid_instance[i]);
+ RS::get_singleton()->free(grid[i]);
grid_instance[i] = RID();
grid[i] = RID();
- VisualServer::get_singleton()->free(selection_level_instance[i]);
+ RenderingServer::get_singleton()->free(selection_level_instance[i]);
}
- VisualServer::get_singleton()->free(selection_instance);
- VisualServer::get_singleton()->free(paste_instance);
+ RenderingServer::get_singleton()->free(selection_instance);
+ RenderingServer::get_singleton()->free(paste_instance);
selection_instance = RID();
paste_instance = RID();
} break;
@@ -1123,7 +1123,7 @@ void GridMapEditor::_notification(int p_what) {
if (xf != grid_xform) {
for (int i = 0; i < 3; i++) {
- VS::get_singleton()->instance_set_transform(grid_instance[i], xf * edit_grid_xform);
+ RS::get_singleton()->instance_set_transform(grid_instance[i], xf * edit_grid_xform);
}
grid_xform = xf;
}
@@ -1159,7 +1159,7 @@ void GridMapEditor::_update_cursor_instance() {
}
if (cursor_instance.is_valid())
- VisualServer::get_singleton()->free(cursor_instance);
+ RenderingServer::get_singleton()->free(cursor_instance);
cursor_instance = RID();
if (selected_palette >= 0) {
@@ -1168,8 +1168,8 @@ void GridMapEditor::_update_cursor_instance() {
Ref<Mesh> mesh = node->get_mesh_library()->get_item_mesh(selected_palette);
if (!mesh.is_null() && mesh->get_rid().is_valid()) {
- cursor_instance = VisualServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world()->get_scenario());
- VisualServer::get_singleton()->instance_set_transform(cursor_instance, cursor_transform);
+ cursor_instance = RenderingServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world()->get_scenario());
+ RenderingServer::get_singleton()->instance_set_transform(cursor_instance, cursor_transform);
}
}
}
@@ -1353,8 +1353,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
lock_view = false;
cursor_rot = 0;
- selection_mesh = VisualServer::get_singleton()->mesh_create();
- paste_mesh = VisualServer::get_singleton()->mesh_create();
+ selection_mesh = RenderingServer::get_singleton()->mesh_create();
+ paste_mesh = RenderingServer::get_singleton()->mesh_create();
{
// Selection mesh create.
@@ -1431,16 +1431,16 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
}
Array d;
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
inner_mat.instance();
inner_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.2));
inner_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
inner_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
- d[VS::ARRAY_VERTEX] = triangles;
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, VS::PRIMITIVE_TRIANGLES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(selection_mesh, 0, inner_mat->get_rid());
+ d[RS::ARRAY_VERTEX] = triangles;
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, RS::PRIMITIVE_TRIANGLES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(selection_mesh, 0, inner_mat->get_rid());
outer_mat.instance();
outer_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.8));
@@ -1454,23 +1454,23 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
selection_floor_mat->set_on_top_of_alpha();
selection_floor_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
- d[VS::ARRAY_VERTEX] = lines;
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, VS::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(selection_mesh, 1, outer_mat->get_rid());
+ d[RS::ARRAY_VERTEX] = lines;
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, RS::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(selection_mesh, 1, outer_mat->get_rid());
- d[VS::ARRAY_VERTEX] = triangles;
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(paste_mesh, VS::PRIMITIVE_TRIANGLES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(paste_mesh, 0, inner_mat->get_rid());
+ d[RS::ARRAY_VERTEX] = triangles;
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(paste_mesh, RS::PRIMITIVE_TRIANGLES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(paste_mesh, 0, inner_mat->get_rid());
- d[VS::ARRAY_VERTEX] = lines;
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(paste_mesh, VS::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(paste_mesh, 1, outer_mat->get_rid());
+ d[RS::ARRAY_VERTEX] = lines;
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(paste_mesh, RS::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(paste_mesh, 1, outer_mat->get_rid());
for (int i = 0; i < 3; i++) {
- d[VS::ARRAY_VERTEX] = square[i];
- selection_level_mesh[i] = VS::get_singleton()->mesh_create();
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_level_mesh[i], VS::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(selection_level_mesh[i], 0, selection_floor_mat->get_rid());
+ d[RS::ARRAY_VERTEX] = square[i];
+ selection_level_mesh[i] = RS::get_singleton()->mesh_create();
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(selection_level_mesh[i], RS::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(selection_level_mesh[i], 0, selection_floor_mat->get_rid());
}
}
@@ -1493,24 +1493,24 @@ GridMapEditor::~GridMapEditor() {
for (int i = 0; i < 3; i++) {
if (grid[i].is_valid())
- VisualServer::get_singleton()->free(grid[i]);
+ RenderingServer::get_singleton()->free(grid[i]);
if (grid_instance[i].is_valid())
- VisualServer::get_singleton()->free(grid_instance[i]);
+ RenderingServer::get_singleton()->free(grid_instance[i]);
if (cursor_instance.is_valid())
- VisualServer::get_singleton()->free(cursor_instance);
+ RenderingServer::get_singleton()->free(cursor_instance);
if (selection_level_instance[i].is_valid())
- VisualServer::get_singleton()->free(selection_level_instance[i]);
+ RenderingServer::get_singleton()->free(selection_level_instance[i]);
if (selection_level_mesh[i].is_valid())
- VisualServer::get_singleton()->free(selection_level_mesh[i]);
+ RenderingServer::get_singleton()->free(selection_level_mesh[i]);
}
- VisualServer::get_singleton()->free(selection_mesh);
+ RenderingServer::get_singleton()->free(selection_mesh);
if (selection_instance.is_valid())
- VisualServer::get_singleton()->free(selection_instance);
+ RenderingServer::get_singleton()->free(selection_instance);
- VisualServer::get_singleton()->free(paste_mesh);
+ RenderingServer::get_singleton()->free(paste_mesh);
if (paste_instance.is_valid())
- VisualServer::get_singleton()->free(paste_instance);
+ RenderingServer::get_singleton()->free(paste_instance);
}
void GridMapEditorPlugin::_notification(int p_what) {
diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp
index 1b253d3699..c82a521a43 100644
--- a/modules/mobile_vr/mobile_vr_interface.cpp
+++ b/modules/mobile_vr/mobile_vr_interface.cpp
@@ -32,7 +32,7 @@
#include "core/input/input_filter.h"
#include "core/os/os.h"
#include "servers/display_server.h"
-#include "servers/visual/visual_server_globals.h"
+#include "servers/rendering/rendering_server_globals.h"
StringName MobileVRInterface::get_name() const {
return "Native mobile";
diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp
index 8e5b04f995..1a08ec416f 100644
--- a/modules/opensimplex/noise_texture.cpp
+++ b/modules/opensimplex/noise_texture.cpp
@@ -50,7 +50,7 @@ NoiseTexture::NoiseTexture() {
NoiseTexture::~NoiseTexture() {
if (texture.is_valid()) {
- VS::get_singleton()->free(texture);
+ RS::get_singleton()->free(texture);
}
if (noise_thread) {
Thread::wait_to_finish(noise_thread);
@@ -100,10 +100,10 @@ void NoiseTexture::_set_texture_data(const Ref<Image> &p_image) {
data = p_image;
if (data.is_valid()) {
if (texture.is_valid()) {
- RID new_texture = VS::get_singleton()->texture_2d_create(p_image);
- VS::get_singleton()->texture_replace(texture, new_texture);
+ RID new_texture = RS::get_singleton()->texture_2d_create(p_image);
+ RS::get_singleton()->texture_replace(texture, new_texture);
} else {
- texture = VS::get_singleton()->texture_2d_create(p_image);
+ texture = RS::get_singleton()->texture_2d_create(p_image);
}
}
emit_changed();
@@ -254,7 +254,7 @@ int NoiseTexture::get_height() const {
RID NoiseTexture::get_rid() const {
if (!texture.is_valid()) {
- texture = VS::get_singleton()->texture_2d_placeholder_create();
+ texture = RS::get_singleton()->texture_2d_placeholder_create();
}
return texture;
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index e3792b1f31..537230826c 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -39,8 +39,8 @@
#include "drivers/unix/file_access_unix.h"
#include "file_access_android.h"
#include "main/main.h"
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/rendering/rendering_server_raster.h"
+#include "servers/rendering/rendering_server_wrap_mt.h"
#include "dir_access_jandroid.h"
#include "file_access_jandroid.h"
@@ -146,12 +146,12 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
video_driver_index = p_video_driver;
- visual_server = memnew(VisualServerRaster);
+ rendering_server = memnew(RenderingServerRaster);
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
- visual_server = memnew(VisualServerWrapMT(visual_server, false));
+ rendering_server = memnew(RenderingServerWrapMT(rendering_server, false));
}
- visual_server->init();
+ rendering_server->init();
AudioDriverManager::initialize(p_audio_driver);
@@ -759,7 +759,7 @@ OS_Android::OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_god
//rasterizer = NULL;
use_gl2 = false;
- visual_server = NULL;
+ rendering_server = NULL;
godot_java = p_godot_java;
godot_io_java = p_godot_io_java;
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index d09f4e10d6..8a91412ef6 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -37,7 +37,7 @@
#include "core/os/main_loop.h"
#include "drivers/unix/os_unix.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
+#include "servers/rendering/rasterizer.h"
class GodotJavaWrapper;
class GodotIOJavaWrapper;
@@ -75,7 +75,7 @@ private:
bool use_16bits_fbo;
- VisualServer *visual_server;
+ RenderingServer *rendering_server;
mutable String data_dir_cache;
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index a082ba53f9..7939ea0a1e 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -32,9 +32,9 @@
#include "drivers/gles2/rasterizer_gles2.h"
#include "main/main.h"
-#include "servers/physics/physics_server_sw.h"
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/physics_3d/physics_server_3d_sw.h"
+#include "servers/rendering/rendering_server_raster.h"
+#include "servers/rendering/rendering_server_wrap_mt.h"
#include <Screen.h>
@@ -116,13 +116,13 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p
RasterizerGLES2::make_current();
#endif
- visual_server = memnew(VisualServerRaster);
+ rendering_server = memnew(RenderingServerRaster);
// FIXME: Reimplement threaded rendering
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
- visual_server = memnew(VisualServerWrapMT(visual_server, false));
+ rendering_server = memnew(RenderingServerWrapMT(rendering_server, false));
}
- ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(!rendering_server, ERR_UNAVAILABLE);
video_driver_index = p_video_driver;
@@ -130,7 +130,7 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p
window->SetInput(input);
window->Show();
- visual_server->init();
+ rendering_server->init();
AudioDriverManager::initialize(p_audio_driver);
@@ -144,8 +144,8 @@ void OS_Haiku::finalize() {
main_loop = NULL;
- visual_server->finish();
- memdelete(visual_server);
+ rendering_server->finish();
+ memdelete(rendering_server);
memdelete(input);
@@ -267,7 +267,7 @@ void OS_Haiku::set_window_position(const Point2 &p_position) {
void OS_Haiku::set_window_fullscreen(bool p_enabled) {
window->SetFullScreen(p_enabled);
current_video_mode.fullscreen = p_enabled;
- visual_server->init();
+ rendering_server->init();
}
bool OS_Haiku::is_window_fullscreen() const {
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index 90c0abc3ef..64f5690dd1 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -38,7 +38,7 @@
#include "haiku_application.h"
#include "haiku_direct_window.h"
#include "servers/audio_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class OS_Haiku : public OS_Unix {
private:
@@ -46,7 +46,7 @@ private:
HaikuDirectWindow *window;
MainLoop *main_loop;
InputDefault *input;
- VisualServer *visual_server;
+ RenderingServer *rendering_server;
VideoMode current_video_mode;
int video_driver_index;
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index 497f2f747d..fe912621bb 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -37,13 +37,13 @@
#endif
#if defined(VULKAN_ENABLED)
-#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_rd.h"
// #import <QuartzCore/CAMetalLayer.h>
#include <vulkan/vulkan_metal.h>
#endif
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/rendering/rendering_server_raster.h"
+#include "servers/rendering/rendering_server_wrap_mt.h"
#include "main/main.h"
@@ -134,16 +134,16 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p
RasterizerRD::make_current();
#endif
- visual_server = memnew(VisualServerRaster);
+ rendering_server = memnew(RenderingServerRaster);
// FIXME: Reimplement threaded rendering
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
- visual_server = memnew(VisualServerWrapMT(visual_server, false));
+ rendering_server = memnew(RenderingServerWrapMT(rendering_server, false));
}
- visual_server->init();
- //visual_server->cursor_set_visible(false, 0);
+ rendering_server->init();
+ //rendering_server->cursor_set_visible(false, 0);
#if defined(OPENGL_ENABLED)
- // reset this to what it should be, it will have been set to 0 after visual_server->init() is called
+ // reset this to what it should be, it will have been set to 0 after rendering_server->init() is called
RasterizerStorageGLES2::system_fbo = gl_view_base_fb;
#endif
@@ -361,8 +361,8 @@ void OSIPhone::finalize() {
memdelete(icloud);
#endif
- visual_server->finish();
- memdelete(visual_server);
+ rendering_server->finish();
+ memdelete(rendering_server);
// memdelete(rasterizer);
// Free unhandled events before close
@@ -636,7 +636,7 @@ OSIPhone::OSIPhone(int width, int height, String p_data_dir) {
ios_init_callbacks_capacity = 0;
main_loop = NULL;
- visual_server = NULL;
+ rendering_server = NULL;
VideoMode vm;
vm.fullscreen = true;
diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h
index 2efb7af7c2..96cf041c37 100644
--- a/platform/iphone/os_iphone.h
+++ b/platform/iphone/os_iphone.h
@@ -41,8 +41,8 @@
#include "in_app_store.h"
#include "ios.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
#if defined(VULKAN_ENABLED)
#include "drivers/vulkan/rendering_device_vulkan.h"
@@ -60,7 +60,7 @@ private:
static HashMap<String, void *> dynamic_symbol_lookup_table;
friend void register_dynamic_symbol(char *name, void *address);
- VisualServer *visual_server;
+ RenderingServer *rendering_server;
AudioDriverCoreAudio audio_driver;
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index b7feb5bfbd..40c42a5c03 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -36,7 +36,7 @@
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "main/main.h"
-#include "servers/visual/visual_server_raster.h"
+#include "servers/rendering/rendering_server_raster.h"
#include <emscripten.h>
#include <png.h>
@@ -962,7 +962,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
setenv("LANG", locale_ptr, true);
AudioDriverManager::initialize(p_audio_driver);
- VisualServer *visual_server = memnew(VisualServerRaster());
+ RenderingServer *rendering_server = memnew(RenderingServerRaster());
input = memnew(InputDefault);
EMSCRIPTEN_RESULT result;
@@ -1016,7 +1016,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
);
/* clang-format on */
- visual_server->init();
+ rendering_server->init();
return OK;
}
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index 1a3a6616b0..368e9a2155 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -35,7 +35,7 @@
#include "core/input/input_filter.h"
#include "drivers/unix/os_unix.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
+#include "servers/rendering/rasterizer.h"
#include <emscripten/html5.h>
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp
index 4bea458187..c2b5657081 100644
--- a/platform/linuxbsd/display_server_x11.cpp
+++ b/platform/linuxbsd/display_server_x11.cpp
@@ -44,7 +44,7 @@
#endif
#if defined(VULKAN_ENABLED)
-#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_rd.h"
#endif
#include "scene/resources/texture.h"
@@ -3615,9 +3615,9 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
#endif
/*
- visual_server = memnew(VisualServerRaster);
+ rendering_server = memnew(RenderingServerRaster);
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
- visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
+ rendering_server = memnew(RenderingServerWrapMT(rendering_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
*/
diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h
index d1680b0508..aa10be555c 100644
--- a/platform/linuxbsd/display_server_x11.h
+++ b/platform/linuxbsd/display_server_x11.h
@@ -43,8 +43,8 @@
#include "drivers/unix/os_unix.h"
#include "joypad_linux.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
#if defined(OPENGL_ENABLED)
#include "context_gl_x11.h"
diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h
index 6c656c1945..100cb53ba3 100644
--- a/platform/linuxbsd/os_linuxbsd.h
+++ b/platform/linuxbsd/os_linuxbsd.h
@@ -39,8 +39,8 @@
#include "drivers/unix/os_unix.h"
#include "joypad_linux.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
class OS_LinuxBSD : public OS_Unix {
diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp
index 3257ec261c..6b26ceed57 100644
--- a/platform/server/os_server.cpp
+++ b/platform/server/os_server.cpp
@@ -33,7 +33,7 @@
#include "core/print_string.h"
#include "drivers/dummy/rasterizer_dummy.h"
#include "drivers/dummy/texture_loader_dummy.h"
-#include "servers/visual/visual_server_raster.h"
+#include "servers/rendering/rendering_server_raster.h"
#include "main/main.h"
@@ -80,8 +80,8 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int
video_driver_index = p_video_driver; // unused in server platform, but should still be initialized
- visual_server = memnew(VisualServerRaster);
- visual_server->init();
+ rendering_server = memnew(RenderingServerRaster);
+ rendering_server->init();
AudioDriverManager::initialize(p_audio_driver);
@@ -101,8 +101,8 @@ void OS_Server::finalize() {
memdelete(main_loop);
main_loop = NULL;
- visual_server->finish();
- memdelete(visual_server);
+ rendering_server->finish();
+ memdelete(rendering_server);
memdelete(input);
diff --git a/platform/server/os_server.h b/platform/server/os_server.h
index d40905718e..62028b26e4 100644
--- a/platform/server/os_server.h
+++ b/platform/server/os_server.h
@@ -41,14 +41,14 @@
#include "platform/x11/crash_handler_linuxbsd.h"
#endif
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
#undef CursorShape
class OS_Server : public OS_Unix {
- VisualServer *visual_server;
+ RenderingServer *rendering_server;
VideoMode current_videomode;
List<String> args;
MainLoop *main_loop;
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 4ddb5463d0..85719d13ae 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -45,8 +45,8 @@
#include "main/main.h"
#include "platform/windows/windows_terminal_logger.h"
#include "servers/audio_server.h"
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/rendering/rendering_server_raster.h"
+#include "servers/rendering/rendering_server_wrap_mt.h"
#include "thread_uwp.h"
#include <ppltasks.h>
@@ -254,13 +254,13 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
set_video_mode(vm);
- visual_server = memnew(VisualServerRaster);
+ rendering_server = memnew(RenderingServerRaster);
// FIXME: Reimplement threaded rendering
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
- visual_server = memnew(VisualServerWrapMT(visual_server, false));
+ rendering_server = memnew(RenderingServerWrapMT(rendering_server, false));
}
- visual_server->init();
+ rendering_server->init();
input = memnew(InputDefault);
@@ -349,8 +349,8 @@ void OS_UWP::finalize() {
main_loop = NULL;
- visual_server->finish();
- memdelete(visual_server);
+ rendering_server->finish();
+ memdelete(rendering_server);
#ifdef OPENGL_ENABLED
if (gl_context)
memdelete(gl_context);
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index cc4dfcc79f..de3b094ef4 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -39,8 +39,8 @@
#include "drivers/xaudio2/audio_driver_xaudio2.h"
#include "joypad_uwp.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
#include <fcntl.h>
#include <io.h>
@@ -88,7 +88,7 @@ private:
bool outside;
int old_x, old_y;
Point2i center;
- VisualServer *visual_server;
+ RenderingServer *rendering_server;
int pressrc;
ContextEGL_UWP *gl_context;
diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h
index 47bb3f59a6..b0386d551e 100644
--- a/platform/windows/display_server_windows.h
+++ b/platform/windows/display_server_windows.h
@@ -13,9 +13,9 @@
#include "joypad_windows.h"
#include "key_mapping_windows.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_rd.h"
+#include "servers/rendering_server.h"
#ifdef XAUDIO2_ENABLED
#include "drivers/xaudio2/audio_driver_xaudio2.h"
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index f78c87be93..4112135cec 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -46,8 +46,8 @@
#include "main/main.h"
#include "platform/windows/display_server_windows.h"
#include "servers/audio_server.h"
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual/visual_server_wrap_mt.h"
+#include "servers/rendering/rendering_server_raster.h"
+#include "servers/rendering/rendering_server_wrap_mt.h"
#include "windows_terminal_logger.h"
#include <avrt.h>
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 040951668d..29280eb17c 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -40,8 +40,8 @@
#include "drivers/winmidi/midi_driver_winmidi.h"
#include "key_mapping_windows.h"
#include "servers/audio_server.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
#ifdef XAUDIO2_ENABLED
#include "drivers/xaudio2/audio_driver_xaudio2.h"
#endif
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index b99c4c88bf..4ccff07416 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -32,12 +32,12 @@
#include "scene/scene_string_names.h"
#include "servers/audio_server.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
void Area2D::set_space_override_mode(SpaceOverride p_mode) {
space_override = p_mode;
- Physics2DServer::get_singleton()->area_set_space_override_mode(get_rid(), Physics2DServer::AreaSpaceOverrideMode(p_mode));
+ PhysicsServer2D::get_singleton()->area_set_space_override_mode(get_rid(), PhysicsServer2D::AreaSpaceOverrideMode(p_mode));
}
Area2D::SpaceOverride Area2D::get_space_override_mode() const {
@@ -47,7 +47,7 @@ Area2D::SpaceOverride Area2D::get_space_override_mode() const {
void Area2D::set_gravity_is_point(bool p_enabled) {
gravity_is_point = p_enabled;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_GRAVITY_IS_POINT, p_enabled);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_GRAVITY_IS_POINT, p_enabled);
}
bool Area2D::is_gravity_a_point() const {
@@ -57,7 +57,7 @@ bool Area2D::is_gravity_a_point() const {
void Area2D::set_gravity_distance_scale(real_t p_scale) {
gravity_distance_scale = p_scale;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE, p_scale);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_GRAVITY_DISTANCE_SCALE, p_scale);
}
real_t Area2D::get_gravity_distance_scale() const {
@@ -67,7 +67,7 @@ real_t Area2D::get_gravity_distance_scale() const {
void Area2D::set_gravity_vector(const Vector2 &p_vec) {
gravity_vec = p_vec;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_GRAVITY_VECTOR, p_vec);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR, p_vec);
}
Vector2 Area2D::get_gravity_vector() const {
@@ -77,7 +77,7 @@ Vector2 Area2D::get_gravity_vector() const {
void Area2D::set_gravity(real_t p_gravity) {
gravity = p_gravity;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_GRAVITY, p_gravity);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_GRAVITY, p_gravity);
}
real_t Area2D::get_gravity() const {
@@ -87,7 +87,7 @@ real_t Area2D::get_gravity() const {
void Area2D::set_linear_damp(real_t p_linear_damp) {
linear_damp = p_linear_damp;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_LINEAR_DAMP, p_linear_damp);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_LINEAR_DAMP, p_linear_damp);
}
real_t Area2D::get_linear_damp() const {
@@ -97,7 +97,7 @@ real_t Area2D::get_linear_damp() const {
void Area2D::set_angular_damp(real_t p_angular_damp) {
angular_damp = p_angular_damp;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_ANGULAR_DAMP, p_angular_damp);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_ANGULAR_DAMP, p_angular_damp);
}
real_t Area2D::get_angular_damp() const {
@@ -108,7 +108,7 @@ real_t Area2D::get_angular_damp() const {
void Area2D::set_priority(real_t p_priority) {
priority = p_priority;
- Physics2DServer::get_singleton()->area_set_param(get_rid(), Physics2DServer::AREA_PARAM_PRIORITY, p_priority);
+ PhysicsServer2D::get_singleton()->area_set_param(get_rid(), PhysicsServer2D::AREA_PARAM_PRIORITY, p_priority);
}
real_t Area2D::get_priority() const {
@@ -151,7 +151,7 @@ void Area2D::_body_exit_tree(ObjectID p_id) {
void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, int p_body_shape, int p_area_shape) {
- bool body_in = p_status == Physics2DServer::AREA_BODY_ADDED;
+ bool body_in = p_status == PhysicsServer2D::AREA_BODY_ADDED;
ObjectID objid = p_instance;
Object *obj = ObjectDB::get_instance(objid);
@@ -254,7 +254,7 @@ void Area2D::_area_exit_tree(ObjectID p_id) {
void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, int p_area_shape, int p_self_shape) {
- bool area_in = p_status == Physics2DServer::AREA_BODY_ADDED;
+ bool area_in = p_status == PhysicsServer2D::AREA_BODY_ADDED;
ObjectID objid = p_instance;
Object *obj = ObjectDB::get_instance(objid);
@@ -403,12 +403,12 @@ void Area2D::set_monitoring(bool p_enable) {
if (monitoring) {
- Physics2DServer::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout);
- Physics2DServer::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout);
+ PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout);
+ PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout);
} else {
- Physics2DServer::get_singleton()->area_set_monitor_callback(get_rid(), NULL, StringName());
- Physics2DServer::get_singleton()->area_set_area_monitor_callback(get_rid(), NULL, StringName());
+ PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), NULL, StringName());
+ PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), NULL, StringName());
_clear_monitoring();
}
}
@@ -420,14 +420,14 @@ bool Area2D::is_monitoring() const {
void Area2D::set_monitorable(bool p_enable) {
- ERR_FAIL_COND_MSG(locked || (is_inside_tree() && Physics2DServer::get_singleton()->is_flushing_queries()), "Function blocked during in/out signal. Use set_deferred(\"monitorable\", true/false).");
+ ERR_FAIL_COND_MSG(locked || (is_inside_tree() && PhysicsServer2D::get_singleton()->is_flushing_queries()), "Function blocked during in/out signal. Use set_deferred(\"monitorable\", true/false).");
if (p_enable == monitorable)
return;
monitorable = p_enable;
- Physics2DServer::get_singleton()->area_set_monitorable(get_rid(), monitorable);
+ PhysicsServer2D::get_singleton()->area_set_monitorable(get_rid(), monitorable);
}
bool Area2D::is_monitorable() const {
@@ -492,7 +492,7 @@ bool Area2D::overlaps_body(Node *p_body) const {
void Area2D::set_collision_mask(uint32_t p_mask) {
collision_mask = p_mask;
- Physics2DServer::get_singleton()->area_set_collision_mask(get_rid(), p_mask);
+ PhysicsServer2D::get_singleton()->area_set_collision_mask(get_rid(), p_mask);
}
uint32_t Area2D::get_collision_mask() const {
@@ -503,7 +503,7 @@ uint32_t Area2D::get_collision_mask() const {
void Area2D::set_collision_layer(uint32_t p_layer) {
collision_layer = p_layer;
- Physics2DServer::get_singleton()->area_set_collision_layer(get_rid(), p_layer);
+ PhysicsServer2D::get_singleton()->area_set_collision_layer(get_rid(), p_layer);
}
uint32_t Area2D::get_collision_layer() const {
@@ -676,7 +676,7 @@ void Area2D::_bind_methods() {
}
Area2D::Area2D() :
- CollisionObject2D(Physics2DServer::get_singleton()->area_create(), true) {
+ CollisionObject2D(PhysicsServer2D::get_singleton()->area_create(), true) {
space_override = SPACE_OVERRIDE_DISABLED;
set_gravity(98);
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index df0b17800f..55d111439a 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -187,9 +187,9 @@ void AudioStreamPlayer2D::_notification(int p_what) {
//check if any area is diverting sound into a bus
- Physics2DDirectSpaceState *space_state = Physics2DServer::get_singleton()->space_get_direct_state(world_2d->get_space());
+ PhysicsDirectSpaceState2D *space_state = PhysicsServer2D::get_singleton()->space_get_direct_state(world_2d->get_space());
- Physics2DDirectSpaceState::ShapeResult sr[MAX_INTERSECT_AREAS];
+ PhysicsDirectSpaceState2D::ShapeResult sr[MAX_INTERSECT_AREAS];
int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, false, true);
diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp
index faeb6b7169..4c952b7ca6 100644
--- a/scene/2d/back_buffer_copy.cpp
+++ b/scene/2d/back_buffer_copy.cpp
@@ -36,15 +36,15 @@ void BackBufferCopy::_update_copy_mode() {
case COPY_MODE_DISABLED: {
- VS::get_singleton()->canvas_item_set_copy_to_backbuffer(get_canvas_item(), false, Rect2());
+ RS::get_singleton()->canvas_item_set_copy_to_backbuffer(get_canvas_item(), false, Rect2());
} break;
case COPY_MODE_RECT: {
- VS::get_singleton()->canvas_item_set_copy_to_backbuffer(get_canvas_item(), true, rect);
+ RS::get_singleton()->canvas_item_set_copy_to_backbuffer(get_canvas_item(), true, rect);
} break;
case COPY_MODE_VIEWPORT: {
- VS::get_singleton()->canvas_item_set_copy_to_backbuffer(get_canvas_item(), true, Rect2());
+ RS::get_singleton()->canvas_item_set_copy_to_backbuffer(get_canvas_item(), true, Rect2());
} break;
}
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index a8860c3d81..6d8d981974 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -33,7 +33,7 @@
#include "core/engine.h"
#include "core/math/math_funcs.h"
#include "scene/scene_string_names.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void Camera2D::_update_scroll() {
diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp
index 25db434918..05f8804e2a 100644
--- a/scene/2d/canvas_modulate.cpp
+++ b/scene/2d/canvas_modulate.cpp
@@ -35,23 +35,23 @@ void CanvasModulate::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_CANVAS) {
if (is_visible_in_tree()) {
- VS::get_singleton()->canvas_set_modulate(get_canvas(), color);
+ RS::get_singleton()->canvas_set_modulate(get_canvas(), color);
add_to_group("_canvas_modulate_" + itos(get_canvas().get_id()));
}
} else if (p_what == NOTIFICATION_EXIT_CANVAS) {
if (is_visible_in_tree()) {
- VS::get_singleton()->canvas_set_modulate(get_canvas(), Color(1, 1, 1, 1));
+ RS::get_singleton()->canvas_set_modulate(get_canvas(), Color(1, 1, 1, 1));
remove_from_group("_canvas_modulate_" + itos(get_canvas().get_id()));
}
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
if (is_visible_in_tree()) {
- VS::get_singleton()->canvas_set_modulate(get_canvas(), color);
+ RS::get_singleton()->canvas_set_modulate(get_canvas(), color);
add_to_group("_canvas_modulate_" + itos(get_canvas().get_id()));
} else {
- VS::get_singleton()->canvas_set_modulate(get_canvas(), Color(1, 1, 1, 1));
+ RS::get_singleton()->canvas_set_modulate(get_canvas(), Color(1, 1, 1, 1));
remove_from_group("_canvas_modulate_" + itos(get_canvas().get_id()));
}
@@ -71,7 +71,7 @@ void CanvasModulate::set_color(const Color &p_color) {
color = p_color;
if (is_visible_in_tree()) {
- VS::get_singleton()->canvas_set_modulate(get_canvas(), color);
+ RS::get_singleton()->canvas_set_modulate(get_canvas(), color);
}
}
Color CanvasModulate::get_color() const {
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index 4af2e846f7..5535043432 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -31,7 +31,7 @@
#include "collision_object_2d.h"
#include "scene/scene_string_names.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
void CollisionObject2D::_notification(int p_what) {
@@ -42,15 +42,15 @@ void CollisionObject2D::_notification(int p_what) {
Transform2D global_transform = get_global_transform();
if (area)
- Physics2DServer::get_singleton()->area_set_transform(rid, global_transform);
+ PhysicsServer2D::get_singleton()->area_set_transform(rid, global_transform);
else
- Physics2DServer::get_singleton()->body_set_state(rid, Physics2DServer::BODY_STATE_TRANSFORM, global_transform);
+ PhysicsServer2D::get_singleton()->body_set_state(rid, PhysicsServer2D::BODY_STATE_TRANSFORM, global_transform);
RID space = get_world_2d()->get_space();
if (area) {
- Physics2DServer::get_singleton()->area_set_space(rid, space);
+ PhysicsServer2D::get_singleton()->area_set_space(rid, space);
} else
- Physics2DServer::get_singleton()->body_set_space(rid, space);
+ PhysicsServer2D::get_singleton()->body_set_space(rid, space);
_update_pickable();
@@ -60,9 +60,9 @@ void CollisionObject2D::_notification(int p_what) {
case NOTIFICATION_ENTER_CANVAS: {
if (area)
- Physics2DServer::get_singleton()->area_attach_canvas_instance_id(rid, get_canvas_layer_instance_id());
+ PhysicsServer2D::get_singleton()->area_attach_canvas_instance_id(rid, get_canvas_layer_instance_id());
else
- Physics2DServer::get_singleton()->body_attach_canvas_instance_id(rid, get_canvas_layer_instance_id());
+ PhysicsServer2D::get_singleton()->body_attach_canvas_instance_id(rid, get_canvas_layer_instance_id());
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@@ -78,26 +78,26 @@ void CollisionObject2D::_notification(int p_what) {
Transform2D global_transform = get_global_transform();
if (area)
- Physics2DServer::get_singleton()->area_set_transform(rid, global_transform);
+ PhysicsServer2D::get_singleton()->area_set_transform(rid, global_transform);
else
- Physics2DServer::get_singleton()->body_set_state(rid, Physics2DServer::BODY_STATE_TRANSFORM, global_transform);
+ PhysicsServer2D::get_singleton()->body_set_state(rid, PhysicsServer2D::BODY_STATE_TRANSFORM, global_transform);
} break;
case NOTIFICATION_EXIT_TREE: {
if (area) {
- Physics2DServer::get_singleton()->area_set_space(rid, RID());
+ PhysicsServer2D::get_singleton()->area_set_space(rid, RID());
} else
- Physics2DServer::get_singleton()->body_set_space(rid, RID());
+ PhysicsServer2D::get_singleton()->body_set_space(rid, RID());
} break;
case NOTIFICATION_EXIT_CANVAS: {
if (area)
- Physics2DServer::get_singleton()->area_attach_canvas_instance_id(rid, ObjectID());
+ PhysicsServer2D::get_singleton()->area_attach_canvas_instance_id(rid, ObjectID());
else
- Physics2DServer::get_singleton()->body_attach_canvas_instance_id(rid, ObjectID());
+ PhysicsServer2D::get_singleton()->body_attach_canvas_instance_id(rid, ObjectID());
} break;
}
}
@@ -136,9 +136,9 @@ void CollisionObject2D::shape_owner_set_disabled(uint32_t p_owner, bool p_disabl
sd.disabled = p_disabled;
for (int i = 0; i < sd.shapes.size(); i++) {
if (area) {
- Physics2DServer::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ PhysicsServer2D::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
} else {
- Physics2DServer::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ PhysicsServer2D::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
}
}
}
@@ -160,7 +160,7 @@ void CollisionObject2D::shape_owner_set_one_way_collision(uint32_t p_owner, bool
ShapeData &sd = shapes[p_owner];
sd.one_way_collision = p_enable;
for (int i = 0; i < sd.shapes.size(); i++) {
- Physics2DServer::get_singleton()->body_set_shape_as_one_way_collision(rid, sd.shapes[i].index, sd.one_way_collision, sd.one_way_collision_margin);
+ PhysicsServer2D::get_singleton()->body_set_shape_as_one_way_collision(rid, sd.shapes[i].index, sd.one_way_collision, sd.one_way_collision_margin);
}
}
@@ -181,7 +181,7 @@ void CollisionObject2D::shape_owner_set_one_way_collision_margin(uint32_t p_owne
ShapeData &sd = shapes[p_owner];
sd.one_way_collision_margin = p_margin;
for (int i = 0; i < sd.shapes.size(); i++) {
- Physics2DServer::get_singleton()->body_set_shape_as_one_way_collision(rid, sd.shapes[i].index, sd.one_way_collision, sd.one_way_collision_margin);
+ PhysicsServer2D::get_singleton()->body_set_shape_as_one_way_collision(rid, sd.shapes[i].index, sd.one_way_collision, sd.one_way_collision_margin);
}
}
@@ -218,9 +218,9 @@ void CollisionObject2D::shape_owner_set_transform(uint32_t p_owner, const Transf
sd.xform = p_transform;
for (int i = 0; i < sd.shapes.size(); i++) {
if (area) {
- Physics2DServer::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, sd.xform);
+ PhysicsServer2D::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, sd.xform);
} else {
- Physics2DServer::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, sd.xform);
+ PhysicsServer2D::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, sd.xform);
}
}
}
@@ -248,9 +248,9 @@ void CollisionObject2D::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape2
s.index = total_subshapes;
s.shape = p_shape;
if (area) {
- Physics2DServer::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
+ PhysicsServer2D::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
} else {
- Physics2DServer::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
+ PhysicsServer2D::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
}
sd.shapes.push_back(s);
@@ -284,9 +284,9 @@ void CollisionObject2D::shape_owner_remove_shape(uint32_t p_owner, int p_shape)
int index_to_remove = shapes[p_owner].shapes[p_shape].index;
if (area) {
- Physics2DServer::get_singleton()->area_remove_shape(rid, index_to_remove);
+ PhysicsServer2D::get_singleton()->area_remove_shape(rid, index_to_remove);
} else {
- Physics2DServer::get_singleton()->body_remove_shape(rid, index_to_remove);
+ PhysicsServer2D::get_singleton()->body_remove_shape(rid, index_to_remove);
}
shapes[p_owner].shapes.remove(p_shape);
@@ -375,9 +375,9 @@ void CollisionObject2D::_update_pickable() {
bool is_pickable = pickable && is_visible_in_tree();
if (area)
- Physics2DServer::get_singleton()->area_set_pickable(rid, is_pickable);
+ PhysicsServer2D::get_singleton()->area_set_pickable(rid, is_pickable);
else
- Physics2DServer::get_singleton()->body_set_pickable(rid, is_pickable);
+ PhysicsServer2D::get_singleton()->body_set_pickable(rid, is_pickable);
}
String CollisionObject2D::get_configuration_warning() const {
@@ -442,9 +442,9 @@ CollisionObject2D::CollisionObject2D(RID p_rid, bool p_area) {
if (p_area) {
- Physics2DServer::get_singleton()->area_attach_object_instance_id(rid, get_instance_id());
+ PhysicsServer2D::get_singleton()->area_attach_object_instance_id(rid, get_instance_id());
} else {
- Physics2DServer::get_singleton()->body_attach_object_instance_id(rid, get_instance_id());
+ PhysicsServer2D::get_singleton()->body_attach_object_instance_id(rid, get_instance_id());
}
}
@@ -457,5 +457,5 @@ CollisionObject2D::CollisionObject2D() {
CollisionObject2D::~CollisionObject2D() {
- Physics2DServer::get_singleton()->free(rid);
+ PhysicsServer2D::get_singleton()->free(rid);
}
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index e9dfb94cb2..5880045e90 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -106,7 +106,7 @@ void CollisionPolygon2D::_notification(int p_what) {
/*if (Engine::get_singleton()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
- set_z_index(VS::CANVAS_ITEM_Z_MAX - 1);
+ set_z_index(RS::CANVAS_ITEM_Z_MAX - 1);
}*/
} break;
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index b2ad040654..cb2953cc15 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -73,7 +73,7 @@ void CollisionShape2D::_notification(int p_what) {
/*if (Engine::get_singleton()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
- set_z_index(VS::CANVAS_ITEM_Z_MAX - 1);
+ set_z_index(RS::CANVAS_ITEM_Z_MAX - 1);
}*/
} break;
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index 8678e5a1f4..ba604c086e 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -34,7 +34,7 @@
#include "scene/2d/gpu_particles_2d.h"
#include "scene/main/canvas_item.h"
#include "scene/resources/particles_material.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void CPUParticles2D::set_emitting(bool p_emitting) {
@@ -60,7 +60,7 @@ void CPUParticles2D::set_amount(int p_amount) {
}
particle_data.resize((8 + 4 + 4) * p_amount);
- VS::get_singleton()->multimesh_allocate(multimesh, p_amount, VS::MULTIMESH_TRANSFORM_2D, true, true);
+ RS::get_singleton()->multimesh_allocate(multimesh, p_amount, RS::MULTIMESH_TRANSFORM_2D, true, true);
particle_order.resize(p_amount);
}
@@ -198,14 +198,14 @@ void CPUParticles2D::_update_mesh_texture() {
indices.push_back(0);
Array arr;
- arr.resize(VS::ARRAY_MAX);
- arr[VS::ARRAY_VERTEX] = vertices;
- arr[VS::ARRAY_TEX_UV] = uvs;
- arr[VS::ARRAY_COLOR] = colors;
- arr[VS::ARRAY_INDEX] = indices;
+ arr.resize(RS::ARRAY_MAX);
+ arr[RS::ARRAY_VERTEX] = vertices;
+ arr[RS::ARRAY_TEX_UV] = uvs;
+ arr[RS::ARRAY_COLOR] = colors;
+ arr[RS::ARRAY_INDEX] = indices;
- VS::get_singleton()->mesh_clear(mesh);
- VS::get_singleton()->mesh_add_surface_from_arrays(mesh, VS::PRIMITIVE_TRIANGLES, arr);
+ RS::get_singleton()->mesh_clear(mesh);
+ RS::get_singleton()->mesh_add_surface_from_arrays(mesh, RS::PRIMITIVE_TRIANGLES, arr);
}
void CPUParticles2D::set_texture(const Ref<Texture2D> &p_texture) {
@@ -1046,17 +1046,17 @@ void CPUParticles2D::_set_redraw(bool p_redraw) {
MutexLock lock(update_mutex);
if (redraw) {
- VS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &CPUParticles2D::_update_render_thread));
- VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true);
+ RS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &CPUParticles2D::_update_render_thread));
+ RS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true);
- VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
+ RS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
} else {
- if (VS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &CPUParticles2D::_update_render_thread))) {
- VS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &CPUParticles2D::_update_render_thread));
+ if (RS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &CPUParticles2D::_update_render_thread))) {
+ RS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &CPUParticles2D::_update_render_thread));
}
- VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false);
+ RS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false);
- VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
+ RS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
}
}
@@ -1067,7 +1067,7 @@ void CPUParticles2D::_update_render_thread() {
MutexLock lock(update_mutex);
- VS::get_singleton()->multimesh_set_buffer(multimesh, particle_data);
+ RS::get_singleton()->multimesh_set_buffer(multimesh, particle_data);
}
void CPUParticles2D::_notification(int p_what) {
@@ -1098,7 +1098,7 @@ void CPUParticles2D::_notification(int p_what) {
normrid = normalmap->get_rid();
}
- VS::get_singleton()->canvas_item_add_multimesh(get_canvas_item(), multimesh, texrid, normrid);
+ RS::get_singleton()->canvas_item_add_multimesh(get_canvas_item(), multimesh, texrid, normrid);
}
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
@@ -1428,9 +1428,9 @@ CPUParticles2D::CPUParticles2D() {
redraw = false;
emitting = false;
- mesh = VisualServer::get_singleton()->mesh_create();
- multimesh = VisualServer::get_singleton()->multimesh_create();
- VisualServer::get_singleton()->multimesh_set_mesh(multimesh, mesh);
+ mesh = RenderingServer::get_singleton()->mesh_create();
+ multimesh = RenderingServer::get_singleton()->multimesh_create();
+ RenderingServer::get_singleton()->multimesh_set_mesh(multimesh, mesh);
set_emitting(true);
set_one_shot(false);
@@ -1481,6 +1481,6 @@ CPUParticles2D::CPUParticles2D() {
}
CPUParticles2D::~CPUParticles2D() {
- VS::get_singleton()->free(multimesh);
- VS::get_singleton()->free(mesh);
+ RS::get_singleton()->free(multimesh);
+ RS::get_singleton()->free(mesh);
}
diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp
index d3d1326018..fd9706eb2a 100644
--- a/scene/2d/gpu_particles_2d.cpp
+++ b/scene/2d/gpu_particles_2d.cpp
@@ -40,7 +40,7 @@
void GPUParticles2D::set_emitting(bool p_emitting) {
- VS::get_singleton()->particles_set_emitting(particles, p_emitting);
+ RS::get_singleton()->particles_set_emitting(particles, p_emitting);
if (p_emitting && one_shot) {
set_process_internal(true);
@@ -53,25 +53,25 @@ void GPUParticles2D::set_amount(int p_amount) {
ERR_FAIL_COND_MSG(p_amount < 1, "Amount of particles cannot be smaller than 1.");
amount = p_amount;
- VS::get_singleton()->particles_set_amount(particles, amount);
+ RS::get_singleton()->particles_set_amount(particles, amount);
}
void GPUParticles2D::set_lifetime(float p_lifetime) {
ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0.");
lifetime = p_lifetime;
- VS::get_singleton()->particles_set_lifetime(particles, lifetime);
+ RS::get_singleton()->particles_set_lifetime(particles, lifetime);
}
void GPUParticles2D::set_one_shot(bool p_enable) {
one_shot = p_enable;
- VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+ RS::get_singleton()->particles_set_one_shot(particles, one_shot);
if (is_emitting()) {
set_process_internal(true);
if (!one_shot)
- VisualServer::get_singleton()->particles_restart(particles);
+ RenderingServer::get_singleton()->particles_restart(particles);
}
if (!one_shot)
@@ -80,17 +80,17 @@ void GPUParticles2D::set_one_shot(bool p_enable) {
void GPUParticles2D::set_pre_process_time(float p_time) {
pre_process_time = p_time;
- VS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time);
+ RS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time);
}
void GPUParticles2D::set_explosiveness_ratio(float p_ratio) {
explosiveness_ratio = p_ratio;
- VS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
+ RS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
}
void GPUParticles2D::set_randomness_ratio(float p_ratio) {
randomness_ratio = p_ratio;
- VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
+ RS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
}
void GPUParticles2D::set_visibility_rect(const Rect2 &p_visibility_rect) {
@@ -101,7 +101,7 @@ void GPUParticles2D::set_visibility_rect(const Rect2 &p_visibility_rect) {
aabb.size.x = p_visibility_rect.size.x;
aabb.size.y = p_visibility_rect.size.y;
- VS::get_singleton()->particles_set_custom_aabb(particles, aabb);
+ RS::get_singleton()->particles_set_custom_aabb(particles, aabb);
_change_notify("visibility_rect");
update();
@@ -109,7 +109,7 @@ void GPUParticles2D::set_visibility_rect(const Rect2 &p_visibility_rect) {
void GPUParticles2D::set_use_local_coordinates(bool p_enable) {
local_coords = p_enable;
- VS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords);
+ RS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords);
set_notify_transform(!p_enable);
if (!p_enable && is_inside_tree()) {
_update_particle_emission_transform();
@@ -124,7 +124,7 @@ void GPUParticles2D::_update_particle_emission_transform() {
xf.basis.set_axis(1, Vector3(xf2d.get_axis(1).x, xf2d.get_axis(1).y, 0));
xf.set_origin(Vector3(xf2d.get_origin().x, xf2d.get_origin().y, 0));
- VS::get_singleton()->particles_set_emission_transform(particles, xf);
+ RS::get_singleton()->particles_set_emission_transform(particles, xf);
}
void GPUParticles2D::set_process_material(const Ref<Material> &p_material) {
@@ -139,7 +139,7 @@ void GPUParticles2D::set_process_material(const Ref<Material> &p_material) {
RID material_rid;
if (process_material.is_valid())
material_rid = process_material->get_rid();
- VS::get_singleton()->particles_set_process_material(particles, material_rid);
+ RS::get_singleton()->particles_set_process_material(particles, material_rid);
update_configuration_warning();
}
@@ -147,12 +147,12 @@ void GPUParticles2D::set_process_material(const Ref<Material> &p_material) {
void GPUParticles2D::set_speed_scale(float p_scale) {
speed_scale = p_scale;
- VS::get_singleton()->particles_set_speed_scale(particles, p_scale);
+ RS::get_singleton()->particles_set_speed_scale(particles, p_scale);
}
bool GPUParticles2D::is_emitting() const {
- return VS::get_singleton()->particles_get_emitting(particles);
+ return RS::get_singleton()->particles_get_emitting(particles);
}
int GPUParticles2D::get_amount() const {
@@ -200,7 +200,7 @@ float GPUParticles2D::get_speed_scale() const {
void GPUParticles2D::set_draw_order(DrawOrder p_order) {
draw_order = p_order;
- VS::get_singleton()->particles_set_draw_order(particles, VS::ParticlesDrawOrder(p_order));
+ RS::get_singleton()->particles_set_draw_order(particles, RS::ParticlesDrawOrder(p_order));
}
GPUParticles2D::DrawOrder GPUParticles2D::get_draw_order() const {
@@ -210,7 +210,7 @@ GPUParticles2D::DrawOrder GPUParticles2D::get_draw_order() const {
void GPUParticles2D::set_fixed_fps(int p_count) {
fixed_fps = p_count;
- VS::get_singleton()->particles_set_fixed_fps(particles, p_count);
+ RS::get_singleton()->particles_set_fixed_fps(particles, p_count);
}
int GPUParticles2D::get_fixed_fps() const {
@@ -219,7 +219,7 @@ int GPUParticles2D::get_fixed_fps() const {
void GPUParticles2D::set_fractional_delta(bool p_enable) {
fractional_delta = p_enable;
- VS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
+ RS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
}
bool GPUParticles2D::get_fractional_delta() const {
@@ -228,7 +228,7 @@ bool GPUParticles2D::get_fractional_delta() const {
String GPUParticles2D::get_configuration_warning() const {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
return TTR("GPU-based particles are not supported by the GLES2 video driver.\nUse the CPUParticles2D node instead. You can use the \"Convert to CPUParticles\" option for this purpose.");
}
@@ -259,7 +259,7 @@ String GPUParticles2D::get_configuration_warning() const {
Rect2 GPUParticles2D::capture_rect() const {
- AABB aabb = VS::get_singleton()->particles_get_current_aabb(particles);
+ AABB aabb = RS::get_singleton()->particles_get_current_aabb(particles);
Rect2 r;
r.position.x = aabb.position.x;
r.position.y = aabb.position.y;
@@ -291,8 +291,8 @@ void GPUParticles2D::_validate_property(PropertyInfo &property) const {
}
void GPUParticles2D::restart() {
- VS::get_singleton()->particles_restart(particles);
- VS::get_singleton()->particles_set_emitting(particles, true);
+ RS::get_singleton()->particles_restart(particles);
+ RS::get_singleton()->particles_set_emitting(particles, true);
}
void GPUParticles2D::_notification(int p_what) {
@@ -306,7 +306,7 @@ void GPUParticles2D::_notification(int p_what) {
if (normal_map.is_valid())
normal_rid = normal_map->get_rid();
- VS::get_singleton()->canvas_item_add_particles(get_canvas_item(), particles, texture_rid, normal_rid);
+ RS::get_singleton()->canvas_item_add_particles(get_canvas_item(), particles, texture_rid, normal_rid);
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint() && (this == get_tree()->get_edited_scene_root() || get_tree()->get_edited_scene_root()->is_a_parent_of(this))) {
@@ -318,10 +318,10 @@ void GPUParticles2D::_notification(int p_what) {
if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) {
if (can_process()) {
- VS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
+ RS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
} else {
- VS::get_singleton()->particles_set_speed_scale(particles, 0);
+ RS::get_singleton()->particles_set_speed_scale(particles, 0);
}
}
@@ -408,7 +408,7 @@ void GPUParticles2D::_bind_methods() {
GPUParticles2D::GPUParticles2D() {
- particles = VS::get_singleton()->particles_create();
+ particles = RS::get_singleton()->particles_create();
one_shot = false; // Needed so that set_emitting doesn't access uninitialized values
set_emitting(true);
@@ -428,5 +428,5 @@ GPUParticles2D::GPUParticles2D() {
GPUParticles2D::~GPUParticles2D() {
- VS::get_singleton()->free(particles);
+ RS::get_singleton()->free(particles);
}
diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp
index 9cc9ab25ac..6cbb0d2a39 100644
--- a/scene/2d/joints_2d.cpp
+++ b/scene/2d/joints_2d.cpp
@@ -32,15 +32,15 @@
#include "core/engine.h"
#include "physics_body_2d.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
void Joint2D::_update_joint(bool p_only_free) {
if (joint.is_valid()) {
if (ba.is_valid() && bb.is_valid() && exclude_from_collision)
- Physics2DServer::get_singleton()->joint_disable_collisions_between_bodies(joint, false);
+ PhysicsServer2D::get_singleton()->joint_disable_collisions_between_bodies(joint, false);
- Physics2DServer::get_singleton()->free(joint);
+ PhysicsServer2D::get_singleton()->free(joint);
joint = RID();
ba = RID();
bb = RID();
@@ -66,12 +66,12 @@ void Joint2D::_update_joint(bool p_only_free) {
if (!joint.is_valid())
return;
- Physics2DServer::get_singleton()->get_singleton()->joint_set_param(joint, Physics2DServer::JOINT_PARAM_BIAS, bias);
+ PhysicsServer2D::get_singleton()->get_singleton()->joint_set_param(joint, PhysicsServer2D::JOINT_PARAM_BIAS, bias);
ba = body_a->get_rid();
bb = body_b->get_rid();
- Physics2DServer::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
+ PhysicsServer2D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
}
void Joint2D::set_node_a(const NodePath &p_node_a) {
@@ -119,7 +119,7 @@ void Joint2D::set_bias(real_t p_bias) {
bias = p_bias;
if (joint.is_valid())
- Physics2DServer::get_singleton()->get_singleton()->joint_set_param(joint, Physics2DServer::JOINT_PARAM_BIAS, bias);
+ PhysicsServer2D::get_singleton()->get_singleton()->joint_set_param(joint, PhysicsServer2D::JOINT_PARAM_BIAS, bias);
}
real_t Joint2D::get_bias() const {
@@ -192,8 +192,8 @@ void PinJoint2D::_notification(int p_what) {
RID PinJoint2D::_configure_joint(PhysicsBody2D *body_a, PhysicsBody2D *body_b) {
- RID pj = Physics2DServer::get_singleton()->pin_joint_create(get_global_transform().get_origin(), body_a->get_rid(), body_b ? body_b->get_rid() : RID());
- Physics2DServer::get_singleton()->pin_joint_set_param(pj, Physics2DServer::PIN_JOINT_SOFTNESS, softness);
+ RID pj = PhysicsServer2D::get_singleton()->pin_joint_create(get_global_transform().get_origin(), body_a->get_rid(), body_b ? body_b->get_rid() : RID());
+ PhysicsServer2D::get_singleton()->pin_joint_set_param(pj, PhysicsServer2D::PIN_JOINT_SOFTNESS, softness);
return pj;
}
@@ -202,7 +202,7 @@ void PinJoint2D::set_softness(real_t p_softness) {
softness = p_softness;
update();
if (get_joint().is_valid())
- Physics2DServer::get_singleton()->pin_joint_set_param(get_joint(), Physics2DServer::PIN_JOINT_SOFTNESS, p_softness);
+ PhysicsServer2D::get_singleton()->pin_joint_set_param(get_joint(), PhysicsServer2D::PIN_JOINT_SOFTNESS, p_softness);
}
real_t PinJoint2D::get_softness() const {
@@ -253,7 +253,7 @@ RID GrooveJoint2D::_configure_joint(PhysicsBody2D *body_a, PhysicsBody2D *body_b
Vector2 groove_A2 = gt.xform(Vector2(0, length));
Vector2 anchor_B = gt.xform(Vector2(0, initial_offset));
- return Physics2DServer::get_singleton()->groove_joint_create(groove_A1, groove_A2, anchor_B, body_a->get_rid(), body_b->get_rid());
+ return PhysicsServer2D::get_singleton()->groove_joint_create(groove_A1, groove_A2, anchor_B, body_a->get_rid(), body_b->get_rid());
}
void GrooveJoint2D::set_length(real_t p_length) {
@@ -324,11 +324,11 @@ RID DampedSpringJoint2D::_configure_joint(PhysicsBody2D *body_a, PhysicsBody2D *
Vector2 anchor_A = gt.get_origin();
Vector2 anchor_B = gt.xform(Vector2(0, length));
- RID dsj = Physics2DServer::get_singleton()->damped_spring_joint_create(anchor_A, anchor_B, body_a->get_rid(), body_b->get_rid());
+ RID dsj = PhysicsServer2D::get_singleton()->damped_spring_joint_create(anchor_A, anchor_B, body_a->get_rid(), body_b->get_rid());
if (rest_length)
- Physics2DServer::get_singleton()->damped_string_joint_set_param(dsj, Physics2DServer::DAMPED_STRING_REST_LENGTH, rest_length);
- Physics2DServer::get_singleton()->damped_string_joint_set_param(dsj, Physics2DServer::DAMPED_STRING_STIFFNESS, stiffness);
- Physics2DServer::get_singleton()->damped_string_joint_set_param(dsj, Physics2DServer::DAMPED_STRING_DAMPING, damping);
+ PhysicsServer2D::get_singleton()->damped_string_joint_set_param(dsj, PhysicsServer2D::DAMPED_STRING_REST_LENGTH, rest_length);
+ PhysicsServer2D::get_singleton()->damped_string_joint_set_param(dsj, PhysicsServer2D::DAMPED_STRING_STIFFNESS, stiffness);
+ PhysicsServer2D::get_singleton()->damped_string_joint_set_param(dsj, PhysicsServer2D::DAMPED_STRING_DAMPING, damping);
return dsj;
}
@@ -349,7 +349,7 @@ void DampedSpringJoint2D::set_rest_length(real_t p_rest_length) {
rest_length = p_rest_length;
update();
if (get_joint().is_valid())
- Physics2DServer::get_singleton()->damped_string_joint_set_param(get_joint(), Physics2DServer::DAMPED_STRING_REST_LENGTH, p_rest_length ? p_rest_length : length);
+ PhysicsServer2D::get_singleton()->damped_string_joint_set_param(get_joint(), PhysicsServer2D::DAMPED_STRING_REST_LENGTH, p_rest_length ? p_rest_length : length);
}
real_t DampedSpringJoint2D::get_rest_length() const {
@@ -362,7 +362,7 @@ void DampedSpringJoint2D::set_stiffness(real_t p_stiffness) {
stiffness = p_stiffness;
update();
if (get_joint().is_valid())
- Physics2DServer::get_singleton()->damped_string_joint_set_param(get_joint(), Physics2DServer::DAMPED_STRING_STIFFNESS, p_stiffness);
+ PhysicsServer2D::get_singleton()->damped_string_joint_set_param(get_joint(), PhysicsServer2D::DAMPED_STRING_STIFFNESS, p_stiffness);
}
real_t DampedSpringJoint2D::get_stiffness() const {
@@ -375,7 +375,7 @@ void DampedSpringJoint2D::set_damping(real_t p_damping) {
damping = p_damping;
update();
if (get_joint().is_valid())
- Physics2DServer::get_singleton()->damped_string_joint_set_param(get_joint(), Physics2DServer::DAMPED_STRING_DAMPING, p_damping);
+ PhysicsServer2D::get_singleton()->damped_string_joint_set_param(get_joint(), PhysicsServer2D::DAMPED_STRING_DAMPING, p_damping);
}
real_t DampedSpringJoint2D::get_damping() const {
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index e61b1fa339..b3d54b81f8 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -31,7 +31,7 @@
#include "light_2d.h"
#include "core/engine.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#ifdef TOOLS_ENABLED
Dictionary Light2D::_edit_get_state() const {
@@ -100,7 +100,7 @@ void Light2D::_update_light_visibility() {
}
#endif
- VS::get_singleton()->canvas_light_set_enabled(canvas_light, enabled && is_visible_in_tree() && editor_ok);
+ RS::get_singleton()->canvas_light_set_enabled(canvas_light, enabled && is_visible_in_tree() && editor_ok);
}
void Light2D::set_enabled(bool p_enabled) {
@@ -129,9 +129,9 @@ void Light2D::set_texture(const Ref<Texture2D> &p_texture) {
texture = p_texture;
if (texture.is_valid())
- VS::get_singleton()->canvas_light_set_texture(canvas_light, texture->get_rid());
+ RS::get_singleton()->canvas_light_set_texture(canvas_light, texture->get_rid());
else
- VS::get_singleton()->canvas_light_set_texture(canvas_light, RID());
+ RS::get_singleton()->canvas_light_set_texture(canvas_light, RID());
update_configuration_warning();
}
@@ -144,7 +144,7 @@ Ref<Texture2D> Light2D::get_texture() const {
void Light2D::set_texture_offset(const Vector2 &p_offset) {
texture_offset = p_offset;
- VS::get_singleton()->canvas_light_set_texture_offset(canvas_light, texture_offset);
+ RS::get_singleton()->canvas_light_set_texture_offset(canvas_light, texture_offset);
item_rect_changed();
_change_notify("offset");
}
@@ -157,7 +157,7 @@ Vector2 Light2D::get_texture_offset() const {
void Light2D::set_color(const Color &p_color) {
color = p_color;
- VS::get_singleton()->canvas_light_set_color(canvas_light, color);
+ RS::get_singleton()->canvas_light_set_color(canvas_light, color);
}
Color Light2D::get_color() const {
@@ -167,7 +167,7 @@ Color Light2D::get_color() const {
void Light2D::set_height(float p_height) {
height = p_height;
- VS::get_singleton()->canvas_light_set_height(canvas_light, height);
+ RS::get_singleton()->canvas_light_set_height(canvas_light, height);
}
float Light2D::get_height() const {
@@ -178,7 +178,7 @@ float Light2D::get_height() const {
void Light2D::set_energy(float p_energy) {
energy = p_energy;
- VS::get_singleton()->canvas_light_set_energy(canvas_light, energy);
+ RS::get_singleton()->canvas_light_set_energy(canvas_light, energy);
}
float Light2D::get_energy() const {
@@ -193,7 +193,7 @@ void Light2D::set_texture_scale(float p_scale) {
if (_scale == 0) {
_scale = CMP_EPSILON;
}
- VS::get_singleton()->canvas_light_set_scale(canvas_light, _scale);
+ RS::get_singleton()->canvas_light_set_scale(canvas_light, _scale);
item_rect_changed();
}
@@ -205,7 +205,7 @@ float Light2D::get_texture_scale() const {
void Light2D::set_z_range_min(int p_min_z) {
z_min = p_min_z;
- VS::get_singleton()->canvas_light_set_z_range(canvas_light, z_min, z_max);
+ RS::get_singleton()->canvas_light_set_z_range(canvas_light, z_min, z_max);
}
int Light2D::get_z_range_min() const {
@@ -215,7 +215,7 @@ int Light2D::get_z_range_min() const {
void Light2D::set_z_range_max(int p_max_z) {
z_max = p_max_z;
- VS::get_singleton()->canvas_light_set_z_range(canvas_light, z_min, z_max);
+ RS::get_singleton()->canvas_light_set_z_range(canvas_light, z_min, z_max);
}
int Light2D::get_z_range_max() const {
@@ -225,7 +225,7 @@ int Light2D::get_z_range_max() const {
void Light2D::set_layer_range_min(int p_min_layer) {
layer_min = p_min_layer;
- VS::get_singleton()->canvas_light_set_layer_range(canvas_light, layer_min, layer_max);
+ RS::get_singleton()->canvas_light_set_layer_range(canvas_light, layer_min, layer_max);
}
int Light2D::get_layer_range_min() const {
@@ -235,7 +235,7 @@ int Light2D::get_layer_range_min() const {
void Light2D::set_layer_range_max(int p_max_layer) {
layer_max = p_max_layer;
- VS::get_singleton()->canvas_light_set_layer_range(canvas_light, layer_min, layer_max);
+ RS::get_singleton()->canvas_light_set_layer_range(canvas_light, layer_min, layer_max);
}
int Light2D::get_layer_range_max() const {
@@ -245,7 +245,7 @@ int Light2D::get_layer_range_max() const {
void Light2D::set_item_cull_mask(int p_mask) {
item_mask = p_mask;
- VS::get_singleton()->canvas_light_set_item_cull_mask(canvas_light, item_mask);
+ RS::get_singleton()->canvas_light_set_item_cull_mask(canvas_light, item_mask);
}
int Light2D::get_item_cull_mask() const {
@@ -256,7 +256,7 @@ int Light2D::get_item_cull_mask() const {
void Light2D::set_item_shadow_cull_mask(int p_mask) {
item_shadow_mask = p_mask;
- VS::get_singleton()->canvas_light_set_item_shadow_cull_mask(canvas_light, item_shadow_mask);
+ RS::get_singleton()->canvas_light_set_item_shadow_cull_mask(canvas_light, item_shadow_mask);
}
int Light2D::get_item_shadow_cull_mask() const {
@@ -267,7 +267,7 @@ int Light2D::get_item_shadow_cull_mask() const {
void Light2D::set_mode(Mode p_mode) {
mode = p_mode;
- VS::get_singleton()->canvas_light_set_mode(canvas_light, VS::CanvasLightMode(p_mode));
+ RS::get_singleton()->canvas_light_set_mode(canvas_light, RS::CanvasLightMode(p_mode));
}
Light2D::Mode Light2D::get_mode() const {
@@ -278,7 +278,7 @@ Light2D::Mode Light2D::get_mode() const {
void Light2D::set_shadow_enabled(bool p_enabled) {
shadow = p_enabled;
- VS::get_singleton()->canvas_light_set_shadow_enabled(canvas_light, shadow);
+ RS::get_singleton()->canvas_light_set_shadow_enabled(canvas_light, shadow);
}
bool Light2D::is_shadow_enabled() const {
@@ -288,7 +288,7 @@ bool Light2D::is_shadow_enabled() const {
void Light2D::set_shadow_buffer_size(int p_size) {
shadow_buffer_size = p_size;
- VS::get_singleton()->canvas_light_set_shadow_buffer_size(canvas_light, shadow_buffer_size);
+ RS::get_singleton()->canvas_light_set_shadow_buffer_size(canvas_light, shadow_buffer_size);
}
int Light2D::get_shadow_buffer_size() const {
@@ -299,7 +299,7 @@ int Light2D::get_shadow_buffer_size() const {
void Light2D::set_shadow_filter(ShadowFilter p_filter) {
ERR_FAIL_INDEX(p_filter, SHADOW_FILTER_MAX);
shadow_filter = p_filter;
- VS::get_singleton()->canvas_light_set_shadow_filter(canvas_light, VS::CanvasLightShadowFilter(p_filter));
+ RS::get_singleton()->canvas_light_set_shadow_filter(canvas_light, RS::CanvasLightShadowFilter(p_filter));
}
Light2D::ShadowFilter Light2D::get_shadow_filter() const {
@@ -309,7 +309,7 @@ Light2D::ShadowFilter Light2D::get_shadow_filter() const {
void Light2D::set_shadow_color(const Color &p_shadow_color) {
shadow_color = p_shadow_color;
- VS::get_singleton()->canvas_light_set_shadow_color(canvas_light, shadow_color);
+ RS::get_singleton()->canvas_light_set_shadow_color(canvas_light, shadow_color);
}
Color Light2D::get_shadow_color() const {
@@ -320,13 +320,13 @@ void Light2D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- VS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, get_canvas());
+ RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, get_canvas());
_update_light_visibility();
}
if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
- VS::get_singleton()->canvas_light_set_transform(canvas_light, get_global_transform());
+ RS::get_singleton()->canvas_light_set_transform(canvas_light, get_global_transform());
}
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
@@ -335,7 +335,7 @@ void Light2D::_notification(int p_what) {
if (p_what == NOTIFICATION_EXIT_TREE) {
- VS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, RID());
+ RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, RID());
_update_light_visibility();
}
}
@@ -352,7 +352,7 @@ String Light2D::get_configuration_warning() const {
void Light2D::set_shadow_smooth(float p_amount) {
shadow_smooth = p_amount;
- VS::get_singleton()->canvas_light_set_shadow_smooth(canvas_light, shadow_smooth);
+ RS::get_singleton()->canvas_light_set_shadow_smooth(canvas_light, shadow_smooth);
}
float Light2D::get_shadow_smooth() const {
@@ -432,8 +432,8 @@ void Light2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Add,Sub,Mix,Mask"), "set_mode", "get_mode");
ADD_GROUP("Range", "range_");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "range_height", PROPERTY_HINT_RANGE, "-2048,2048,0.1,or_lesser,or_greater"), "set_height", "get_height");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_min", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_min", "get_z_range_min");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_max", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_max", "get_z_range_max");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_min", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_min", "get_z_range_min");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_max", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_max", "get_z_range_max");
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_layer_min", PROPERTY_HINT_RANGE, "-512,512,1"), "set_layer_range_min", "get_layer_range_min");
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_layer_max", PROPERTY_HINT_RANGE, "-512,512,1"), "set_layer_range_max", "get_layer_range_max");
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_item_cull_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_item_cull_mask", "get_item_cull_mask");
@@ -458,7 +458,7 @@ void Light2D::_bind_methods() {
Light2D::Light2D() {
- canvas_light = VisualServer::get_singleton()->canvas_light_create();
+ canvas_light = RenderingServer::get_singleton()->canvas_light_create();
enabled = true;
editor_only = false;
shadow = false;
@@ -483,5 +483,5 @@ Light2D::Light2D() {
Light2D::~Light2D() {
- VisualServer::get_singleton()->free(canvas_light);
+ RenderingServer::get_singleton()->free(canvas_light);
}
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp
index d4a5c93823..bd1a820aec 100644
--- a/scene/2d/light_occluder_2d.cpp
+++ b/scene/2d/light_occluder_2d.cpp
@@ -88,7 +88,7 @@ void OccluderPolygon2D::set_polygon(const Vector<Vector2> &p_polygon) {
polygon = p_polygon;
rect_cache_dirty = true;
- VS::get_singleton()->canvas_occluder_polygon_set_shape(occ_polygon, p_polygon, closed);
+ RS::get_singleton()->canvas_occluder_polygon_set_shape(occ_polygon, p_polygon, closed);
emit_changed();
}
@@ -103,7 +103,7 @@ void OccluderPolygon2D::set_closed(bool p_closed) {
return;
closed = p_closed;
if (polygon.size())
- VS::get_singleton()->canvas_occluder_polygon_set_shape(occ_polygon, polygon, closed);
+ RS::get_singleton()->canvas_occluder_polygon_set_shape(occ_polygon, polygon, closed);
emit_changed();
}
@@ -115,7 +115,7 @@ bool OccluderPolygon2D::is_closed() const {
void OccluderPolygon2D::set_cull_mode(CullMode p_mode) {
cull = p_mode;
- VS::get_singleton()->canvas_occluder_polygon_set_cull_mode(occ_polygon, VS::CanvasOccluderPolygonCullMode(p_mode));
+ RS::get_singleton()->canvas_occluder_polygon_set_cull_mode(occ_polygon, RS::CanvasOccluderPolygonCullMode(p_mode));
}
OccluderPolygon2D::CullMode OccluderPolygon2D::get_cull_mode() const {
@@ -150,7 +150,7 @@ void OccluderPolygon2D::_bind_methods() {
OccluderPolygon2D::OccluderPolygon2D() {
- occ_polygon = VS::get_singleton()->canvas_occluder_polygon_create();
+ occ_polygon = RS::get_singleton()->canvas_occluder_polygon_create();
closed = true;
cull = CULL_DISABLED;
rect_cache_dirty = true;
@@ -158,7 +158,7 @@ OccluderPolygon2D::OccluderPolygon2D() {
OccluderPolygon2D::~OccluderPolygon2D() {
- VS::get_singleton()->free(occ_polygon);
+ RS::get_singleton()->free(occ_polygon);
}
void LightOccluder2D::_poly_changed() {
@@ -172,17 +172,17 @@ void LightOccluder2D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_CANVAS) {
- VS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder, get_canvas());
- VS::get_singleton()->canvas_light_occluder_set_transform(occluder, get_global_transform());
- VS::get_singleton()->canvas_light_occluder_set_enabled(occluder, is_visible_in_tree());
+ RS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder, get_canvas());
+ RS::get_singleton()->canvas_light_occluder_set_transform(occluder, get_global_transform());
+ RS::get_singleton()->canvas_light_occluder_set_enabled(occluder, is_visible_in_tree());
}
if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
- VS::get_singleton()->canvas_light_occluder_set_transform(occluder, get_global_transform());
+ RS::get_singleton()->canvas_light_occluder_set_transform(occluder, get_global_transform());
}
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
- VS::get_singleton()->canvas_light_occluder_set_enabled(occluder, is_visible_in_tree());
+ RS::get_singleton()->canvas_light_occluder_set_enabled(occluder, is_visible_in_tree());
}
if (p_what == NOTIFICATION_DRAW) {
@@ -214,7 +214,7 @@ void LightOccluder2D::_notification(int p_what) {
if (p_what == NOTIFICATION_EXIT_CANVAS) {
- VS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder, RID());
+ RS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder, RID());
}
}
@@ -239,9 +239,9 @@ void LightOccluder2D::set_occluder_polygon(const Ref<OccluderPolygon2D> &p_polyg
occluder_polygon = p_polygon;
if (occluder_polygon.is_valid())
- VS::get_singleton()->canvas_light_occluder_set_polygon(occluder, occluder_polygon->get_rid());
+ RS::get_singleton()->canvas_light_occluder_set_polygon(occluder, occluder_polygon->get_rid());
else
- VS::get_singleton()->canvas_light_occluder_set_polygon(occluder, RID());
+ RS::get_singleton()->canvas_light_occluder_set_polygon(occluder, RID());
#ifdef DEBUG_ENABLED
if (occluder_polygon.is_valid())
@@ -258,7 +258,7 @@ Ref<OccluderPolygon2D> LightOccluder2D::get_occluder_polygon() const {
void LightOccluder2D::set_occluder_light_mask(int p_mask) {
mask = p_mask;
- VS::get_singleton()->canvas_light_occluder_set_light_mask(occluder, mask);
+ RS::get_singleton()->canvas_light_occluder_set_light_mask(occluder, mask);
}
int LightOccluder2D::get_occluder_light_mask() const {
@@ -293,12 +293,12 @@ void LightOccluder2D::_bind_methods() {
LightOccluder2D::LightOccluder2D() {
- occluder = VS::get_singleton()->canvas_light_occluder_create();
+ occluder = RS::get_singleton()->canvas_light_occluder_create();
mask = 1;
set_notify_transform(true);
}
LightOccluder2D::~LightOccluder2D() {
- VS::get_singleton()->free(occluder);
+ RS::get_singleton()->free(occluder);
}
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index 873c901c0a..c45eab70df 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -311,7 +311,7 @@ void Line2D::_draw() {
lb.build();
- VS::get_singleton()->canvas_item_add_triangle_array(
+ RS::get_singleton()->canvas_item_add_triangle_array(
get_canvas_item(),
lb.indices,
lb.vertices,
diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp
index bbabfa16c7..ae9fc0f32c 100644
--- a/scene/2d/navigation_2d.cpp
+++ b/scene/2d/navigation_2d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "navigation_2d.h"
-#include "servers/navigation_2d_server.h"
+#include "servers/navigation_server_2d.h"
void Navigation2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_rid"), &Navigation2D::get_rid);
@@ -51,44 +51,44 @@ void Navigation2D::_bind_methods() {
void Navigation2D::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
- Navigation2DServer::get_singleton()->map_set_active(map, true);
+ NavigationServer2D::get_singleton()->map_set_active(map, true);
} break;
case NOTIFICATION_EXIT_TREE: {
- Navigation2DServer::get_singleton()->map_set_active(map, false);
+ NavigationServer2D::get_singleton()->map_set_active(map, false);
} break;
}
}
void Navigation2D::set_cell_size(float p_cell_size) {
cell_size = p_cell_size;
- Navigation2DServer::get_singleton()->map_set_cell_size(map, cell_size);
+ NavigationServer2D::get_singleton()->map_set_cell_size(map, cell_size);
}
void Navigation2D::set_edge_connection_margin(float p_edge_connection_margin) {
edge_connection_margin = p_edge_connection_margin;
- Navigation2DServer::get_singleton()->map_set_edge_connection_margin(map, edge_connection_margin);
+ NavigationServer2D::get_singleton()->map_set_edge_connection_margin(map, edge_connection_margin);
}
Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vector2 &p_end, bool p_optimize) const {
- return Navigation2DServer::get_singleton()->map_get_path(map, p_start, p_end, p_optimize);
+ return NavigationServer2D::get_singleton()->map_get_path(map, p_start, p_end, p_optimize);
}
Vector2 Navigation2D::get_closest_point(const Vector2 &p_point) const {
- return Navigation2DServer::get_singleton()->map_get_closest_point(map, p_point);
+ return NavigationServer2D::get_singleton()->map_get_closest_point(map, p_point);
}
RID Navigation2D::get_closest_point_owner(const Vector2 &p_point) const {
- return Navigation2DServer::get_singleton()->map_get_closest_point_owner(map, p_point);
+ return NavigationServer2D::get_singleton()->map_get_closest_point_owner(map, p_point);
}
Navigation2D::Navigation2D() {
- map = Navigation2DServer::get_singleton()->map_create();
+ map = NavigationServer2D::get_singleton()->map_create();
set_cell_size(10); // Ten pixels
set_edge_connection_margin(100);
}
Navigation2D::~Navigation2D() {
- Navigation2DServer::get_singleton()->free(map);
+ NavigationServer2D::get_singleton()->free(map);
}
diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp
index e345a076ae..c70d5ab1fe 100644
--- a/scene/2d/navigation_agent_2d.cpp
+++ b/scene/2d/navigation_agent_2d.cpp
@@ -32,7 +32,7 @@
#include "core/engine.h"
#include "scene/2d/navigation_2d.h"
-#include "servers/navigation_2d_server.h"
+#include "servers/navigation_server_2d.h"
void NavigationAgent2D::_bind_methods() {
@@ -94,7 +94,7 @@ void NavigationAgent2D::_notification(int p_what) {
agent_parent = Object::cast_to<Node2D>(get_parent());
- Navigation2DServer::get_singleton()->agent_set_callback(agent, this, "_avoidance_done");
+ NavigationServer2D::get_singleton()->agent_set_callback(agent, this, "_avoidance_done");
// Search the navigation node and set it
{
@@ -121,7 +121,7 @@ void NavigationAgent2D::_notification(int p_what) {
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
if (agent_parent) {
- Navigation2DServer::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().get_origin());
+ NavigationServer2D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().get_origin());
if (!target_reached) {
if (distance_to_target() < target_desired_distance) {
emit_signal("target_reached");
@@ -142,7 +142,7 @@ NavigationAgent2D::NavigationAgent2D() :
velocity_submitted(false),
target_reached(false),
navigation_finished(true) {
- agent = Navigation2DServer::get_singleton()->agent_create();
+ agent = NavigationServer2D::get_singleton()->agent_create();
set_neighbor_dist(500.0);
set_max_neighbors(10);
set_time_horizon(20.0);
@@ -151,7 +151,7 @@ NavigationAgent2D::NavigationAgent2D() :
}
NavigationAgent2D::~NavigationAgent2D() {
- Navigation2DServer::get_singleton()->free(agent);
+ NavigationServer2D::get_singleton()->free(agent);
agent = RID(); // Pointless
}
@@ -160,7 +160,7 @@ void NavigationAgent2D::set_navigation(Navigation2D *p_nav) {
return; // Pointless
navigation = p_nav;
- Navigation2DServer::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
+ NavigationServer2D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
}
void NavigationAgent2D::set_navigation_node(Node *p_nav) {
@@ -179,27 +179,27 @@ void NavigationAgent2D::set_target_desired_distance(real_t p_dd) {
void NavigationAgent2D::set_radius(real_t p_radius) {
radius = p_radius;
- Navigation2DServer::get_singleton()->agent_set_radius(agent, radius);
+ NavigationServer2D::get_singleton()->agent_set_radius(agent, radius);
}
void NavigationAgent2D::set_neighbor_dist(real_t p_dist) {
neighbor_dist = p_dist;
- Navigation2DServer::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
+ NavigationServer2D::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
}
void NavigationAgent2D::set_max_neighbors(int p_count) {
max_neighbors = p_count;
- Navigation2DServer::get_singleton()->agent_set_max_neighbors(agent, max_neighbors);
+ NavigationServer2D::get_singleton()->agent_set_max_neighbors(agent, max_neighbors);
}
void NavigationAgent2D::set_time_horizon(real_t p_time) {
time_horizon = p_time;
- Navigation2DServer::get_singleton()->agent_set_time_horizon(agent, time_horizon);
+ NavigationServer2D::get_singleton()->agent_set_time_horizon(agent, time_horizon);
}
void NavigationAgent2D::set_max_speed(real_t p_max_speed) {
max_speed = p_max_speed;
- Navigation2DServer::get_singleton()->agent_set_max_speed(agent, max_speed);
+ NavigationServer2D::get_singleton()->agent_set_max_speed(agent, max_speed);
}
void NavigationAgent2D::set_path_max_distance(real_t p_pmd) {
@@ -260,8 +260,8 @@ Vector2 NavigationAgent2D::get_final_location() {
void NavigationAgent2D::set_velocity(Vector2 p_velocity) {
target_velocity = p_velocity;
- Navigation2DServer::get_singleton()->agent_set_target_velocity(agent, target_velocity);
- Navigation2DServer::get_singleton()->agent_set_velocity(agent, prev_safe_velocity);
+ NavigationServer2D::get_singleton()->agent_set_target_velocity(agent, target_velocity);
+ NavigationServer2D::get_singleton()->agent_set_velocity(agent, prev_safe_velocity);
velocity_submitted = true;
}
@@ -298,7 +298,7 @@ void NavigationAgent2D::update_navigation() {
bool reload_path = false;
- if (Navigation2DServer::get_singleton()->agent_is_map_changed(agent)) {
+ if (NavigationServer2D::get_singleton()->agent_is_map_changed(agent)) {
reload_path = true;
} else if (navigation_path.size() == 0) {
reload_path = true;
@@ -317,7 +317,7 @@ void NavigationAgent2D::update_navigation() {
}
if (reload_path) {
- navigation_path = Navigation2DServer::get_singleton()->map_get_path(navigation->get_rid(), o, target_location, true);
+ navigation_path = NavigationServer2D::get_singleton()->map_get_path(navigation->get_rid(), o, target_location, true);
navigation_finished = false;
nav_path_index = 0;
emit_signal("path_changed");
diff --git a/scene/2d/navigation_obstacle_2d.cpp b/scene/2d/navigation_obstacle_2d.cpp
index cc9f5740a9..4c6e777e73 100644
--- a/scene/2d/navigation_obstacle_2d.cpp
+++ b/scene/2d/navigation_obstacle_2d.cpp
@@ -33,7 +33,7 @@
#include "scene/2d/collision_shape_2d.h"
#include "scene/2d/navigation_2d.h"
#include "scene/2d/physics_body_2d.h"
-#include "servers/navigation_2d_server.h"
+#include "servers/navigation_server_2d.h"
void NavigationObstacle2D::_bind_methods() {
@@ -71,7 +71,7 @@ void NavigationObstacle2D::_notification(int p_what) {
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
Node2D *node = Object::cast_to<Node2D>(get_parent());
if (node) {
- Navigation2DServer::get_singleton()->agent_set_position(agent, node->get_global_transform().get_origin());
+ NavigationServer2D::get_singleton()->agent_set_position(agent, node->get_global_transform().get_origin());
}
} break;
@@ -81,11 +81,11 @@ void NavigationObstacle2D::_notification(int p_what) {
NavigationObstacle2D::NavigationObstacle2D() :
navigation(NULL),
agent(RID()) {
- agent = Navigation2DServer::get_singleton()->agent_create();
+ agent = NavigationServer2D::get_singleton()->agent_create();
}
NavigationObstacle2D::~NavigationObstacle2D() {
- Navigation2DServer::get_singleton()->free(agent);
+ NavigationServer2D::get_singleton()->free(agent);
agent = RID(); // Pointless
}
@@ -94,7 +94,7 @@ void NavigationObstacle2D::set_navigation(Navigation2D *p_nav) {
return; // Pointless
navigation = p_nav;
- Navigation2DServer::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
+ NavigationServer2D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
}
void NavigationObstacle2D::set_navigation_node(Node *p_nav) {
@@ -146,9 +146,9 @@ void NavigationObstacle2D::update_agent_shape() {
radius = 1.0; // Never a 0 radius
// Initialize the Agent as an object
- Navigation2DServer::get_singleton()->agent_set_neighbor_dist(agent, 0.0);
- Navigation2DServer::get_singleton()->agent_set_max_neighbors(agent, 0);
- Navigation2DServer::get_singleton()->agent_set_time_horizon(agent, 0.0);
- Navigation2DServer::get_singleton()->agent_set_radius(agent, radius);
- Navigation2DServer::get_singleton()->agent_set_max_speed(agent, 0.0);
+ NavigationServer2D::get_singleton()->agent_set_neighbor_dist(agent, 0.0);
+ NavigationServer2D::get_singleton()->agent_set_max_neighbors(agent, 0);
+ NavigationServer2D::get_singleton()->agent_set_time_horizon(agent, 0.0);
+ NavigationServer2D::get_singleton()->agent_set_radius(agent, radius);
+ NavigationServer2D::get_singleton()->agent_set_max_speed(agent, 0.0);
}
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp
index bc3e305281..f0839b4597 100644
--- a/scene/2d/navigation_region_2d.cpp
+++ b/scene/2d/navigation_region_2d.cpp
@@ -34,7 +34,7 @@
#include "core/engine.h"
#include "core/os/mutex.h"
#include "navigation_2d.h"
-#include "servers/navigation_2d_server.h"
+#include "servers/navigation_server_2d.h"
#include "thirdparty/misc/triangulator.h"
@@ -385,12 +385,12 @@ void NavigationRegion2D::set_enabled(bool p_enabled) {
if (!enabled) {
- Navigation2DServer::get_singleton()->region_set_map(region, RID());
+ NavigationServer2D::get_singleton()->region_set_map(region, RID());
} else {
if (navigation) {
- Navigation2DServer::get_singleton()->region_set_map(region, navigation->get_rid());
+ NavigationServer2D::get_singleton()->region_set_map(region, navigation->get_rid());
}
}
@@ -429,7 +429,7 @@ void NavigationRegion2D::_notification(int p_what) {
if (enabled) {
- Navigation2DServer::get_singleton()->region_set_map(region, navigation->get_rid());
+ NavigationServer2D::get_singleton()->region_set_map(region, navigation->get_rid());
}
break;
}
@@ -440,14 +440,14 @@ void NavigationRegion2D::_notification(int p_what) {
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
- Navigation2DServer::get_singleton()->region_set_transform(region, get_global_transform());
+ NavigationServer2D::get_singleton()->region_set_transform(region, get_global_transform());
} break;
case NOTIFICATION_EXIT_TREE: {
if (navigation) {
- Navigation2DServer::get_singleton()->region_set_map(region, RID());
+ NavigationServer2D::get_singleton()->region_set_map(region, RID());
}
navigation = NULL;
} break;
@@ -494,7 +494,7 @@ void NavigationRegion2D::_notification(int p_what) {
}
}
}
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, vertices, colors);
+ RS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, vertices, colors);
}
} break;
}
@@ -511,7 +511,7 @@ void NavigationRegion2D::set_navigation_polygon(const Ref<NavigationPolygon> &p_
}
navpoly = p_navpoly;
- Navigation2DServer::get_singleton()->region_set_navpoly(region, p_navpoly);
+ NavigationServer2D::get_singleton()->region_set_navpoly(region, p_navpoly);
if (navpoly.is_valid()) {
navpoly->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NavigationRegion2D::_navpoly_changed));
@@ -572,11 +572,11 @@ NavigationRegion2D::NavigationRegion2D() {
enabled = true;
set_notify_transform(true);
- region = Navigation2DServer::get_singleton()->region_create();
+ region = NavigationServer2D::get_singleton()->region_create();
navigation = NULL;
}
NavigationRegion2D::~NavigationRegion2D() {
- Navigation2DServer::get_singleton()->free(region);
+ NavigationServer2D::get_singleton()->free(region);
}
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 0b0b9820d3..ac8a77b6cb 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -33,7 +33,7 @@
#include "core/message_queue.h"
#include "scene/gui/control.h"
#include "scene/main/window.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#ifdef TOOLS_ENABLED
Dictionary Node2D::_edit_get_state() const {
@@ -136,7 +136,7 @@ void Node2D::_update_transform() {
_mat.set_rotation_and_scale(angle, _scale);
_mat.elements[2] = pos;
- VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), _mat);
+ RenderingServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), _mat);
if (!is_inside_tree())
return;
@@ -315,7 +315,7 @@ void Node2D::set_transform(const Transform2D &p_transform) {
_mat = p_transform;
_xform_dirty = true;
- VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), _mat);
+ RenderingServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), _mat);
if (!is_inside_tree())
return;
@@ -334,10 +334,10 @@ void Node2D::set_global_transform(const Transform2D &p_transform) {
void Node2D::set_z_index(int p_z) {
- ERR_FAIL_COND(p_z < VS::CANVAS_ITEM_Z_MIN);
- ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX);
+ ERR_FAIL_COND(p_z < RS::CANVAS_ITEM_Z_MIN);
+ ERR_FAIL_COND(p_z > RS::CANVAS_ITEM_Z_MAX);
z_index = p_z;
- VS::get_singleton()->canvas_item_set_z_index(get_canvas_item(), z_index);
+ RS::get_singleton()->canvas_item_set_z_index(get_canvas_item(), z_index);
_change_notify("z_index");
}
@@ -346,7 +346,7 @@ void Node2D::set_z_as_relative(bool p_enabled) {
if (z_relative == p_enabled)
return;
z_relative = p_enabled;
- VS::get_singleton()->canvas_item_set_z_as_relative_to_parent(get_canvas_item(), p_enabled);
+ RS::get_singleton()->canvas_item_set_z_as_relative_to_parent(get_canvas_item(), p_enabled);
}
bool Node2D::is_z_relative() const {
@@ -452,7 +452,7 @@ void Node2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform");
ADD_GROUP("Z Index", "");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "z_as_relative"), "set_z_as_relative", "is_z_relative");
}
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 5aea1025ef..181f0f158c 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -78,7 +78,7 @@ void ParallaxLayer::_update_mirroring() {
RID c = pb->get_canvas();
RID ci = get_canvas_item();
Point2 mirrorScale = mirroring * get_scale();
- VisualServer::get_singleton()->canvas_set_item_mirroring(c, ci, mirrorScale);
+ RenderingServer::get_singleton()->canvas_set_item_mirroring(c, ci, mirrorScale);
}
}
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 9bfeca7e56..289860d9c6 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -82,7 +82,7 @@ void PhysicsBody2D::_bind_methods() {
void PhysicsBody2D::set_collision_layer(uint32_t p_layer) {
collision_layer = p_layer;
- Physics2DServer::get_singleton()->body_set_collision_layer(get_rid(), p_layer);
+ PhysicsServer2D::get_singleton()->body_set_collision_layer(get_rid(), p_layer);
}
uint32_t PhysicsBody2D::get_collision_layer() const {
@@ -93,7 +93,7 @@ uint32_t PhysicsBody2D::get_collision_layer() const {
void PhysicsBody2D::set_collision_mask(uint32_t p_mask) {
collision_mask = p_mask;
- Physics2DServer::get_singleton()->body_set_collision_mask(get_rid(), p_mask);
+ PhysicsServer2D::get_singleton()->body_set_collision_mask(get_rid(), p_mask);
}
uint32_t PhysicsBody2D::get_collision_mask() const {
@@ -130,10 +130,10 @@ bool PhysicsBody2D::get_collision_layer_bit(int p_bit) const {
return get_collision_layer() & (1 << p_bit);
}
-PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) :
- CollisionObject2D(Physics2DServer::get_singleton()->body_create(), false) {
+PhysicsBody2D::PhysicsBody2D(PhysicsServer2D::BodyMode p_mode) :
+ CollisionObject2D(PhysicsServer2D::get_singleton()->body_create(), false) {
- Physics2DServer::get_singleton()->body_set_mode(get_rid(), p_mode);
+ PhysicsServer2D::get_singleton()->body_set_mode(get_rid(), p_mode);
collision_layer = 1;
collision_mask = 1;
set_pickable(false);
@@ -141,11 +141,11 @@ PhysicsBody2D::PhysicsBody2D(Physics2DServer::BodyMode p_mode) :
Array PhysicsBody2D::get_collision_exceptions() {
List<RID> exceptions;
- Physics2DServer::get_singleton()->body_get_collision_exceptions(get_rid(), &exceptions);
+ PhysicsServer2D::get_singleton()->body_get_collision_exceptions(get_rid(), &exceptions);
Array ret;
for (List<RID>::Element *E = exceptions.front(); E; E = E->next()) {
RID body = E->get();
- ObjectID instance_id = Physics2DServer::get_singleton()->body_get_object_instance_id(body);
+ ObjectID instance_id = PhysicsServer2D::get_singleton()->body_get_object_instance_id(body);
Object *obj = ObjectDB::get_instance(instance_id);
PhysicsBody2D *physics_body = Object::cast_to<PhysicsBody2D>(obj);
ret.append(physics_body);
@@ -158,7 +158,7 @@ void PhysicsBody2D::add_collision_exception_with(Node *p_node) {
ERR_FAIL_NULL(p_node);
PhysicsBody2D *physics_body = Object::cast_to<PhysicsBody2D>(p_node);
ERR_FAIL_COND_MSG(!physics_body, "Collision exception only works between two objects of PhysicsBody type.");
- Physics2DServer::get_singleton()->body_add_collision_exception(get_rid(), physics_body->get_rid());
+ PhysicsServer2D::get_singleton()->body_add_collision_exception(get_rid(), physics_body->get_rid());
}
void PhysicsBody2D::remove_collision_exception_with(Node *p_node) {
@@ -166,19 +166,19 @@ void PhysicsBody2D::remove_collision_exception_with(Node *p_node) {
ERR_FAIL_NULL(p_node);
PhysicsBody2D *physics_body = Object::cast_to<PhysicsBody2D>(p_node);
ERR_FAIL_COND_MSG(!physics_body, "Collision exception only works between two objects of PhysicsBody type.");
- Physics2DServer::get_singleton()->body_remove_collision_exception(get_rid(), physics_body->get_rid());
+ PhysicsServer2D::get_singleton()->body_remove_collision_exception(get_rid(), physics_body->get_rid());
}
void StaticBody2D::set_constant_linear_velocity(const Vector2 &p_vel) {
constant_linear_velocity = p_vel;
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_LINEAR_VELOCITY, constant_linear_velocity);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_LINEAR_VELOCITY, constant_linear_velocity);
}
void StaticBody2D::set_constant_angular_velocity(real_t p_vel) {
constant_angular_velocity = p_vel;
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_ANGULAR_VELOCITY, constant_angular_velocity);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_ANGULAR_VELOCITY, constant_angular_velocity);
}
Vector2 StaticBody2D::get_constant_linear_velocity() const {
@@ -225,7 +225,7 @@ void StaticBody2D::_bind_methods() {
}
StaticBody2D::StaticBody2D() :
- PhysicsBody2D(Physics2DServer::BODY_MODE_STATIC) {
+ PhysicsBody2D(PhysicsServer2D::BODY_MODE_STATIC) {
constant_angular_velocity = 0;
}
@@ -235,11 +235,11 @@ StaticBody2D::~StaticBody2D() {
void StaticBody2D::_reload_physics_characteristics() {
if (physics_material_override.is_null()) {
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_BOUNCE, 0);
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_FRICTION, 1);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_BOUNCE, 0);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_FRICTION, 1);
} else {
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
}
}
@@ -362,16 +362,16 @@ struct _RigidBody2DInOut {
bool RigidBody2D::_test_motion(const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref<Physics2DTestMotionResult> &p_result) {
- Physics2DServer::MotionResult *r = NULL;
+ PhysicsServer2D::MotionResult *r = NULL;
if (p_result.is_valid())
r = p_result->get_result_ptr();
- return Physics2DServer::get_singleton()->body_test_motion(get_rid(), get_global_transform(), p_motion, p_infinite_inertia, p_margin, r);
+ return PhysicsServer2D::get_singleton()->body_test_motion(get_rid(), get_global_transform(), p_motion, p_infinite_inertia, p_margin, r);
}
void RigidBody2D::_direct_state_changed(Object *p_state) {
#ifdef DEBUG_ENABLED
- state = Object::cast_to<Physics2DDirectBodyState>(p_state);
+ state = Object::cast_to<PhysicsDirectBodyState2D>(p_state);
#else
state = (Physics2DDirectBodyState *)p_state; //trust it
#endif
@@ -484,20 +484,20 @@ void RigidBody2D::set_mode(Mode p_mode) {
case MODE_RIGID: {
- Physics2DServer::get_singleton()->body_set_mode(get_rid(), Physics2DServer::BODY_MODE_RIGID);
+ PhysicsServer2D::get_singleton()->body_set_mode(get_rid(), PhysicsServer2D::BODY_MODE_RIGID);
} break;
case MODE_STATIC: {
- Physics2DServer::get_singleton()->body_set_mode(get_rid(), Physics2DServer::BODY_MODE_STATIC);
+ PhysicsServer2D::get_singleton()->body_set_mode(get_rid(), PhysicsServer2D::BODY_MODE_STATIC);
} break;
case MODE_KINEMATIC: {
- Physics2DServer::get_singleton()->body_set_mode(get_rid(), Physics2DServer::BODY_MODE_KINEMATIC);
+ PhysicsServer2D::get_singleton()->body_set_mode(get_rid(), PhysicsServer2D::BODY_MODE_KINEMATIC);
} break;
case MODE_CHARACTER: {
- Physics2DServer::get_singleton()->body_set_mode(get_rid(), Physics2DServer::BODY_MODE_CHARACTER);
+ PhysicsServer2D::get_singleton()->body_set_mode(get_rid(), PhysicsServer2D::BODY_MODE_CHARACTER);
} break;
}
@@ -514,7 +514,7 @@ void RigidBody2D::set_mass(real_t p_mass) {
mass = p_mass;
_change_notify("mass");
_change_notify("weight");
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_MASS, mass);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_MASS, mass);
}
real_t RigidBody2D::get_mass() const {
@@ -524,12 +524,12 @@ real_t RigidBody2D::get_mass() const {
void RigidBody2D::set_inertia(real_t p_inertia) {
ERR_FAIL_COND(p_inertia < 0);
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_INERTIA, p_inertia);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_INERTIA, p_inertia);
}
real_t RigidBody2D::get_inertia() const {
- return Physics2DServer::get_singleton()->body_get_param(get_rid(), Physics2DServer::BODY_PARAM_INERTIA);
+ return PhysicsServer2D::get_singleton()->body_get_param(get_rid(), PhysicsServer2D::BODY_PARAM_INERTIA);
}
void RigidBody2D::set_weight(real_t p_weight) {
@@ -564,7 +564,7 @@ Ref<PhysicsMaterial> RigidBody2D::get_physics_material_override() const {
void RigidBody2D::set_gravity_scale(real_t p_gravity_scale) {
gravity_scale = p_gravity_scale;
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
}
real_t RigidBody2D::get_gravity_scale() const {
@@ -575,7 +575,7 @@ void RigidBody2D::set_linear_damp(real_t p_linear_damp) {
ERR_FAIL_COND(p_linear_damp < -1);
linear_damp = p_linear_damp;
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_LINEAR_DAMP, linear_damp);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_LINEAR_DAMP, linear_damp);
}
real_t RigidBody2D::get_linear_damp() const {
@@ -586,7 +586,7 @@ void RigidBody2D::set_angular_damp(real_t p_angular_damp) {
ERR_FAIL_COND(p_angular_damp < -1);
angular_damp = p_angular_damp;
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_ANGULAR_DAMP, angular_damp);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_ANGULAR_DAMP, angular_damp);
}
real_t RigidBody2D::get_angular_damp() const {
@@ -602,7 +602,7 @@ void RigidBody2D::set_axis_velocity(const Vector2 &p_axis) {
if (state) {
set_linear_velocity(v);
} else {
- Physics2DServer::get_singleton()->body_set_axis_velocity(get_rid(), p_axis);
+ PhysicsServer2D::get_singleton()->body_set_axis_velocity(get_rid(), p_axis);
linear_velocity = v;
}
}
@@ -614,7 +614,7 @@ void RigidBody2D::set_linear_velocity(const Vector2 &p_velocity) {
state->set_linear_velocity(linear_velocity);
else {
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_LINEAR_VELOCITY, linear_velocity);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_LINEAR_VELOCITY, linear_velocity);
}
}
@@ -629,7 +629,7 @@ void RigidBody2D::set_angular_velocity(real_t p_velocity) {
if (state)
state->set_angular_velocity(angular_velocity);
else
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_ANGULAR_VELOCITY, angular_velocity);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_ANGULAR_VELOCITY, angular_velocity);
}
real_t RigidBody2D::get_angular_velocity() const {
@@ -642,7 +642,7 @@ void RigidBody2D::set_use_custom_integrator(bool p_enable) {
return;
custom_integrator = p_enable;
- Physics2DServer::get_singleton()->body_set_omit_force_integration(get_rid(), p_enable);
+ PhysicsServer2D::get_singleton()->body_set_omit_force_integration(get_rid(), p_enable);
}
bool RigidBody2D::is_using_custom_integrator() {
@@ -652,13 +652,13 @@ bool RigidBody2D::is_using_custom_integrator() {
void RigidBody2D::set_sleeping(bool p_sleeping) {
sleeping = p_sleeping;
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_SLEEPING, sleeping);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_SLEEPING, sleeping);
}
void RigidBody2D::set_can_sleep(bool p_active) {
can_sleep = p_active;
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_CAN_SLEEP, p_active);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_CAN_SLEEP, p_active);
}
bool RigidBody2D::is_able_to_sleep() const {
@@ -674,7 +674,7 @@ bool RigidBody2D::is_sleeping() const {
void RigidBody2D::set_max_contacts_reported(int p_amount) {
max_contacts_reported = p_amount;
- Physics2DServer::get_singleton()->body_set_max_contacts_reported(get_rid(), p_amount);
+ PhysicsServer2D::get_singleton()->body_set_max_contacts_reported(get_rid(), p_amount);
}
int RigidBody2D::get_max_contacts_reported() const {
@@ -683,55 +683,55 @@ int RigidBody2D::get_max_contacts_reported() const {
}
void RigidBody2D::apply_central_impulse(const Vector2 &p_impulse) {
- Physics2DServer::get_singleton()->body_apply_central_impulse(get_rid(), p_impulse);
+ PhysicsServer2D::get_singleton()->body_apply_central_impulse(get_rid(), p_impulse);
}
void RigidBody2D::apply_impulse(const Vector2 &p_offset, const Vector2 &p_impulse) {
- Physics2DServer::get_singleton()->body_apply_impulse(get_rid(), p_offset, p_impulse);
+ PhysicsServer2D::get_singleton()->body_apply_impulse(get_rid(), p_offset, p_impulse);
}
void RigidBody2D::apply_torque_impulse(float p_torque) {
- Physics2DServer::get_singleton()->body_apply_torque_impulse(get_rid(), p_torque);
+ PhysicsServer2D::get_singleton()->body_apply_torque_impulse(get_rid(), p_torque);
}
void RigidBody2D::set_applied_force(const Vector2 &p_force) {
- Physics2DServer::get_singleton()->body_set_applied_force(get_rid(), p_force);
+ PhysicsServer2D::get_singleton()->body_set_applied_force(get_rid(), p_force);
};
Vector2 RigidBody2D::get_applied_force() const {
- return Physics2DServer::get_singleton()->body_get_applied_force(get_rid());
+ return PhysicsServer2D::get_singleton()->body_get_applied_force(get_rid());
};
void RigidBody2D::set_applied_torque(const float p_torque) {
- Physics2DServer::get_singleton()->body_set_applied_torque(get_rid(), p_torque);
+ PhysicsServer2D::get_singleton()->body_set_applied_torque(get_rid(), p_torque);
};
float RigidBody2D::get_applied_torque() const {
- return Physics2DServer::get_singleton()->body_get_applied_torque(get_rid());
+ return PhysicsServer2D::get_singleton()->body_get_applied_torque(get_rid());
};
void RigidBody2D::add_central_force(const Vector2 &p_force) {
- Physics2DServer::get_singleton()->body_add_central_force(get_rid(), p_force);
+ PhysicsServer2D::get_singleton()->body_add_central_force(get_rid(), p_force);
}
void RigidBody2D::add_force(const Vector2 &p_offset, const Vector2 &p_force) {
- Physics2DServer::get_singleton()->body_add_force(get_rid(), p_offset, p_force);
+ PhysicsServer2D::get_singleton()->body_add_force(get_rid(), p_offset, p_force);
}
void RigidBody2D::add_torque(const float p_torque) {
- Physics2DServer::get_singleton()->body_add_torque(get_rid(), p_torque);
+ PhysicsServer2D::get_singleton()->body_add_torque(get_rid(), p_torque);
}
void RigidBody2D::set_continuous_collision_detection_mode(CCDMode p_mode) {
ccd_mode = p_mode;
- Physics2DServer::get_singleton()->body_set_continuous_collision_detection_mode(get_rid(), Physics2DServer::CCDMode(p_mode));
+ PhysicsServer2D::get_singleton()->body_set_continuous_collision_detection_mode(get_rid(), PhysicsServer2D::CCDMode(p_mode));
}
RigidBody2D::CCDMode RigidBody2D::get_continuous_collision_detection_mode() const {
@@ -939,7 +939,7 @@ void RigidBody2D::_bind_methods() {
}
RigidBody2D::RigidBody2D() :
- PhysicsBody2D(Physics2DServer::BODY_MODE_RIGID) {
+ PhysicsBody2D(PhysicsServer2D::BODY_MODE_RIGID) {
mode = MODE_RIGID;
@@ -960,7 +960,7 @@ RigidBody2D::RigidBody2D() :
contact_monitor = NULL;
can_sleep = true;
- Physics2DServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ PhysicsServer2D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
}
RigidBody2D::~RigidBody2D() {
@@ -971,11 +971,11 @@ RigidBody2D::~RigidBody2D() {
void RigidBody2D::_reload_physics_characteristics() {
if (physics_material_override.is_null()) {
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_BOUNCE, 0);
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_FRICTION, 1);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_BOUNCE, 0);
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_FRICTION, 1);
} else {
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
- Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
+ PhysicsServer2D::get_singleton()->body_set_param(get_rid(), PhysicsServer2D::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
}
}
@@ -1001,12 +1001,12 @@ Ref<KinematicCollision2D> KinematicBody2D::_move(const Vector2 &p_motion, bool p
bool KinematicBody2D::separate_raycast_shapes(bool p_infinite_inertia, Collision &r_collision) {
- Physics2DServer::SeparationResult sep_res[8]; //max 8 rays
+ PhysicsServer2D::SeparationResult sep_res[8]; //max 8 rays
Transform2D gt = get_global_transform();
Vector2 recover;
- int hits = Physics2DServer::get_singleton()->body_test_ray_separation(get_rid(), gt, p_infinite_inertia, recover, sep_res, 8, margin);
+ int hits = PhysicsServer2D::get_singleton()->body_test_ray_separation(get_rid(), gt, p_infinite_inertia, recover, sep_res, 8, margin);
int deepest = -1;
float deepest_depth;
for (int i = 0; i < hits; i++) {
@@ -1042,8 +1042,8 @@ bool KinematicBody2D::move_and_collide(const Vector2 &p_motion, bool p_infinite_
ERR_PRINT("Functions move_and_slide and move_and_collide do not work together with 'sync to physics' option. Please read the documentation.");
}
Transform2D gt = get_global_transform();
- Physics2DServer::MotionResult result;
- bool colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, margin, &result, p_exclude_raycast_shapes);
+ PhysicsServer2D::MotionResult result;
+ bool colliding = PhysicsServer2D::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, margin, &result, p_exclude_raycast_shapes);
if (colliding) {
r_collision.collider_metadata = result.collider_metadata;
@@ -1077,7 +1077,7 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
Vector2 current_floor_velocity = floor_velocity;
if (on_floor && on_floor_body.is_valid()) {
//this approach makes sure there is less delay between the actual body velocity and the one we saved
- Physics2DDirectBodyState *bs = Physics2DServer::get_singleton()->body_get_direct_state(on_floor_body);
+ PhysicsDirectBodyState2D *bs = PhysicsServer2D::get_singleton()->body_get_direct_state(on_floor_body);
if (bs) {
current_floor_velocity = bs->get_linear_velocity();
}
@@ -1227,7 +1227,7 @@ bool KinematicBody2D::test_move(const Transform2D &p_from, const Vector2 &p_moti
ERR_FAIL_COND_V(!is_inside_tree(), false);
- return Physics2DServer::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, p_infinite_inertia, margin);
+ return PhysicsServer2D::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, p_infinite_inertia, margin);
}
void KinematicBody2D::set_safe_margin(float p_margin) {
@@ -1277,11 +1277,11 @@ void KinematicBody2D::set_sync_to_physics(bool p_enable) {
return;
if (p_enable) {
- Physics2DServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ PhysicsServer2D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
set_only_update_transform_changes(true);
set_notify_local_transform(true);
} else {
- Physics2DServer::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, "");
+ PhysicsServer2D::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, "");
set_only_update_transform_changes(false);
set_notify_local_transform(false);
}
@@ -1296,7 +1296,7 @@ void KinematicBody2D::_direct_state_changed(Object *p_state) {
if (!sync_to_physics)
return;
- Physics2DDirectBodyState *state = Object::cast_to<Physics2DDirectBodyState>(p_state);
+ PhysicsDirectBodyState2D *state = Object::cast_to<PhysicsDirectBodyState2D>(p_state);
last_valid_transform = state->get_transform();
set_notify_local_transform(false);
@@ -1320,7 +1320,7 @@ void KinematicBody2D::_notification(int p_what) {
if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
//used by sync to physics, send the new transform to the physics
Transform2D new_transform = get_global_transform();
- Physics2DServer::get_singleton()->body_set_state(get_rid(), Physics2DServer::BODY_STATE_TRANSFORM, new_transform);
+ PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_TRANSFORM, new_transform);
//but then revert changes
set_notify_local_transform(false);
set_global_transform(last_valid_transform);
@@ -1357,7 +1357,7 @@ void KinematicBody2D::_bind_methods() {
}
KinematicBody2D::KinematicBody2D() :
- PhysicsBody2D(Physics2DServer::BODY_MODE_KINEMATIC) {
+ PhysicsBody2D(PhysicsServer2D::BODY_MODE_KINEMATIC) {
margin = 0.08;
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index eb7aefb495..5bce5f6be3 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -34,7 +34,7 @@
#include "core/vset.h"
#include "scene/2d/collision_object_2d.h"
#include "scene/resources/physics_material.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
class KinematicCollision2D;
@@ -50,7 +50,7 @@ class PhysicsBody2D : public CollisionObject2D {
protected:
void _notification(int p_what);
- PhysicsBody2D(Physics2DServer::BodyMode p_mode);
+ PhysicsBody2D(PhysicsServer2D::BodyMode p_mode);
static void _bind_methods();
@@ -123,7 +123,7 @@ public:
private:
bool can_sleep;
- Physics2DDirectBodyState *state;
+ PhysicsDirectBodyState2D *state;
Mode mode;
real_t mass;
@@ -303,7 +303,7 @@ private:
Vector<Ref<KinematicCollision2D>> slide_colliders;
Ref<KinematicCollision2D> motion_cache;
- _FORCE_INLINE_ bool _ignores_mode(Physics2DServer::BodyMode) const;
+ _FORCE_INLINE_ bool _ignores_mode(PhysicsServer2D::BodyMode) const;
Ref<KinematicCollision2D> _move(const Vector2 &p_motion, bool p_infinite_inertia = true, bool p_exclude_raycast_shapes = true, bool p_test_only = false);
Ref<KinematicCollision2D> _get_slide_collision(int p_bounce);
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index 95656b9610..8d20053c6e 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -111,10 +111,10 @@ void Polygon2D::_notification(int p_what) {
ObjectID new_skeleton_id;
if (skeleton_node) {
- VS::get_singleton()->canvas_item_attach_skeleton(get_canvas_item(), skeleton_node->get_skeleton());
+ RS::get_singleton()->canvas_item_attach_skeleton(get_canvas_item(), skeleton_node->get_skeleton());
new_skeleton_id = skeleton_node->get_instance_id();
} else {
- VS::get_singleton()->canvas_item_attach_skeleton(get_canvas_item(), RID());
+ RS::get_singleton()->canvas_item_attach_skeleton(get_canvas_item(), RID());
}
if (new_skeleton_id != current_skeleton_id) {
@@ -307,7 +307,7 @@ void Polygon2D::_notification(int p_what) {
if (invert || polygons.size() == 0) {
Vector<int> indices = Geometry::triangulate_polygon(points);
if (indices.size()) {
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID(), -1, normal_map.is_valid() ? normal_map->get_rid() : RID(), specular_map.is_valid() ? specular_map->get_rid() : RID(), Color(specular_color.r, specular_color.g, specular_color.b, shininess));
+ RS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID(), -1, normal_map.is_valid() ? normal_map->get_rid() : RID(), specular_map.is_valid() ? specular_map->get_rid() : RID(), Color(specular_color.r, specular_color.g, specular_color.b, shininess));
}
} else {
//draw individual polygons
@@ -341,7 +341,7 @@ void Polygon2D::_notification(int p_what) {
}
if (total_indices.size()) {
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), total_indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
+ RS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), total_indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
}
}
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index fd6e0aebcc..ed971b1c3a 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -33,7 +33,7 @@
#include "collision_object_2d.h"
#include "core/engine.h"
#include "physics_body_2d.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
void RayCast2D::set_cast_to(const Vector2 &p_point) {
@@ -205,7 +205,7 @@ void RayCast2D::_update_raycast_state() {
Ref<World2D> w2d = get_world_2d();
ERR_FAIL_COND(w2d.is_null());
- Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(w2d->get_space());
+ PhysicsDirectSpaceState2D *dss = PhysicsServer2D::get_singleton()->space_get_direct_state(w2d->get_space());
ERR_FAIL_COND(!dss);
Transform2D gt = get_global_transform();
@@ -214,7 +214,7 @@ void RayCast2D::_update_raycast_state() {
if (to == Vector2())
to = Vector2(0, 0.01);
- Physics2DDirectSpaceState::RayResult rr;
+ PhysicsDirectSpaceState2D::RayResult rr;
if (dss->intersect_ray(gt.get_origin(), gt.xform(to), rr, exclude, collision_mask, collide_with_bodies, collide_with_areas)) {
diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp
index 9ebaf23c3a..2be6b6a75c 100644
--- a/scene/2d/skeleton_2d.cpp
+++ b/scene/2d/skeleton_2d.cpp
@@ -186,7 +186,7 @@ void Skeleton2D::_update_bone_setup() {
return;
bone_setup_dirty = false;
- VS::get_singleton()->skeleton_allocate(skeleton, bones.size(), true);
+ RS::get_singleton()->skeleton_allocate(skeleton, bones.size(), true);
bones.sort(); //sorty so they are always in the same order/index
@@ -240,7 +240,7 @@ void Skeleton2D::_update_transform() {
for (int i = 0; i < bones.size(); i++) {
Transform2D final_xform = bones[i].accum_transform * bones[i].rest_inverse;
- VS::get_singleton()->skeleton_bone_set_transform_2d(skeleton, i, final_xform);
+ RS::get_singleton()->skeleton_bone_set_transform_2d(skeleton, i, final_xform);
}
}
@@ -276,7 +276,7 @@ void Skeleton2D::_notification(int p_what) {
}
if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
- VS::get_singleton()->skeleton_set_base_transform_2d(skeleton, get_global_transform());
+ RS::get_singleton()->skeleton_set_base_transform_2d(skeleton, get_global_transform());
}
}
@@ -300,11 +300,11 @@ Skeleton2D::Skeleton2D() {
bone_setup_dirty = true;
transform_dirty = true;
- skeleton = VS::get_singleton()->skeleton_create();
+ skeleton = RS::get_singleton()->skeleton_create();
set_notify_transform(true);
}
Skeleton2D::~Skeleton2D() {
- VS::get_singleton()->free(skeleton);
+ RS::get_singleton()->free(skeleton);
}
diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp
index d45fe9a2a5..df8859bd9a 100644
--- a/scene/2d/sprite_2d.cpp
+++ b/scene/2d/sprite_2d.cpp
@@ -131,7 +131,7 @@ void Sprite2D::_notification(int p_what) {
Rect2 src_rect, dst_rect;
bool filter_clip;
_get_rects(src_rect, dst_rect, filter_clip);
- texture->draw_rect_region(ci, dst_rect, src_rect, Color(1, 1, 1), false, normal_map, specular, Color(specular_color.r, specular_color.g, specular_color.b, shininess), VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, filter_clip);
+ texture->draw_rect_region(ci, dst_rect, src_rect, Color(1, 1, 1), false, normal_map, specular, Color(specular_color.r, specular_color.g, specular_color.b, shininess), RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, filter_clip);
} break;
}
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 601be17274..c468389040 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -35,8 +35,8 @@
#include "core/method_bind_ext.gen.inc"
#include "core/os/os.h"
#include "scene/2d/area_2d.h"
-#include "servers/navigation_2d_server.h"
-#include "servers/physics_2d_server.h"
+#include "servers/navigation_server_2d.h"
+#include "servers/physics_server_2d.h"
int TileMap::_get_quadrant_size() const {
@@ -87,7 +87,7 @@ void TileMap::_notification(int p_what) {
if (navigation) {
for (Map<PosKey, Quadrant::NavPoly>::Element *F = q.navpoly_ids.front(); F; F = F->next()) {
- Navigation2DServer::get_singleton()->region_set_map(F->get().region, RID());
+ NavigationServer2D::get_singleton()->region_set_map(F->get().region, RID());
}
q.navpoly_ids.clear();
}
@@ -98,7 +98,7 @@ void TileMap::_notification(int p_what) {
}
for (Map<PosKey, Quadrant::Occluder>::Element *F = q.occluder_instances.front(); F; F = F->next()) {
- VS::get_singleton()->free(F->get().id);
+ RS::get_singleton()->free(F->get().id);
}
q.occluder_instances.clear();
}
@@ -130,7 +130,7 @@ void TileMap::_update_quadrant_space(const RID &p_space) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- Physics2DServer::get_singleton()->body_set_space(q.body, p_space);
+ PhysicsServer2D::get_singleton()->body_set_space(q.body, p_space);
}
}
}
@@ -158,18 +158,18 @@ void TileMap::_update_quadrant_transform() {
if (!use_parent) {
xform = global_transform * xform;
- Physics2DServer::get_singleton()->body_set_state(q.body, Physics2DServer::BODY_STATE_TRANSFORM, xform);
+ PhysicsServer2D::get_singleton()->body_set_state(q.body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform);
}
if (navigation) {
for (Map<PosKey, Quadrant::NavPoly>::Element *F = q.navpoly_ids.front(); F; F = F->next()) {
- Navigation2DServer::get_singleton()->region_set_transform(F->get().region, nav_rel * F->get().xform);
+ NavigationServer2D::get_singleton()->region_set_transform(F->get().region, nav_rel * F->get().xform);
}
}
for (Map<PosKey, Quadrant::Occluder>::Element *F = q.occluder_instances.front(); F; F = F->next()) {
- VS::get_singleton()->canvas_light_occluder_set_transform(F->get().id, global_transform * F->get().xform);
+ RS::get_singleton()->canvas_light_occluder_set_transform(F->get().id, global_transform * F->get().xform);
}
}
}
@@ -298,7 +298,7 @@ void TileMap::_fix_cell_transform(Transform2D &xform, const Cell &p_cell, const
}
void TileMap::_add_shape(int &shape_idx, const Quadrant &p_q, const Ref<Shape2D> &p_shape, const TileSet::ShapeData &p_shape_data, const Transform2D &p_xform, const Vector2 &p_metadata) {
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
if (!use_parent) {
ps->body_add_shape(p_q.body, p_shape->get_rid(), p_xform);
@@ -334,8 +334,8 @@ void TileMap::update_dirty_quadrants() {
return;
}
- VisualServer *vs = VisualServer::get_singleton();
- Physics2DServer *ps = Physics2DServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
+ PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
Vector2 tofs = get_cell_draw_offset();
Transform2D nav_rel;
if (navigation)
@@ -378,13 +378,13 @@ void TileMap::update_dirty_quadrants() {
if (navigation) {
for (Map<PosKey, Quadrant::NavPoly>::Element *E = q.navpoly_ids.front(); E; E = E->next()) {
- Navigation2DServer::get_singleton()->region_set_map(E->get().region, RID());
+ NavigationServer2D::get_singleton()->region_set_map(E->get().region, RID());
}
q.navpoly_ids.clear();
}
for (Map<PosKey, Quadrant::Occluder>::Element *E = q.occluder_instances.front(); E; E = E->next()) {
- VS::get_singleton()->free(E->get().id);
+ RS::get_singleton()->free(E->get().id);
}
q.occluder_instances.clear();
Ref<ShaderMaterial> prev_material;
@@ -439,7 +439,7 @@ void TileMap::update_dirty_quadrants() {
debug_canvas_item = vs->canvas_item_create();
vs->canvas_item_set_parent(debug_canvas_item, canvas_item);
vs->canvas_item_set_z_as_relative_to_parent(debug_canvas_item, false);
- vs->canvas_item_set_z_index(debug_canvas_item, VS::CANVAS_ITEM_Z_MAX - 1);
+ vs->canvas_item_set_z_index(debug_canvas_item, RS::CANVAS_ITEM_Z_MAX - 1);
q.canvas_items.push_back(debug_canvas_item);
prev_debug_canvas_item = debug_canvas_item;
}
@@ -550,7 +550,7 @@ void TileMap::update_dirty_quadrants() {
if (r == Rect2()) {
tex->draw_rect(canvas_item, rect, false, modulate, c.transpose, normal_map);
} else {
- tex->draw_rect_region(canvas_item, rect, r, modulate, c.transpose, normal_map, Ref<Texture2D>(), Color(1, 1, 1, 1), VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, clip_uv);
+ tex->draw_rect_region(canvas_item, rect, r, modulate, c.transpose, normal_map, Ref<Texture2D>(), Color(1, 1, 1, 1), RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, clip_uv);
}
Vector<TileSet::ShapeData> shapes = tile_set->tile_get_shapes(c.id);
@@ -612,10 +612,10 @@ void TileMap::update_dirty_quadrants() {
xform.set_origin(offset.floor() + q.pos);
_fix_cell_transform(xform, c, npoly_ofs, s);
- RID region = Navigation2DServer::get_singleton()->region_create();
- Navigation2DServer::get_singleton()->region_set_map(region, navigation->get_rid());
- Navigation2DServer::get_singleton()->region_set_transform(region, nav_rel * xform);
- Navigation2DServer::get_singleton()->region_set_navpoly(region, navpoly);
+ RID region = NavigationServer2D::get_singleton()->region_create();
+ NavigationServer2D::get_singleton()->region_set_map(region, navigation->get_rid());
+ NavigationServer2D::get_singleton()->region_set_transform(region, nav_rel * xform);
+ NavigationServer2D::get_singleton()->region_set_navpoly(region, navpoly);
Quadrant::NavPoly np;
np.region = region;
@@ -626,7 +626,7 @@ void TileMap::update_dirty_quadrants() {
RID debug_navigation_item = vs->canvas_item_create();
vs->canvas_item_set_parent(debug_navigation_item, canvas_item);
vs->canvas_item_set_z_as_relative_to_parent(debug_navigation_item, false);
- vs->canvas_item_set_z_index(debug_navigation_item, VS::CANVAS_ITEM_Z_MAX - 2); // Display one below collision debug
+ vs->canvas_item_set_z_index(debug_navigation_item, RS::CANVAS_ITEM_Z_MAX - 2); // Display one below collision debug
if (debug_navigation_item.is_valid()) {
Vector<Vector2> navigation_polygon_vertices = navpoly->get_vertices();
@@ -685,11 +685,11 @@ void TileMap::update_dirty_quadrants() {
xform.set_origin(offset.floor() + q.pos);
_fix_cell_transform(xform, c, occluder_ofs, s);
- RID orid = VS::get_singleton()->canvas_light_occluder_create();
- VS::get_singleton()->canvas_light_occluder_set_transform(orid, get_global_transform() * xform);
- VS::get_singleton()->canvas_light_occluder_set_polygon(orid, occluder->get_rid());
- VS::get_singleton()->canvas_light_occluder_attach_to_canvas(orid, get_canvas());
- VS::get_singleton()->canvas_light_occluder_set_light_mask(orid, occluder_light_mask);
+ RID orid = RS::get_singleton()->canvas_light_occluder_create();
+ RS::get_singleton()->canvas_light_occluder_set_transform(orid, get_global_transform() * xform);
+ RS::get_singleton()->canvas_light_occluder_set_polygon(orid, occluder->get_rid());
+ RS::get_singleton()->canvas_light_occluder_attach_to_canvas(orid, get_canvas());
+ RS::get_singleton()->canvas_light_occluder_set_light_mask(orid, occluder_light_mask);
Quadrant::Occluder oc;
oc.xform = xform;
oc.id = orid;
@@ -711,7 +711,7 @@ void TileMap::update_dirty_quadrants() {
Quadrant &q = E->get();
for (List<RID>::Element *F = q.canvas_items.front(); F; F = F->next()) {
- VS::get_singleton()->canvas_item_set_draw_index(F->get(), index++);
+ RS::get_singleton()->canvas_item_set_draw_index(F->get(), index++);
}
}
@@ -763,24 +763,24 @@ Map<TileMap::PosKey, TileMap::Quadrant>::Element *TileMap::_create_quadrant(cons
q.pos.y += cell_size.y;
xform.set_origin(q.pos);
- //q.canvas_item = VisualServer::get_singleton()->canvas_item_create();
+ //q.canvas_item = RenderingServer::get_singleton()->canvas_item_create();
if (!use_parent) {
- q.body = Physics2DServer::get_singleton()->body_create();
- Physics2DServer::get_singleton()->body_set_mode(q.body, use_kinematic ? Physics2DServer::BODY_MODE_KINEMATIC : Physics2DServer::BODY_MODE_STATIC);
+ q.body = PhysicsServer2D::get_singleton()->body_create();
+ PhysicsServer2D::get_singleton()->body_set_mode(q.body, use_kinematic ? PhysicsServer2D::BODY_MODE_KINEMATIC : PhysicsServer2D::BODY_MODE_STATIC);
- Physics2DServer::get_singleton()->body_attach_object_instance_id(q.body, get_instance_id());
- Physics2DServer::get_singleton()->body_set_collision_layer(q.body, collision_layer);
- Physics2DServer::get_singleton()->body_set_collision_mask(q.body, collision_mask);
- Physics2DServer::get_singleton()->body_set_param(q.body, Physics2DServer::BODY_PARAM_FRICTION, friction);
- Physics2DServer::get_singleton()->body_set_param(q.body, Physics2DServer::BODY_PARAM_BOUNCE, bounce);
+ PhysicsServer2D::get_singleton()->body_attach_object_instance_id(q.body, get_instance_id());
+ PhysicsServer2D::get_singleton()->body_set_collision_layer(q.body, collision_layer);
+ PhysicsServer2D::get_singleton()->body_set_collision_mask(q.body, collision_mask);
+ PhysicsServer2D::get_singleton()->body_set_param(q.body, PhysicsServer2D::BODY_PARAM_FRICTION, friction);
+ PhysicsServer2D::get_singleton()->body_set_param(q.body, PhysicsServer2D::BODY_PARAM_BOUNCE, bounce);
if (is_inside_tree()) {
xform = get_global_transform() * xform;
RID space = get_world_2d()->get_space();
- Physics2DServer::get_singleton()->body_set_space(q.body, space);
+ PhysicsServer2D::get_singleton()->body_set_space(q.body, space);
}
- Physics2DServer::get_singleton()->body_set_state(q.body, Physics2DServer::BODY_STATE_TRANSFORM, xform);
+ PhysicsServer2D::get_singleton()->body_set_state(q.body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform);
} else if (collision_parent) {
xform = get_transform() * xform;
q.shape_owner_id = collision_parent->create_shape_owner(this);
@@ -797,14 +797,14 @@ void TileMap::_erase_quadrant(Map<PosKey, Quadrant>::Element *Q) {
Quadrant &q = Q->get();
if (!use_parent) {
- Physics2DServer::get_singleton()->free(q.body);
+ PhysicsServer2D::get_singleton()->free(q.body);
} else if (collision_parent) {
collision_parent->remove_shape_owner(q.shape_owner_id);
}
for (List<RID>::Element *E = q.canvas_items.front(); E; E = E->next()) {
- VisualServer::get_singleton()->free(E->get());
+ RenderingServer::get_singleton()->free(E->get());
}
q.canvas_items.clear();
if (q.dirty_list.in_list())
@@ -813,13 +813,13 @@ void TileMap::_erase_quadrant(Map<PosKey, Quadrant>::Element *Q) {
if (navigation) {
for (Map<PosKey, Quadrant::NavPoly>::Element *E = q.navpoly_ids.front(); E; E = E->next()) {
- Navigation2DServer::get_singleton()->region_set_map(E->get().region, RID());
+ NavigationServer2D::get_singleton()->region_set_map(E->get().region, RID());
}
q.navpoly_ids.clear();
}
for (Map<PosKey, Quadrant::Occluder>::Element *E = q.occluder_instances.front(); E; E = E->next()) {
- VS::get_singleton()->free(E->get().id);
+ RS::get_singleton()->free(E->get().id);
}
q.occluder_instances.clear();
@@ -1197,7 +1197,7 @@ void TileMap::_update_all_items_material_state() {
void TileMap::_update_item_material_state(const RID &p_canvas_item) {
- VS::get_singleton()->canvas_item_set_use_parent_material(p_canvas_item, get_use_parent_material() || get_material().is_valid());
+ RS::get_singleton()->canvas_item_set_use_parent_material(p_canvas_item, get_use_parent_material() || get_material().is_valid());
}
void TileMap::clear() {
@@ -1302,7 +1302,7 @@ void TileMap::set_collision_layer(uint32_t p_layer) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- Physics2DServer::get_singleton()->body_set_collision_layer(q.body, collision_layer);
+ PhysicsServer2D::get_singleton()->body_set_collision_layer(q.body, collision_layer);
}
}
}
@@ -1314,7 +1314,7 @@ void TileMap::set_collision_mask(uint32_t p_mask) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- Physics2DServer::get_singleton()->body_set_collision_mask(q.body, collision_mask);
+ PhysicsServer2D::get_singleton()->body_set_collision_mask(q.body, collision_mask);
}
}
}
@@ -1383,7 +1383,7 @@ void TileMap::set_collision_friction(float p_friction) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- Physics2DServer::get_singleton()->body_set_param(q.body, Physics2DServer::BODY_PARAM_FRICTION, p_friction);
+ PhysicsServer2D::get_singleton()->body_set_param(q.body, PhysicsServer2D::BODY_PARAM_FRICTION, p_friction);
}
}
}
@@ -1400,7 +1400,7 @@ void TileMap::set_collision_bounce(float p_bounce) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- Physics2DServer::get_singleton()->body_set_param(q.body, Physics2DServer::BODY_PARAM_BOUNCE, p_bounce);
+ PhysicsServer2D::get_singleton()->body_set_param(q.body, PhysicsServer2D::BODY_PARAM_BOUNCE, p_bounce);
}
}
}
@@ -1655,7 +1655,7 @@ void TileMap::set_y_sort_mode(bool p_enable) {
_clear_quadrants();
y_sort_mode = p_enable;
- VS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), y_sort_mode);
+ RS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), y_sort_mode);
_recreate_quadrants();
emit_signal("settings_changed");
}
@@ -1746,7 +1746,7 @@ void TileMap::set_occluder_light_mask(int p_mask) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
for (Map<PosKey, Quadrant::Occluder>::Element *F = E->get().occluder_instances.front(); F; F = F->next()) {
- VisualServer::get_singleton()->canvas_light_occluder_set_light_mask(F->get().id, occluder_light_mask);
+ RenderingServer::get_singleton()->canvas_light_occluder_set_light_mask(F->get().id, occluder_light_mask);
}
}
}
@@ -1762,7 +1762,7 @@ void TileMap::set_light_mask(int p_light_mask) {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
for (List<RID>::Element *F = E->get().canvas_items.front(); F; F = F->next()) {
- VisualServer::get_singleton()->canvas_item_set_light_mask(F->get(), get_light_mask());
+ RenderingServer::get_singleton()->canvas_item_set_light_mask(F->get(), get_light_mask());
}
}
}
diff --git a/scene/2d/y_sort.cpp b/scene/2d/y_sort.cpp
index 62f10a5c96..15d97eeaa0 100644
--- a/scene/2d/y_sort.cpp
+++ b/scene/2d/y_sort.cpp
@@ -33,7 +33,7 @@
void YSort::set_sort_enabled(bool p_enabled) {
sort_enabled = p_enabled;
- VS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), sort_enabled);
+ RS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), sort_enabled);
}
bool YSort::is_sort_enabled() const {
@@ -53,5 +53,5 @@ void YSort::_bind_methods() {
YSort::YSort() {
sort_enabled = true;
- VS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), true);
+ RS::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), true);
}
diff --git a/scene/3d/area_3d.cpp b/scene/3d/area_3d.cpp
index beeaf7125a..5b02a91793 100644
--- a/scene/3d/area_3d.cpp
+++ b/scene/3d/area_3d.cpp
@@ -32,12 +32,12 @@
#include "scene/scene_string_names.h"
#include "servers/audio_server.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
void Area3D::set_space_override_mode(SpaceOverride p_mode) {
space_override = p_mode;
- PhysicsServer::get_singleton()->area_set_space_override_mode(get_rid(), PhysicsServer::AreaSpaceOverrideMode(p_mode));
+ PhysicsServer3D::get_singleton()->area_set_space_override_mode(get_rid(), PhysicsServer3D::AreaSpaceOverrideMode(p_mode));
}
Area3D::SpaceOverride Area3D::get_space_override_mode() const {
@@ -47,7 +47,7 @@ Area3D::SpaceOverride Area3D::get_space_override_mode() const {
void Area3D::set_gravity_is_point(bool p_enabled) {
gravity_is_point = p_enabled;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT, p_enabled);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT, p_enabled);
}
bool Area3D::is_gravity_a_point() const {
@@ -57,7 +57,7 @@ bool Area3D::is_gravity_a_point() const {
void Area3D::set_gravity_distance_scale(real_t p_scale) {
gravity_distance_scale = p_scale;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE, p_scale);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE, p_scale);
}
real_t Area3D::get_gravity_distance_scale() const {
@@ -67,7 +67,7 @@ real_t Area3D::get_gravity_distance_scale() const {
void Area3D::set_gravity_vector(const Vector3 &p_vec) {
gravity_vec = p_vec;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_GRAVITY_VECTOR, p_vec);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR, p_vec);
}
Vector3 Area3D::get_gravity_vector() const {
@@ -77,7 +77,7 @@ Vector3 Area3D::get_gravity_vector() const {
void Area3D::set_gravity(real_t p_gravity) {
gravity = p_gravity;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_GRAVITY, p_gravity);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_GRAVITY, p_gravity);
}
real_t Area3D::get_gravity() const {
@@ -86,7 +86,7 @@ real_t Area3D::get_gravity() const {
void Area3D::set_linear_damp(real_t p_linear_damp) {
linear_damp = p_linear_damp;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_LINEAR_DAMP, p_linear_damp);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_LINEAR_DAMP, p_linear_damp);
}
real_t Area3D::get_linear_damp() const {
@@ -96,7 +96,7 @@ real_t Area3D::get_linear_damp() const {
void Area3D::set_angular_damp(real_t p_angular_damp) {
angular_damp = p_angular_damp;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_ANGULAR_DAMP, p_angular_damp);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP, p_angular_damp);
}
real_t Area3D::get_angular_damp() const {
@@ -107,7 +107,7 @@ real_t Area3D::get_angular_damp() const {
void Area3D::set_priority(real_t p_priority) {
priority = p_priority;
- PhysicsServer::get_singleton()->area_set_param(get_rid(), PhysicsServer::AREA_PARAM_PRIORITY, p_priority);
+ PhysicsServer3D::get_singleton()->area_set_param(get_rid(), PhysicsServer3D::AREA_PARAM_PRIORITY, p_priority);
}
real_t Area3D::get_priority() const {
@@ -150,7 +150,7 @@ void Area3D::_body_exit_tree(ObjectID p_id) {
void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, int p_body_shape, int p_area_shape) {
- bool body_in = p_status == PhysicsServer::AREA_BODY_ADDED;
+ bool body_in = p_status == PhysicsServer3D::AREA_BODY_ADDED;
ObjectID objid = p_instance;
Object *obj = ObjectDB::get_instance(objid);
@@ -298,11 +298,11 @@ void Area3D::set_monitoring(bool p_enable) {
if (monitoring) {
- PhysicsServer::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout);
- PhysicsServer::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout);
+ PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout);
+ PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout);
} else {
- PhysicsServer::get_singleton()->area_set_monitor_callback(get_rid(), NULL, StringName());
- PhysicsServer::get_singleton()->area_set_area_monitor_callback(get_rid(), NULL, StringName());
+ PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), NULL, StringName());
+ PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), NULL, StringName());
_clear_monitoring();
}
}
@@ -343,7 +343,7 @@ void Area3D::_area_exit_tree(ObjectID p_id) {
void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, int p_area_shape, int p_self_shape) {
- bool area_in = p_status == PhysicsServer::AREA_BODY_ADDED;
+ bool area_in = p_status == PhysicsServer3D::AREA_BODY_ADDED;
ObjectID objid = p_instance;
Object *obj = ObjectDB::get_instance(objid);
@@ -436,14 +436,14 @@ Array Area3D::get_overlapping_bodies() const {
void Area3D::set_monitorable(bool p_enable) {
- ERR_FAIL_COND_MSG(locked || (is_inside_tree() && PhysicsServer::get_singleton()->is_flushing_queries()), "Function blocked during in/out signal. Use set_deferred(\"monitorable\", true/false).");
+ ERR_FAIL_COND_MSG(locked || (is_inside_tree() && PhysicsServer3D::get_singleton()->is_flushing_queries()), "Function blocked during in/out signal. Use set_deferred(\"monitorable\", true/false).");
if (p_enable == monitorable)
return;
monitorable = p_enable;
- PhysicsServer::get_singleton()->area_set_monitorable(get_rid(), monitorable);
+ PhysicsServer3D::get_singleton()->area_set_monitorable(get_rid(), monitorable);
}
bool Area3D::is_monitorable() const {
@@ -489,7 +489,7 @@ bool Area3D::overlaps_body(Node *p_body) const {
void Area3D::set_collision_mask(uint32_t p_mask) {
collision_mask = p_mask;
- PhysicsServer::get_singleton()->area_set_collision_mask(get_rid(), p_mask);
+ PhysicsServer3D::get_singleton()->area_set_collision_mask(get_rid(), p_mask);
}
uint32_t Area3D::get_collision_mask() const {
@@ -499,7 +499,7 @@ uint32_t Area3D::get_collision_mask() const {
void Area3D::set_collision_layer(uint32_t p_layer) {
collision_layer = p_layer;
- PhysicsServer::get_singleton()->area_set_collision_layer(get_rid(), p_layer);
+ PhysicsServer3D::get_singleton()->area_set_collision_layer(get_rid(), p_layer);
}
uint32_t Area3D::get_collision_layer() const {
@@ -728,7 +728,7 @@ void Area3D::_bind_methods() {
}
Area3D::Area3D() :
- CollisionObject3D(PhysicsServer::get_singleton()->area_create(), true) {
+ CollisionObject3D(PhysicsServer3D::get_singleton()->area_create(), true) {
space_override = SPACE_OVERRIDE_DISABLED;
set_gravity(9.8);
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 807515219f..bddf748be7 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -395,9 +395,9 @@ void AudioStreamPlayer3D::_notification(int p_what) {
//check if any area is diverting sound into a bus
- PhysicsDirectSpaceState *space_state = PhysicsServer::get_singleton()->space_get_direct_state(world->get_space());
+ PhysicsDirectSpaceState3D *space_state = PhysicsServer3D::get_singleton()->space_get_direct_state(world->get_space());
- PhysicsDirectSpaceState::ShapeResult sr[MAX_INTERSECT_AREAS];
+ PhysicsDirectSpaceState3D::ShapeResult sr[MAX_INTERSECT_AREAS];
int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, false, true);
Area3D *area = NULL;
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index 73b1d450f0..05e3f3fefa 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -39,7 +39,7 @@
void BakedLightmapData::set_bounds(const AABB &p_bounds) {
bounds = p_bounds;
- VS::get_singleton()->lightmap_capture_set_bounds(baked_light, p_bounds);
+ RS::get_singleton()->lightmap_capture_set_bounds(baked_light, p_bounds);
}
AABB BakedLightmapData::get_bounds() const {
@@ -49,18 +49,18 @@ AABB BakedLightmapData::get_bounds() const {
void BakedLightmapData::set_octree(const Vector<uint8_t> &p_octree) {
- VS::get_singleton()->lightmap_capture_set_octree(baked_light, p_octree);
+ RS::get_singleton()->lightmap_capture_set_octree(baked_light, p_octree);
}
Vector<uint8_t> BakedLightmapData::get_octree() const {
- return VS::get_singleton()->lightmap_capture_get_octree(baked_light);
+ return RS::get_singleton()->lightmap_capture_get_octree(baked_light);
}
void BakedLightmapData::set_cell_space_transform(const Transform &p_xform) {
cell_space_xform = p_xform;
- VS::get_singleton()->lightmap_capture_set_octree_cell_transform(baked_light, p_xform);
+ RS::get_singleton()->lightmap_capture_set_octree_cell_transform(baked_light, p_xform);
}
Transform BakedLightmapData::get_cell_space_transform() const {
@@ -69,7 +69,7 @@ Transform BakedLightmapData::get_cell_space_transform() const {
void BakedLightmapData::set_cell_subdiv(int p_cell_subdiv) {
cell_subdiv = p_cell_subdiv;
- VS::get_singleton()->lightmap_capture_set_octree_cell_subdiv(baked_light, p_cell_subdiv);
+ RS::get_singleton()->lightmap_capture_set_octree_cell_subdiv(baked_light, p_cell_subdiv);
}
int BakedLightmapData::get_cell_subdiv() const {
@@ -79,7 +79,7 @@ int BakedLightmapData::get_cell_subdiv() const {
void BakedLightmapData::set_energy(float p_energy) {
energy = p_energy;
- VS::get_singleton()->lightmap_capture_set_energy(baked_light, energy);
+ RS::get_singleton()->lightmap_capture_set_energy(baked_light, energy);
}
float BakedLightmapData::get_energy() const {
@@ -181,14 +181,14 @@ void BakedLightmapData::_bind_methods() {
BakedLightmapData::BakedLightmapData() {
- baked_light = VS::get_singleton()->lightmap_capture_create();
+ baked_light = RS::get_singleton()->lightmap_capture_create();
energy = 1;
cell_subdiv = 1;
}
BakedLightmapData::~BakedLightmapData() {
- VS::get_singleton()->free(baked_light);
+ RS::get_singleton()->free(baked_light);
}
///////////////////////////
@@ -425,13 +425,13 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
pmc++;
PlotLight pl = E->get();
switch (pl.light->get_light_type()) {
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
baker.plot_light_directional(-pl.local_xform.basis.get_axis(2), pl.light->get_color(), pl.light->get_param(Light::PARAM_ENERGY), pl.light->get_param(Light::PARAM_INDIRECT_ENERGY), pl.light->get_bake_mode() == Light::BAKE_ALL);
} break;
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_OMNI: {
baker.plot_light_omni(pl.local_xform.origin, pl.light->get_color(), pl.light->get_param(Light::PARAM_ENERGY), pl.light->get_param(Light::PARAM_INDIRECT_ENERGY), pl.light->get_param(Light::PARAM_RANGE), pl.light->get_param(Light::PARAM_ATTENUATION), pl.light->get_bake_mode() == Light::BAKE_ALL);
} break;
- case VS::LIGHT_SPOT: {
+ case RS::LIGHT_SPOT: {
baker.plot_light_spot(pl.local_xform.origin, pl.local_xform.basis.get_axis(2), pl.light->get_color(), pl.light->get_param(Light::PARAM_ENERGY), pl.light->get_param(Light::PARAM_INDIRECT_ENERGY), pl.light->get_param(Light::PARAM_RANGE), pl.light->get_param(Light::PARAM_ATTENUATION), pl.light->get_param(Light::PARAM_SPOT_ANGLE), pl.light->get_param(Light::PARAM_SPOT_ATTENUATION), pl.light->get_bake_mode() == Light::BAKE_ALL);
} break;
@@ -675,12 +675,12 @@ void BakedLightmap::_assign_lightmaps() {
if (instance_idx >= 0) {
RID instance = node->call("get_bake_mesh_instance", instance_idx);
if (instance.is_valid()) {
- VS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), lightmap->get_rid());
+ RS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), lightmap->get_rid());
}
} else {
VisualInstance *vi = Object::cast_to<VisualInstance>(node);
ERR_CONTINUE(!vi);
- VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), lightmap->get_rid());
+ RS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), lightmap->get_rid());
}
}
}
@@ -693,12 +693,12 @@ void BakedLightmap::_clear_lightmaps() {
if (instance_idx >= 0) {
RID instance = node->call("get_bake_mesh_instance", instance_idx);
if (instance.is_valid()) {
- VS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), RID());
+ RS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), RID());
}
} else {
VisualInstance *vi = Object::cast_to<VisualInstance>(node);
ERR_CONTINUE(!vi);
- VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), RID());
+ RS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), RID());
}
}
}
diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp
index 60cccbeedd..7980c15f89 100644
--- a/scene/3d/camera_3d.cpp
+++ b/scene/3d/camera_3d.cpp
@@ -82,7 +82,7 @@ void Camera3D::_update_camera() {
if (!is_inside_tree())
return;
- VisualServer::get_singleton()->camera_set_transform(camera, get_camera_transform());
+ RenderingServer::get_singleton()->camera_set_transform(camera, get_camera_transform());
// here goes listener stuff
/*
@@ -173,7 +173,7 @@ void Camera3D::set_perspective(float p_fovy_degrees, float p_z_near, float p_z_f
far = p_z_far;
mode = PROJECTION_PERSPECTIVE;
- VisualServer::get_singleton()->camera_set_perspective(camera, fov, near, far);
+ RenderingServer::get_singleton()->camera_set_perspective(camera, fov, near, far);
update_gizmo();
force_change = false;
}
@@ -189,7 +189,7 @@ void Camera3D::set_orthogonal(float p_size, float p_z_near, float p_z_far) {
mode = PROJECTION_ORTHOGONAL;
force_change = false;
- VisualServer::get_singleton()->camera_set_orthogonal(camera, size, near, far);
+ RenderingServer::get_singleton()->camera_set_orthogonal(camera, size, near, far);
update_gizmo();
}
@@ -205,7 +205,7 @@ void Camera3D::set_frustum(float p_size, Vector2 p_offset, float p_z_near, float
mode = PROJECTION_FRUSTUM;
force_change = false;
- VisualServer::get_singleton()->camera_set_frustum(camera, size, frustum_offset, near, far);
+ RenderingServer::get_singleton()->camera_set_frustum(camera, size, frustum_offset, near, far);
update_gizmo();
}
@@ -418,12 +418,12 @@ void Camera::_camera_make_current(Node *p_camera) {
if (p_camera==this) {
- VisualServer::get_singleton()->viewport_attach_camera(viewport_id,camera);
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport_id,camera);
active=true;
} else {
if (active && p_camera==NULL) {
//detech camera because no one else will claim it
- VisualServer::get_singleton()->viewport_attach_camera(viewport_id,RID());
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport_id,RID());
}
active=false;
}
@@ -434,9 +434,9 @@ void Camera3D::set_environment(const Ref<Environment> &p_environment) {
environment = p_environment;
if (environment.is_valid())
- VS::get_singleton()->camera_set_environment(camera, environment->get_rid());
+ RS::get_singleton()->camera_set_environment(camera, environment->get_rid());
else
- VS::get_singleton()->camera_set_environment(camera, RID());
+ RS::get_singleton()->camera_set_environment(camera, RID());
_update_camera_mode();
}
@@ -449,9 +449,9 @@ void Camera3D::set_effects(const Ref<CameraEffects> &p_effects) {
effects = p_effects;
if (effects.is_valid())
- VS::get_singleton()->camera_set_camera_effects(camera, effects->get_rid());
+ RS::get_singleton()->camera_set_camera_effects(camera, effects->get_rid());
else
- VS::get_singleton()->camera_set_camera_effects(camera, RID());
+ RS::get_singleton()->camera_set_camera_effects(camera, RID());
_update_camera_mode();
}
@@ -462,7 +462,7 @@ Ref<CameraEffects> Camera3D::get_effects() const {
void Camera3D::set_keep_aspect_mode(KeepAspect p_aspect) {
keep_aspect = p_aspect;
- VisualServer::get_singleton()->camera_set_use_vertical_aspect(camera, p_aspect == KEEP_WIDTH);
+ RenderingServer::get_singleton()->camera_set_use_vertical_aspect(camera, p_aspect == KEEP_WIDTH);
_update_camera_mode();
_change_notify();
}
@@ -628,7 +628,7 @@ void Camera3D::set_zfar(float p_zfar) {
void Camera3D::set_cull_mask(uint32_t p_layers) {
layers = p_layers;
- VisualServer::get_singleton()->camera_set_cull_mask(camera, layers);
+ RenderingServer::get_singleton()->camera_set_cull_mask(camera, layers);
_update_camera_mode();
}
@@ -696,7 +696,7 @@ Vector3 Camera3D::get_doppler_tracked_velocity() const {
}
Camera3D::Camera3D() {
- camera = VisualServer::get_singleton()->camera_create();
+ camera = RenderingServer::get_singleton()->camera_create();
size = 1;
fov = 0;
frustum_offset = Vector2();
@@ -711,7 +711,7 @@ Camera3D::Camera3D() {
layers = 0xfffff;
v_offset = 0;
h_offset = 0;
- VisualServer::get_singleton()->camera_set_cull_mask(camera, layers);
+ RenderingServer::get_singleton()->camera_set_cull_mask(camera, layers);
//active=false;
velocity_tracker.instance();
doppler_tracking = DOPPLER_TRACKING_DISABLED;
@@ -721,7 +721,7 @@ Camera3D::Camera3D() {
Camera3D::~Camera3D() {
- VisualServer::get_singleton()->free(camera);
+ RenderingServer::get_singleton()->free(camera);
}
////////////////////////////////////////
@@ -760,7 +760,7 @@ void ClippedCamera3D::_notification(int p_what) {
return;
}
- PhysicsDirectSpaceState *dspace = get_world()->get_direct_space_state();
+ PhysicsDirectSpaceState3D *dspace = get_world()->get_direct_space_state();
ERR_FAIL_COND(!dspace); // most likely physics set to threads
Vector3 cam_fw = -get_global_transform().basis.get_axis(Vector3::AXIS_Z).normalized();
@@ -791,7 +791,7 @@ void ClippedCamera3D::_notification(int p_what) {
}
if (!all_equal) {
- PhysicsServer::get_singleton()->shape_set_data(pyramid_shape, local_points);
+ PhysicsServer3D::get_singleton()->shape_set_data(pyramid_shape, local_points);
points = local_points;
}
}
@@ -945,10 +945,10 @@ ClippedCamera3D::ClippedCamera3D() {
collision_mask = 1;
set_notify_local_transform(Engine::get_singleton()->is_editor_hint());
points.resize(5);
- pyramid_shape = PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONVEX_POLYGON);
+ pyramid_shape = PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_CONVEX_POLYGON);
clip_to_areas = false;
clip_to_bodies = true;
}
ClippedCamera3D::~ClippedCamera3D() {
- PhysicsServer::get_singleton()->free(pyramid_shape);
+ PhysicsServer3D::get_singleton()->free(pyramid_shape);
}
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp
index 9ae7371b6a..da37ca8ae2 100644
--- a/scene/3d/collision_object_3d.cpp
+++ b/scene/3d/collision_object_3d.cpp
@@ -31,7 +31,7 @@
#include "collision_object_3d.h"
#include "scene/scene_string_names.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
void CollisionObject3D::_notification(int p_what) {
@@ -40,15 +40,15 @@ void CollisionObject3D::_notification(int p_what) {
case NOTIFICATION_ENTER_WORLD: {
if (area)
- PhysicsServer::get_singleton()->area_set_transform(rid, get_global_transform());
+ PhysicsServer3D::get_singleton()->area_set_transform(rid, get_global_transform());
else
- PhysicsServer::get_singleton()->body_set_state(rid, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_set_state(rid, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
RID space = get_world()->get_space();
if (area) {
- PhysicsServer::get_singleton()->area_set_space(rid, space);
+ PhysicsServer3D::get_singleton()->area_set_space(rid, space);
} else
- PhysicsServer::get_singleton()->body_set_space(rid, space);
+ PhysicsServer3D::get_singleton()->body_set_space(rid, space);
_update_pickable();
//get space
@@ -57,9 +57,9 @@ void CollisionObject3D::_notification(int p_what) {
case NOTIFICATION_TRANSFORM_CHANGED: {
if (area)
- PhysicsServer::get_singleton()->area_set_transform(rid, get_global_transform());
+ PhysicsServer3D::get_singleton()->area_set_transform(rid, get_global_transform());
else
- PhysicsServer::get_singleton()->body_set_state(rid, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
+ PhysicsServer3D::get_singleton()->body_set_state(rid, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@@ -70,9 +70,9 @@ void CollisionObject3D::_notification(int p_what) {
case NOTIFICATION_EXIT_WORLD: {
if (area) {
- PhysicsServer::get_singleton()->area_set_space(rid, RID());
+ PhysicsServer3D::get_singleton()->area_set_space(rid, RID());
} else
- PhysicsServer::get_singleton()->body_set_space(rid, RID());
+ PhysicsServer3D::get_singleton()->body_set_space(rid, RID());
} break;
}
@@ -108,9 +108,9 @@ void CollisionObject3D::_update_pickable() {
bool pickable = ray_pickable && is_visible_in_tree();
if (area)
- PhysicsServer::get_singleton()->area_set_ray_pickable(rid, pickable);
+ PhysicsServer3D::get_singleton()->area_set_ray_pickable(rid, pickable);
else
- PhysicsServer::get_singleton()->body_set_ray_pickable(rid, pickable);
+ PhysicsServer3D::get_singleton()->body_set_ray_pickable(rid, pickable);
}
void CollisionObject3D::set_ray_pickable(bool p_ray_pickable) {
@@ -191,9 +191,9 @@ void CollisionObject3D::shape_owner_set_disabled(uint32_t p_owner, bool p_disabl
sd.disabled = p_disabled;
for (int i = 0; i < sd.shapes.size(); i++) {
if (area) {
- PhysicsServer::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ PhysicsServer3D::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
} else {
- PhysicsServer::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
+ PhysicsServer3D::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled);
}
}
}
@@ -230,9 +230,9 @@ void CollisionObject3D::shape_owner_set_transform(uint32_t p_owner, const Transf
sd.xform = p_transform;
for (int i = 0; i < sd.shapes.size(); i++) {
if (area) {
- PhysicsServer::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, p_transform);
+ PhysicsServer3D::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, p_transform);
} else {
- PhysicsServer::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, p_transform);
+ PhysicsServer3D::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, p_transform);
}
}
}
@@ -260,9 +260,9 @@ void CollisionObject3D::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape3
s.index = total_subshapes;
s.shape = p_shape;
if (area) {
- PhysicsServer::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
+ PhysicsServer3D::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
} else {
- PhysicsServer::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
+ PhysicsServer3D::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform, sd.disabled);
}
sd.shapes.push_back(s);
@@ -296,9 +296,9 @@ void CollisionObject3D::shape_owner_remove_shape(uint32_t p_owner, int p_shape)
int index_to_remove = shapes[p_owner].shapes[p_shape].index;
if (area) {
- PhysicsServer::get_singleton()->area_remove_shape(rid, index_to_remove);
+ PhysicsServer3D::get_singleton()->area_remove_shape(rid, index_to_remove);
} else {
- PhysicsServer::get_singleton()->body_remove_shape(rid, index_to_remove);
+ PhysicsServer3D::get_singleton()->body_remove_shape(rid, index_to_remove);
}
shapes[p_owner].shapes.remove(p_shape);
@@ -349,9 +349,9 @@ CollisionObject3D::CollisionObject3D(RID p_rid, bool p_area) {
total_subshapes = 0;
if (p_area) {
- PhysicsServer::get_singleton()->area_attach_object_instance_id(rid, get_instance_id());
+ PhysicsServer3D::get_singleton()->area_attach_object_instance_id(rid, get_instance_id());
} else {
- PhysicsServer::get_singleton()->body_attach_object_instance_id(rid, get_instance_id());
+ PhysicsServer3D::get_singleton()->body_attach_object_instance_id(rid, get_instance_id());
}
//set_transform_notify(true);
}
@@ -392,5 +392,5 @@ CollisionObject3D::CollisionObject3D() {
CollisionObject3D::~CollisionObject3D() {
- PhysicsServer::get_singleton()->free(rid);
+ PhysicsServer3D::get_singleton()->free(rid);
}
diff --git a/scene/3d/collision_shape_3d.cpp b/scene/3d/collision_shape_3d.cpp
index eab09883cd..e736f20614 100644
--- a/scene/3d/collision_shape_3d.cpp
+++ b/scene/3d/collision_shape_3d.cpp
@@ -36,7 +36,7 @@
#include "scene/resources/ray_shape_3d.h"
#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/world_margin_shape_3d.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
//TODO: Implement CylinderShape and HeightMapShape?
#include "core/math/quick_hull.h"
#include "mesh_instance_3d.h"
@@ -196,7 +196,7 @@ bool CollisionShape3D::is_disabled() const {
CollisionShape3D::CollisionShape3D() {
- //indicator = VisualServer::get_singleton()->mesh_create();
+ //indicator = RenderingServer::get_singleton()->mesh_create();
disabled = false;
debug_shape = NULL;
parent = NULL;
@@ -207,7 +207,7 @@ CollisionShape3D::CollisionShape3D() {
CollisionShape3D::~CollisionShape3D() {
if (!shape.is_null())
shape->unregister_owner(this);
- //VisualServer::get_singleton()->free(indicator);
+ //RenderingServer::get_singleton()->free(indicator);
}
void CollisionShape3D::_update_debug_shape() {
diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp
index 71e869e6e9..4350d4da25 100644
--- a/scene/3d/cpu_particles_3d.cpp
+++ b/scene/3d/cpu_particles_3d.cpp
@@ -33,7 +33,7 @@
#include "scene/3d/camera_3d.h"
#include "scene/3d/gpu_particles_3d.h"
#include "scene/resources/particles_material.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
AABB CPUParticles3D::get_aabb() const {
@@ -73,7 +73,7 @@ void CPUParticles3D::set_amount(int p_amount) {
}
particle_data.resize((12 + 4 + 4) * p_amount);
- VS::get_singleton()->multimesh_allocate(multimesh, p_amount, VS::MULTIMESH_TRANSFORM_3D, true, true);
+ RS::get_singleton()->multimesh_allocate(multimesh, p_amount, RS::MULTIMESH_TRANSFORM_3D, true, true);
particle_order.resize(p_amount);
}
@@ -171,9 +171,9 @@ void CPUParticles3D::set_mesh(const Ref<Mesh> &p_mesh) {
mesh = p_mesh;
if (mesh.is_valid()) {
- VS::get_singleton()->multimesh_set_mesh(multimesh, mesh->get_rid());
+ RS::get_singleton()->multimesh_set_mesh(multimesh, mesh->get_rid());
} else {
- VS::get_singleton()->multimesh_set_mesh(multimesh, RID());
+ RS::get_singleton()->multimesh_set_mesh(multimesh, RID());
}
}
@@ -1115,15 +1115,15 @@ void CPUParticles3D::_set_redraw(bool p_redraw) {
MutexLock lock(update_mutex);
if (redraw) {
- VS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &CPUParticles3D::_update_render_thread));
- VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true);
- VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
+ RS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &CPUParticles3D::_update_render_thread));
+ RS::get_singleton()->instance_geometry_set_flag(get_instance(), RS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true);
+ RS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
} else {
- if (VS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &CPUParticles3D::_update_render_thread))) {
- VS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &CPUParticles3D::_update_render_thread));
+ if (RS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &CPUParticles3D::_update_render_thread))) {
+ RS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &CPUParticles3D::_update_render_thread));
}
- VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false);
- VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
+ RS::get_singleton()->instance_geometry_set_flag(get_instance(), RS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false);
+ RS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
}
}
}
@@ -1133,7 +1133,7 @@ void CPUParticles3D::_update_render_thread() {
MutexLock lock(update_mutex);
if (can_update) {
- VS::get_singleton()->multimesh_set_buffer(multimesh, particle_data);
+ RS::get_singleton()->multimesh_set_buffer(multimesh, particle_data);
can_update = false; //wait for next time
}
}
@@ -1488,8 +1488,8 @@ CPUParticles3D::CPUParticles3D() {
set_notify_transform(true);
- multimesh = VisualServer::get_singleton()->multimesh_create();
- VisualServer::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
+ multimesh = RenderingServer::get_singleton()->multimesh_create();
+ RenderingServer::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
set_base(multimesh);
set_emitting(true);
@@ -1542,5 +1542,5 @@ CPUParticles3D::CPUParticles3D() {
}
CPUParticles3D::~CPUParticles3D() {
- VS::get_singleton()->free(multimesh);
+ RS::get_singleton()->free(multimesh);
}
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 413d5a2b1d..a46cd90612 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -92,7 +92,7 @@ Dictionary GIProbeData::_get_data() const {
}
void GIProbeData::allocate(const Transform &p_to_cell_xform, const AABB &p_aabb, const Vector3 &p_octree_size, const Vector<uint8_t> &p_octree_cells, const Vector<uint8_t> &p_data_cells, const Vector<uint8_t> &p_distance_field, const Vector<int> &p_level_counts) {
- VS::get_singleton()->gi_probe_allocate(probe, p_to_cell_xform, p_aabb, p_octree_size, p_octree_cells, p_data_cells, p_distance_field, p_level_counts);
+ RS::get_singleton()->gi_probe_allocate(probe, p_to_cell_xform, p_aabb, p_octree_size, p_octree_cells, p_data_cells, p_distance_field, p_level_counts);
bounds = p_aabb;
to_cell_xform = p_to_cell_xform;
octree_size = p_octree_size;
@@ -105,24 +105,24 @@ Vector3 GIProbeData::get_octree_size() const {
return octree_size;
}
Vector<uint8_t> GIProbeData::get_octree_cells() const {
- return VS::get_singleton()->gi_probe_get_octree_cells(probe);
+ return RS::get_singleton()->gi_probe_get_octree_cells(probe);
}
Vector<uint8_t> GIProbeData::get_data_cells() const {
- return VS::get_singleton()->gi_probe_get_data_cells(probe);
+ return RS::get_singleton()->gi_probe_get_data_cells(probe);
}
Vector<uint8_t> GIProbeData::get_distance_field() const {
- return VS::get_singleton()->gi_probe_get_distance_field(probe);
+ return RS::get_singleton()->gi_probe_get_distance_field(probe);
}
Vector<int> GIProbeData::get_level_counts() const {
- return VS::get_singleton()->gi_probe_get_level_counts(probe);
+ return RS::get_singleton()->gi_probe_get_level_counts(probe);
}
Transform GIProbeData::get_to_cell_xform() const {
return to_cell_xform;
}
void GIProbeData::set_dynamic_range(float p_range) {
- VS::get_singleton()->gi_probe_set_dynamic_range(probe, p_range);
+ RS::get_singleton()->gi_probe_set_dynamic_range(probe, p_range);
dynamic_range = p_range;
}
@@ -131,7 +131,7 @@ float GIProbeData::get_dynamic_range() const {
}
void GIProbeData::set_propagation(float p_propagation) {
- VS::get_singleton()->gi_probe_set_propagation(probe, p_propagation);
+ RS::get_singleton()->gi_probe_set_propagation(probe, p_propagation);
propagation = p_propagation;
}
@@ -140,7 +140,7 @@ float GIProbeData::get_propagation() const {
}
void GIProbeData::set_anisotropy_strength(float p_anisotropy_strength) {
- VS::get_singleton()->gi_probe_set_anisotropy_strength(probe, p_anisotropy_strength);
+ RS::get_singleton()->gi_probe_set_anisotropy_strength(probe, p_anisotropy_strength);
anisotropy_strength = p_anisotropy_strength;
}
@@ -149,7 +149,7 @@ float GIProbeData::get_anisotropy_strength() const {
}
void GIProbeData::set_energy(float p_energy) {
- VS::get_singleton()->gi_probe_set_energy(probe, p_energy);
+ RS::get_singleton()->gi_probe_set_energy(probe, p_energy);
energy = p_energy;
}
@@ -158,7 +158,7 @@ float GIProbeData::get_energy() const {
}
void GIProbeData::set_ao(float p_ao) {
- VS::get_singleton()->gi_probe_set_ao(probe, p_ao);
+ RS::get_singleton()->gi_probe_set_ao(probe, p_ao);
ao = p_ao;
}
@@ -167,7 +167,7 @@ float GIProbeData::get_ao() const {
}
void GIProbeData::set_ao_size(float p_ao_size) {
- VS::get_singleton()->gi_probe_set_ao_size(probe, p_ao_size);
+ RS::get_singleton()->gi_probe_set_ao_size(probe, p_ao_size);
ao_size = p_ao_size;
}
@@ -176,7 +176,7 @@ float GIProbeData::get_ao_size() const {
}
void GIProbeData::set_bias(float p_bias) {
- VS::get_singleton()->gi_probe_set_bias(probe, p_bias);
+ RS::get_singleton()->gi_probe_set_bias(probe, p_bias);
bias = p_bias;
}
@@ -185,7 +185,7 @@ float GIProbeData::get_bias() const {
}
void GIProbeData::set_normal_bias(float p_normal_bias) {
- VS::get_singleton()->gi_probe_set_normal_bias(probe, p_normal_bias);
+ RS::get_singleton()->gi_probe_set_normal_bias(probe, p_normal_bias);
normal_bias = p_normal_bias;
}
@@ -194,7 +194,7 @@ float GIProbeData::get_normal_bias() const {
}
void GIProbeData::set_interior(bool p_enable) {
- VS::get_singleton()->gi_probe_set_interior(probe, p_enable);
+ RS::get_singleton()->gi_probe_set_interior(probe, p_enable);
interior = p_enable;
}
@@ -203,7 +203,7 @@ bool GIProbeData::is_interior() const {
}
void GIProbeData::set_use_two_bounces(bool p_enable) {
- VS::get_singleton()->gi_probe_set_use_two_bounces(probe, p_enable);
+ RS::get_singleton()->gi_probe_set_use_two_bounces(probe, p_enable);
use_two_bounces = p_enable;
}
@@ -294,12 +294,12 @@ GIProbeData::GIProbeData() {
anisotropy_strength = 0.5;
interior = false;
- probe = VS::get_singleton()->gi_probe_create();
+ probe = RS::get_singleton()->gi_probe_create();
}
GIProbeData::~GIProbeData() {
- VS::get_singleton()->free(probe);
+ RS::get_singleton()->free(probe);
}
//////////////////////
@@ -308,9 +308,9 @@ GIProbeData::~GIProbeData() {
void GIProbe::set_probe_data(const Ref<GIProbeData> &p_data) {
if (p_data.is_valid()) {
- VS::get_singleton()->instance_set_base(get_instance(), p_data->get_rid());
+ RS::get_singleton()->instance_set_base(get_instance(), p_data->get_rid());
} else {
- VS::get_singleton()->instance_set_base(get_instance(), RID());
+ RS::get_singleton()->instance_set_base(get_instance(), RID());
}
probe_data = p_data;
@@ -526,7 +526,7 @@ Vector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const {
String GIProbe::get_configuration_warning() const {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
return TTR("GIProbes are not supported by the GLES2 video driver.\nUse a BakedLightmap instead.");
}
return String();
@@ -563,10 +563,10 @@ GIProbe::GIProbe() {
subdiv = SUBDIV_128;
extents = Vector3(10, 10, 10);
- gi_probe = VS::get_singleton()->gi_probe_create();
+ gi_probe = RS::get_singleton()->gi_probe_create();
set_disable_scale(true);
}
GIProbe::~GIProbe() {
- VS::get_singleton()->free(gi_probe);
+ RS::get_singleton()->free(gi_probe);
}
diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp
index a283ec41b2..ad45228ca8 100644
--- a/scene/3d/gpu_particles_3d.cpp
+++ b/scene/3d/gpu_particles_3d.cpp
@@ -33,7 +33,7 @@
#include "core/os/os.h"
#include "scene/resources/particles_material.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
AABB GPUParticles3D::get_aabb() const {
@@ -46,7 +46,7 @@ Vector<Face3> GPUParticles3D::get_faces(uint32_t p_usage_flags) const {
void GPUParticles3D::set_emitting(bool p_emitting) {
- VS::get_singleton()->particles_set_emitting(particles, p_emitting);
+ RS::get_singleton()->particles_set_emitting(particles, p_emitting);
if (p_emitting && one_shot) {
set_process_internal(true);
@@ -59,25 +59,25 @@ void GPUParticles3D::set_amount(int p_amount) {
ERR_FAIL_COND_MSG(p_amount < 1, "Amount of particles cannot be smaller than 1.");
amount = p_amount;
- VS::get_singleton()->particles_set_amount(particles, amount);
+ RS::get_singleton()->particles_set_amount(particles, amount);
}
void GPUParticles3D::set_lifetime(float p_lifetime) {
ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0.");
lifetime = p_lifetime;
- VS::get_singleton()->particles_set_lifetime(particles, lifetime);
+ RS::get_singleton()->particles_set_lifetime(particles, lifetime);
}
void GPUParticles3D::set_one_shot(bool p_one_shot) {
one_shot = p_one_shot;
- VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+ RS::get_singleton()->particles_set_one_shot(particles, one_shot);
if (is_emitting()) {
set_process_internal(true);
if (!one_shot)
- VisualServer::get_singleton()->particles_restart(particles);
+ RenderingServer::get_singleton()->particles_restart(particles);
}
if (!one_shot)
@@ -87,29 +87,29 @@ void GPUParticles3D::set_one_shot(bool p_one_shot) {
void GPUParticles3D::set_pre_process_time(float p_time) {
pre_process_time = p_time;
- VS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time);
+ RS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time);
}
void GPUParticles3D::set_explosiveness_ratio(float p_ratio) {
explosiveness_ratio = p_ratio;
- VS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
+ RS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
}
void GPUParticles3D::set_randomness_ratio(float p_ratio) {
randomness_ratio = p_ratio;
- VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
+ RS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
}
void GPUParticles3D::set_visibility_aabb(const AABB &p_aabb) {
visibility_aabb = p_aabb;
- VS::get_singleton()->particles_set_custom_aabb(particles, visibility_aabb);
+ RS::get_singleton()->particles_set_custom_aabb(particles, visibility_aabb);
update_gizmo();
_change_notify("visibility_aabb");
}
void GPUParticles3D::set_use_local_coordinates(bool p_enable) {
local_coords = p_enable;
- VS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords);
+ RS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords);
}
void GPUParticles3D::set_process_material(const Ref<Material> &p_material) {
@@ -117,7 +117,7 @@ void GPUParticles3D::set_process_material(const Ref<Material> &p_material) {
RID material_rid;
if (process_material.is_valid())
material_rid = process_material->get_rid();
- VS::get_singleton()->particles_set_process_material(particles, material_rid);
+ RS::get_singleton()->particles_set_process_material(particles, material_rid);
update_configuration_warning();
}
@@ -125,12 +125,12 @@ void GPUParticles3D::set_process_material(const Ref<Material> &p_material) {
void GPUParticles3D::set_speed_scale(float p_scale) {
speed_scale = p_scale;
- VS::get_singleton()->particles_set_speed_scale(particles, p_scale);
+ RS::get_singleton()->particles_set_speed_scale(particles, p_scale);
}
bool GPUParticles3D::is_emitting() const {
- return VS::get_singleton()->particles_get_emitting(particles);
+ return RS::get_singleton()->particles_get_emitting(particles);
}
int GPUParticles3D::get_amount() const {
@@ -178,7 +178,7 @@ float GPUParticles3D::get_speed_scale() const {
void GPUParticles3D::set_draw_order(DrawOrder p_order) {
draw_order = p_order;
- VS::get_singleton()->particles_set_draw_order(particles, VS::ParticlesDrawOrder(p_order));
+ RS::get_singleton()->particles_set_draw_order(particles, RS::ParticlesDrawOrder(p_order));
}
GPUParticles3D::DrawOrder GPUParticles3D::get_draw_order() const {
@@ -190,7 +190,7 @@ void GPUParticles3D::set_draw_passes(int p_count) {
ERR_FAIL_COND(p_count < 1);
draw_passes.resize(p_count);
- VS::get_singleton()->particles_set_draw_passes(particles, p_count);
+ RS::get_singleton()->particles_set_draw_passes(particles, p_count);
_change_notify();
}
int GPUParticles3D::get_draw_passes() const {
@@ -208,7 +208,7 @@ void GPUParticles3D::set_draw_pass_mesh(int p_pass, const Ref<Mesh> &p_mesh) {
if (p_mesh.is_valid())
mesh_rid = p_mesh->get_rid();
- VS::get_singleton()->particles_set_draw_pass_mesh(particles, p_pass, mesh_rid);
+ RS::get_singleton()->particles_set_draw_pass_mesh(particles, p_pass, mesh_rid);
update_configuration_warning();
}
@@ -222,7 +222,7 @@ Ref<Mesh> GPUParticles3D::get_draw_pass_mesh(int p_pass) const {
void GPUParticles3D::set_fixed_fps(int p_count) {
fixed_fps = p_count;
- VS::get_singleton()->particles_set_fixed_fps(particles, p_count);
+ RS::get_singleton()->particles_set_fixed_fps(particles, p_count);
}
int GPUParticles3D::get_fixed_fps() const {
@@ -231,7 +231,7 @@ int GPUParticles3D::get_fixed_fps() const {
void GPUParticles3D::set_fractional_delta(bool p_enable) {
fractional_delta = p_enable;
- VS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
+ RS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
}
bool GPUParticles3D::get_fractional_delta() const {
@@ -240,7 +240,7 @@ bool GPUParticles3D::get_fractional_delta() const {
String GPUParticles3D::get_configuration_warning() const {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
return TTR("GPU-based particles are not supported by the GLES2 video driver.\nUse the CPUParticles node instead. You can use the \"Convert to CPUParticles\" option for this purpose.");
}
@@ -291,13 +291,13 @@ String GPUParticles3D::get_configuration_warning() const {
void GPUParticles3D::restart() {
- VisualServer::get_singleton()->particles_restart(particles);
- VisualServer::get_singleton()->particles_set_emitting(particles, true);
+ RenderingServer::get_singleton()->particles_restart(particles);
+ RenderingServer::get_singleton()->particles_set_emitting(particles, true);
}
AABB GPUParticles3D::capture_aabb() const {
- return VS::get_singleton()->particles_get_current_aabb(particles);
+ return RS::get_singleton()->particles_get_current_aabb(particles);
}
void GPUParticles3D::_validate_property(PropertyInfo &property) const {
@@ -315,10 +315,10 @@ void GPUParticles3D::_notification(int p_what) {
if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) {
if (can_process()) {
- VS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
+ RS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
} else {
- VS::get_singleton()->particles_set_speed_scale(particles, 0);
+ RS::get_singleton()->particles_set_speed_scale(particles, 0);
}
}
@@ -334,8 +334,8 @@ void GPUParticles3D::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
// make sure particles are updated before rendering occurs if they were active before
- if (is_visible_in_tree() && !VS::get_singleton()->particles_is_inactive(particles)) {
- VS::get_singleton()->particles_request_process(particles);
+ if (is_visible_in_tree() && !RS::get_singleton()->particles_is_inactive(particles)) {
+ RS::get_singleton()->particles_request_process(particles);
}
}
}
@@ -416,7 +416,7 @@ void GPUParticles3D::_bind_methods() {
GPUParticles3D::GPUParticles3D() {
- particles = VS::get_singleton()->particles_create();
+ particles = RS::get_singleton()->particles_create();
set_base(particles);
one_shot = false; // Needed so that set_emitting doesn't access uninitialized values
set_emitting(true);
@@ -437,5 +437,5 @@ GPUParticles3D::GPUParticles3D() {
GPUParticles3D::~GPUParticles3D() {
- VS::get_singleton()->free(particles);
+ RS::get_singleton()->free(particles);
}
diff --git a/scene/3d/immediate_geometry_3d.cpp b/scene/3d/immediate_geometry_3d.cpp
index acc1f407f9..63d4b1ac84 100644
--- a/scene/3d/immediate_geometry_3d.cpp
+++ b/scene/3d/immediate_geometry_3d.cpp
@@ -32,39 +32,39 @@
void ImmediateGeometry3D::begin(Mesh::PrimitiveType p_primitive, const Ref<Texture2D> &p_texture) {
- VS::get_singleton()->immediate_begin(im, (VS::PrimitiveType)p_primitive, p_texture.is_valid() ? p_texture->get_rid() : RID());
+ RS::get_singleton()->immediate_begin(im, (RS::PrimitiveType)p_primitive, p_texture.is_valid() ? p_texture->get_rid() : RID());
if (p_texture.is_valid())
cached_textures.push_back(p_texture);
}
void ImmediateGeometry3D::set_normal(const Vector3 &p_normal) {
- VS::get_singleton()->immediate_normal(im, p_normal);
+ RS::get_singleton()->immediate_normal(im, p_normal);
}
void ImmediateGeometry3D::set_tangent(const Plane &p_tangent) {
- VS::get_singleton()->immediate_tangent(im, p_tangent);
+ RS::get_singleton()->immediate_tangent(im, p_tangent);
}
void ImmediateGeometry3D::set_color(const Color &p_color) {
- VS::get_singleton()->immediate_color(im, p_color);
+ RS::get_singleton()->immediate_color(im, p_color);
}
void ImmediateGeometry3D::set_uv(const Vector2 &p_uv) {
- VS::get_singleton()->immediate_uv(im, p_uv);
+ RS::get_singleton()->immediate_uv(im, p_uv);
}
void ImmediateGeometry3D::set_uv2(const Vector2 &p_uv2) {
- VS::get_singleton()->immediate_uv2(im, p_uv2);
+ RS::get_singleton()->immediate_uv2(im, p_uv2);
}
void ImmediateGeometry3D::add_vertex(const Vector3 &p_vertex) {
- VS::get_singleton()->immediate_vertex(im, p_vertex);
+ RS::get_singleton()->immediate_vertex(im, p_vertex);
if (empty) {
aabb.position = p_vertex;
aabb.size = Vector3();
@@ -76,12 +76,12 @@ void ImmediateGeometry3D::add_vertex(const Vector3 &p_vertex) {
void ImmediateGeometry3D::end() {
- VS::get_singleton()->immediate_end(im);
+ RS::get_singleton()->immediate_end(im);
}
void ImmediateGeometry3D::clear() {
- VS::get_singleton()->immediate_clear(im);
+ RS::get_singleton()->immediate_clear(im);
empty = true;
cached_textures.clear();
}
@@ -158,12 +158,12 @@ void ImmediateGeometry3D::_bind_methods() {
ImmediateGeometry3D::ImmediateGeometry3D() {
- im = VisualServer::get_singleton()->immediate_create();
+ im = RenderingServer::get_singleton()->immediate_create();
set_base(im);
empty = true;
}
ImmediateGeometry3D::~ImmediateGeometry3D() {
- VisualServer::get_singleton()->free(im);
+ RenderingServer::get_singleton()->free(im);
}
diff --git a/scene/3d/immediate_geometry_3d.h b/scene/3d/immediate_geometry_3d.h
index d968187ba3..6e15450a5b 100644
--- a/scene/3d/immediate_geometry_3d.h
+++ b/scene/3d/immediate_geometry_3d.h
@@ -40,7 +40,7 @@ class ImmediateGeometry3D : public GeometryInstance3D {
RID im;
//a list of textures drawn need to be kept, to avoid references
- // in VisualServer from becoming invalid if the texture is no longer used
+ // in RenderingServer from becoming invalid if the texture is no longer used
List<Ref<Texture2D>> cached_textures;
bool empty;
AABB aabb;
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp
index 434f35fc57..7fc7fe2bf5 100644
--- a/scene/3d/light_3d.cpp
+++ b/scene/3d/light_3d.cpp
@@ -44,7 +44,7 @@ void Light3D::set_param(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
param[p_param] = p_value;
- VS::get_singleton()->light_set_param(light, VS::LightParam(p_param), p_value);
+ RS::get_singleton()->light_set_param(light, RS::LightParam(p_param), p_value);
if (p_param == PARAM_SPOT_ANGLE || p_param == PARAM_RANGE) {
update_gizmo();
@@ -68,9 +68,9 @@ float Light3D::get_param(Param p_param) const {
void Light3D::set_shadow(bool p_enable) {
shadow = p_enable;
- VS::get_singleton()->light_set_shadow(light, p_enable);
+ RS::get_singleton()->light_set_shadow(light, p_enable);
- if (type == VisualServer::LIGHT_SPOT) {
+ if (type == RenderingServer::LIGHT_SPOT) {
update_configuration_warning();
}
}
@@ -82,7 +82,7 @@ bool Light3D::has_shadow() const {
void Light3D::set_negative(bool p_enable) {
negative = p_enable;
- VS::get_singleton()->light_set_negative(light, p_enable);
+ RS::get_singleton()->light_set_negative(light, p_enable);
}
bool Light3D::is_negative() const {
@@ -92,7 +92,7 @@ bool Light3D::is_negative() const {
void Light3D::set_cull_mask(uint32_t p_cull_mask) {
cull_mask = p_cull_mask;
- VS::get_singleton()->light_set_cull_mask(light, p_cull_mask);
+ RS::get_singleton()->light_set_cull_mask(light, p_cull_mask);
}
uint32_t Light3D::get_cull_mask() const {
@@ -102,7 +102,7 @@ uint32_t Light3D::get_cull_mask() const {
void Light3D::set_color(const Color &p_color) {
color = p_color;
- VS::get_singleton()->light_set_color(light, p_color);
+ RS::get_singleton()->light_set_color(light, p_color);
// The gizmo color depends on the light color, so update it.
update_gizmo();
}
@@ -114,7 +114,7 @@ Color Light3D::get_color() const {
void Light3D::set_shadow_color(const Color &p_shadow_color) {
shadow_color = p_shadow_color;
- VS::get_singleton()->light_set_shadow_color(light, p_shadow_color);
+ RS::get_singleton()->light_set_shadow_color(light, p_shadow_color);
}
Color Light3D::get_shadow_color() const {
@@ -124,7 +124,7 @@ Color Light3D::get_shadow_color() const {
void Light3D::set_shadow_reverse_cull_face(bool p_enable) {
reverse_cull = p_enable;
- VS::get_singleton()->light_set_reverse_cull_face_mode(light, reverse_cull);
+ RS::get_singleton()->light_set_reverse_cull_face_mode(light, reverse_cull);
}
bool Light3D::get_shadow_reverse_cull_face() const {
@@ -134,15 +134,15 @@ bool Light3D::get_shadow_reverse_cull_face() const {
AABB Light3D::get_aabb() const {
- if (type == VisualServer::LIGHT_DIRECTIONAL) {
+ if (type == RenderingServer::LIGHT_DIRECTIONAL) {
return AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2));
- } else if (type == VisualServer::LIGHT_OMNI) {
+ } else if (type == RenderingServer::LIGHT_OMNI) {
return AABB(Vector3(-1, -1, -1) * param[PARAM_RANGE], Vector3(2, 2, 2) * param[PARAM_RANGE]);
- } else if (type == VisualServer::LIGHT_SPOT) {
+ } else if (type == RenderingServer::LIGHT_SPOT) {
float len = param[PARAM_RANGE];
float size = Math::tan(Math::deg2rad(param[PARAM_SPOT_ANGLE])) * len;
@@ -159,7 +159,7 @@ Vector<Face3> Light3D::get_faces(uint32_t p_usage_flags) const {
void Light3D::set_bake_mode(BakeMode p_mode) {
bake_mode = p_mode;
- VS::get_singleton()->light_set_use_gi(light, p_mode != BAKE_DISABLED);
+ RS::get_singleton()->light_set_use_gi(light, p_mode != BAKE_DISABLED);
}
Light3D::BakeMode Light3D::get_bake_mode() const {
@@ -187,7 +187,7 @@ void Light3D::_update_visibility() {
}
#endif
- VS::get_singleton()->instance_set_visible(get_instance(), is_visible_in_tree() && editor_ok);
+ RS::get_singleton()->instance_set_visible(get_instance(), is_visible_in_tree() && editor_ok);
_change_notify("geometry/visible");
}
@@ -217,7 +217,7 @@ bool Light3D::is_editor_only() const {
void Light3D::_validate_property(PropertyInfo &property) const {
- if (VisualServer::get_singleton()->is_low_end() && property.name == "shadow_contact") {
+ if (RenderingServer::get_singleton()->is_low_end() && property.name == "shadow_contact") {
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
}
}
@@ -292,18 +292,18 @@ void Light3D::_bind_methods() {
BIND_ENUM_CONSTANT(BAKE_ALL);
}
-Light3D::Light3D(VisualServer::LightType p_type) {
+Light3D::Light3D(RenderingServer::LightType p_type) {
type = p_type;
switch (p_type) {
- case VS::LIGHT_DIRECTIONAL: light = VisualServer::get_singleton()->directional_light_create(); break;
- case VS::LIGHT_OMNI: light = VisualServer::get_singleton()->omni_light_create(); break;
- case VS::LIGHT_SPOT: light = VisualServer::get_singleton()->spot_light_create(); break;
+ case RS::LIGHT_DIRECTIONAL: light = RenderingServer::get_singleton()->directional_light_create(); break;
+ case RS::LIGHT_OMNI: light = RenderingServer::get_singleton()->omni_light_create(); break;
+ case RS::LIGHT_SPOT: light = RenderingServer::get_singleton()->spot_light_create(); break;
default: {
};
}
- VS::get_singleton()->instance_set_base(get_instance(), light);
+ RS::get_singleton()->instance_set_base(get_instance(), light);
reverse_cull = false;
bake_mode = BAKE_INDIRECT;
@@ -335,23 +335,23 @@ Light3D::Light3D(VisualServer::LightType p_type) {
Light3D::Light3D() {
- type = VisualServer::LIGHT_DIRECTIONAL;
+ type = RenderingServer::LIGHT_DIRECTIONAL;
ERR_PRINT("Light should not be instanced directly; use the DirectionalLight, OmniLight or SpotLight subtypes instead.");
}
Light3D::~Light3D() {
- VS::get_singleton()->instance_set_base(get_instance(), RID());
+ RS::get_singleton()->instance_set_base(get_instance(), RID());
if (light.is_valid())
- VisualServer::get_singleton()->free(light);
+ RenderingServer::get_singleton()->free(light);
}
/////////////////////////////////////////
void DirectionalLight3D::set_shadow_mode(ShadowMode p_mode) {
shadow_mode = p_mode;
- VS::get_singleton()->light_directional_set_shadow_mode(light, VS::LightDirectionalShadowMode(p_mode));
+ RS::get_singleton()->light_directional_set_shadow_mode(light, RS::LightDirectionalShadowMode(p_mode));
}
DirectionalLight3D::ShadowMode DirectionalLight3D::get_shadow_mode() const {
@@ -361,7 +361,7 @@ DirectionalLight3D::ShadowMode DirectionalLight3D::get_shadow_mode() const {
void DirectionalLight3D::set_shadow_depth_range(ShadowDepthRange p_range) {
shadow_depth_range = p_range;
- VS::get_singleton()->light_directional_set_shadow_depth_range_mode(light, VS::LightDirectionalShadowDepthRangeMode(p_range));
+ RS::get_singleton()->light_directional_set_shadow_depth_range_mode(light, RS::LightDirectionalShadowDepthRangeMode(p_range));
}
DirectionalLight3D::ShadowDepthRange DirectionalLight3D::get_shadow_depth_range() const {
@@ -372,7 +372,7 @@ DirectionalLight3D::ShadowDepthRange DirectionalLight3D::get_shadow_depth_range(
void DirectionalLight3D::set_blend_splits(bool p_enable) {
blend_splits = p_enable;
- VS::get_singleton()->light_directional_set_blend_splits(light, p_enable);
+ RS::get_singleton()->light_directional_set_blend_splits(light, p_enable);
}
bool DirectionalLight3D::is_blend_splits_enabled() const {
@@ -412,7 +412,7 @@ void DirectionalLight3D::_bind_methods() {
}
DirectionalLight3D::DirectionalLight3D() :
- Light3D(VisualServer::LIGHT_DIRECTIONAL) {
+ Light3D(RenderingServer::LIGHT_DIRECTIONAL) {
set_param(PARAM_SHADOW_NORMAL_BIAS, 0.8);
set_param(PARAM_SHADOW_BIAS, 0.1);
@@ -428,7 +428,7 @@ DirectionalLight3D::DirectionalLight3D() :
void OmniLight3D::set_shadow_mode(ShadowMode p_mode) {
shadow_mode = p_mode;
- VS::get_singleton()->light_omni_set_shadow_mode(light, VS::LightOmniShadowMode(p_mode));
+ RS::get_singleton()->light_omni_set_shadow_mode(light, RS::LightOmniShadowMode(p_mode));
}
OmniLight3D::ShadowMode OmniLight3D::get_shadow_mode() const {
@@ -451,7 +451,7 @@ void OmniLight3D::_bind_methods() {
}
OmniLight3D::OmniLight3D() :
- Light3D(VisualServer::LIGHT_OMNI) {
+ Light3D(RenderingServer::LIGHT_OMNI) {
set_shadow_mode(SHADOW_CUBE);
}
diff --git a/scene/3d/light_3d.h b/scene/3d/light_3d.h
index 7b3273e1e4..197e5854ec 100644
--- a/scene/3d/light_3d.h
+++ b/scene/3d/light_3d.h
@@ -33,7 +33,7 @@
#include "scene/3d/visual_instance_3d.h"
#include "scene/resources/texture.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class Light3D : public VisualInstance3D {
@@ -42,23 +42,23 @@ class Light3D : public VisualInstance3D {
public:
enum Param {
- PARAM_ENERGY = VS::LIGHT_PARAM_ENERGY,
- PARAM_INDIRECT_ENERGY = VS::LIGHT_PARAM_INDIRECT_ENERGY,
- PARAM_SPECULAR = VS::LIGHT_PARAM_SPECULAR,
- PARAM_RANGE = VS::LIGHT_PARAM_RANGE,
- PARAM_ATTENUATION = VS::LIGHT_PARAM_ATTENUATION,
- PARAM_SPOT_ANGLE = VS::LIGHT_PARAM_SPOT_ANGLE,
- PARAM_SPOT_ATTENUATION = VS::LIGHT_PARAM_SPOT_ATTENUATION,
- PARAM_CONTACT_SHADOW_SIZE = VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE,
- PARAM_SHADOW_MAX_DISTANCE = VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE,
- PARAM_SHADOW_SPLIT_1_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET,
- PARAM_SHADOW_SPLIT_2_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET,
- PARAM_SHADOW_SPLIT_3_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET,
- PARAM_SHADOW_FADE_START = VS::LIGHT_PARAM_SHADOW_FADE_START,
- PARAM_SHADOW_NORMAL_BIAS = VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS,
- PARAM_SHADOW_BIAS = VS::LIGHT_PARAM_SHADOW_BIAS,
- PARAM_SHADOW_BIAS_SPLIT_SCALE = VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE,
- PARAM_MAX = VS::LIGHT_PARAM_MAX
+ PARAM_ENERGY = RS::LIGHT_PARAM_ENERGY,
+ PARAM_INDIRECT_ENERGY = RS::LIGHT_PARAM_INDIRECT_ENERGY,
+ PARAM_SPECULAR = RS::LIGHT_PARAM_SPECULAR,
+ PARAM_RANGE = RS::LIGHT_PARAM_RANGE,
+ PARAM_ATTENUATION = RS::LIGHT_PARAM_ATTENUATION,
+ PARAM_SPOT_ANGLE = RS::LIGHT_PARAM_SPOT_ANGLE,
+ PARAM_SPOT_ATTENUATION = RS::LIGHT_PARAM_SPOT_ATTENUATION,
+ PARAM_CONTACT_SHADOW_SIZE = RS::LIGHT_PARAM_CONTACT_SHADOW_SIZE,
+ PARAM_SHADOW_MAX_DISTANCE = RS::LIGHT_PARAM_SHADOW_MAX_DISTANCE,
+ PARAM_SHADOW_SPLIT_1_OFFSET = RS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET,
+ PARAM_SHADOW_SPLIT_2_OFFSET = RS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET,
+ PARAM_SHADOW_SPLIT_3_OFFSET = RS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET,
+ PARAM_SHADOW_FADE_START = RS::LIGHT_PARAM_SHADOW_FADE_START,
+ PARAM_SHADOW_NORMAL_BIAS = RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS,
+ PARAM_SHADOW_BIAS = RS::LIGHT_PARAM_SHADOW_BIAS,
+ PARAM_SHADOW_BIAS_SPLIT_SCALE = RS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE,
+ PARAM_MAX = RS::LIGHT_PARAM_MAX
};
enum BakeMode {
@@ -75,7 +75,7 @@ private:
bool negative;
bool reverse_cull;
uint32_t cull_mask;
- VS::LightType type;
+ RS::LightType type;
bool editor_only;
void _update_visibility();
BakeMode bake_mode;
@@ -91,10 +91,10 @@ protected:
void _notification(int p_what);
virtual void _validate_property(PropertyInfo &property) const;
- Light3D(VisualServer::LightType p_type);
+ Light3D(RenderingServer::LightType p_type);
public:
- VS::LightType get_light_type() const { return type; }
+ RS::LightType get_light_type() const { return type; }
void set_editor_only(bool p_editor_only);
bool is_editor_only() const;
@@ -145,8 +145,8 @@ public:
};
enum ShadowDepthRange {
- SHADOW_DEPTH_RANGE_STABLE = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE,
- SHADOW_DEPTH_RANGE_OPTIMIZED = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED,
+ SHADOW_DEPTH_RANGE_STABLE = RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE,
+ SHADOW_DEPTH_RANGE_OPTIMIZED = RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED,
};
private:
@@ -210,7 +210,7 @@ public:
virtual String get_configuration_warning() const;
SpotLight3D() :
- Light3D(VisualServer::LIGHT_SPOT) {}
+ Light3D(RenderingServer::LIGHT_SPOT) {}
};
#endif
diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp
index 5f826505b4..284bbd7091 100644
--- a/scene/3d/mesh_instance_3d.cpp
+++ b/scene/3d/mesh_instance_3d.cpp
@@ -47,7 +47,7 @@ bool MeshInstance3D::_set(const StringName &p_name, const Variant &p_value) {
Map<StringName, BlendShapeTrack>::Element *E = blend_shape_tracks.find(p_name);
if (E) {
E->get().value = p_value;
- VisualServer::get_singleton()->instance_set_blend_shape_weight(get_instance(), E->get().idx, E->get().value);
+ RenderingServer::get_singleton()->instance_set_blend_shape_weight(get_instance(), E->get().idx, E->get().value);
return true;
}
@@ -165,9 +165,9 @@ void MeshInstance3D::_resolve_skeleton_path() {
skin_ref = new_skin_reference;
if (skin_ref.is_valid()) {
- VisualServer::get_singleton()->instance_attach_skeleton(get_instance(), skin_ref->get_skeleton());
+ RenderingServer::get_singleton()->instance_attach_skeleton(get_instance(), skin_ref->get_skeleton());
} else {
- VisualServer::get_singleton()->instance_attach_skeleton(get_instance(), RID());
+ RenderingServer::get_singleton()->instance_attach_skeleton(get_instance(), RID());
}
}
@@ -293,9 +293,9 @@ void MeshInstance3D::set_surface_material(int p_surface, const Ref<Material> &p_
materials.write[p_surface] = p_material;
if (materials[p_surface].is_valid())
- VS::get_singleton()->instance_set_surface_material(get_instance(), p_surface, materials[p_surface]->get_rid());
+ RS::get_singleton()->instance_set_surface_material(get_instance(), p_surface, materials[p_surface]->get_rid());
else
- VS::get_singleton()->instance_set_surface_material(get_instance(), p_surface, RID());
+ RS::get_singleton()->instance_set_surface_material(get_instance(), p_surface, RID());
}
Ref<Material> MeshInstance3D::get_surface_material(int p_surface) const {
diff --git a/scene/3d/navigation_3d.cpp b/scene/3d/navigation_3d.cpp
index 28da04fcbe..f880f65d37 100644
--- a/scene/3d/navigation_3d.cpp
+++ b/scene/3d/navigation_3d.cpp
@@ -30,33 +30,33 @@
#include "navigation_3d.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
Vector<Vector3> Navigation3D::get_simple_path(const Vector3 &p_start, const Vector3 &p_end, bool p_optimize) const {
- return NavigationServer::get_singleton()->map_get_path(map, p_start, p_end, p_optimize);
+ return NavigationServer3D::get_singleton()->map_get_path(map, p_start, p_end, p_optimize);
}
Vector3 Navigation3D::get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, bool p_use_collision) const {
- return NavigationServer::get_singleton()->map_get_closest_point_to_segment(map, p_from, p_to, p_use_collision);
+ return NavigationServer3D::get_singleton()->map_get_closest_point_to_segment(map, p_from, p_to, p_use_collision);
}
Vector3 Navigation3D::get_closest_point(const Vector3 &p_point) const {
- return NavigationServer::get_singleton()->map_get_closest_point(map, p_point);
+ return NavigationServer3D::get_singleton()->map_get_closest_point(map, p_point);
}
Vector3 Navigation3D::get_closest_point_normal(const Vector3 &p_point) const {
- return NavigationServer::get_singleton()->map_get_closest_point_normal(map, p_point);
+ return NavigationServer3D::get_singleton()->map_get_closest_point_normal(map, p_point);
}
RID Navigation3D::get_closest_point_owner(const Vector3 &p_point) const {
- return NavigationServer::get_singleton()->map_get_closest_point_owner(map, p_point);
+ return NavigationServer3D::get_singleton()->map_get_closest_point_owner(map, p_point);
}
void Navigation3D::set_up_vector(const Vector3 &p_up) {
up = p_up;
- NavigationServer::get_singleton()->map_set_up(map, up);
+ NavigationServer3D::get_singleton()->map_set_up(map, up);
}
Vector3 Navigation3D::get_up_vector() const {
@@ -66,12 +66,12 @@ Vector3 Navigation3D::get_up_vector() const {
void Navigation3D::set_cell_size(float p_cell_size) {
cell_size = p_cell_size;
- NavigationServer::get_singleton()->map_set_cell_size(map, cell_size);
+ NavigationServer3D::get_singleton()->map_set_cell_size(map, cell_size);
}
void Navigation3D::set_edge_connection_margin(float p_edge_connection_margin) {
edge_connection_margin = p_edge_connection_margin;
- NavigationServer::get_singleton()->map_set_edge_connection_margin(map, edge_connection_margin);
+ NavigationServer3D::get_singleton()->map_set_edge_connection_margin(map, edge_connection_margin);
}
void Navigation3D::_bind_methods() {
@@ -101,18 +101,18 @@ void Navigation3D::_bind_methods() {
void Navigation3D::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
- NavigationServer::get_singleton()->map_set_active(map, true);
+ NavigationServer3D::get_singleton()->map_set_active(map, true);
} break;
case NOTIFICATION_EXIT_TREE: {
- NavigationServer::get_singleton()->map_set_active(map, false);
+ NavigationServer3D::get_singleton()->map_set_active(map, false);
} break;
}
}
Navigation3D::Navigation3D() {
- map = NavigationServer::get_singleton()->map_create();
+ map = NavigationServer3D::get_singleton()->map_create();
set_cell_size(0.3);
set_edge_connection_margin(5.0); // Five meters, depends alot on the agents radius
@@ -121,5 +121,5 @@ Navigation3D::Navigation3D() {
}
Navigation3D::~Navigation3D() {
- NavigationServer::get_singleton()->free(map);
+ NavigationServer3D::get_singleton()->free(map);
}
diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp
index 219e868f29..76f1d4688d 100644
--- a/scene/3d/navigation_agent_3d.cpp
+++ b/scene/3d/navigation_agent_3d.cpp
@@ -32,7 +32,7 @@
#include "core/engine.h"
#include "scene/3d/navigation_3d.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
void NavigationAgent3D::_bind_methods() {
@@ -102,7 +102,7 @@ void NavigationAgent3D::_notification(int p_what) {
agent_parent = Object::cast_to<Node3D>(get_parent());
- NavigationServer::get_singleton()->agent_set_callback(agent, this, "_avoidance_done");
+ NavigationServer3D::get_singleton()->agent_set_callback(agent, this, "_avoidance_done");
// Search the navigation node and set it
{
@@ -129,7 +129,7 @@ void NavigationAgent3D::_notification(int p_what) {
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
if (agent_parent) {
- NavigationServer::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin);
+ NavigationServer3D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin);
if (!target_reached) {
if (distance_to_target() < target_desired_distance) {
emit_signal("target_reached");
@@ -151,7 +151,7 @@ NavigationAgent3D::NavigationAgent3D() :
velocity_submitted(false),
target_reached(false),
navigation_finished(true) {
- agent = NavigationServer::get_singleton()->agent_create();
+ agent = NavigationServer3D::get_singleton()->agent_create();
set_neighbor_dist(50.0);
set_max_neighbors(10);
set_time_horizon(5.0);
@@ -161,7 +161,7 @@ NavigationAgent3D::NavigationAgent3D() :
}
NavigationAgent3D::~NavigationAgent3D() {
- NavigationServer::get_singleton()->free(agent);
+ NavigationServer3D::get_singleton()->free(agent);
agent = RID(); // Pointless
}
@@ -170,7 +170,7 @@ void NavigationAgent3D::set_navigation(Navigation3D *p_nav) {
return; // Pointless
navigation = p_nav;
- NavigationServer::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
+ NavigationServer3D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
}
void NavigationAgent3D::set_navigation_node(Node *p_nav) {
@@ -189,7 +189,7 @@ void NavigationAgent3D::set_target_desired_distance(real_t p_dd) {
void NavigationAgent3D::set_radius(real_t p_radius) {
radius = p_radius;
- NavigationServer::get_singleton()->agent_set_radius(agent, radius);
+ NavigationServer3D::get_singleton()->agent_set_radius(agent, radius);
}
void NavigationAgent3D::set_agent_height_offset(real_t p_hh) {
@@ -198,27 +198,27 @@ void NavigationAgent3D::set_agent_height_offset(real_t p_hh) {
void NavigationAgent3D::set_ignore_y(bool p_ignore_y) {
ignore_y = p_ignore_y;
- NavigationServer::get_singleton()->agent_set_ignore_y(agent, ignore_y);
+ NavigationServer3D::get_singleton()->agent_set_ignore_y(agent, ignore_y);
}
void NavigationAgent3D::set_neighbor_dist(real_t p_dist) {
neighbor_dist = p_dist;
- NavigationServer::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
+ NavigationServer3D::get_singleton()->agent_set_neighbor_dist(agent, neighbor_dist);
}
void NavigationAgent3D::set_max_neighbors(int p_count) {
max_neighbors = p_count;
- NavigationServer::get_singleton()->agent_set_max_neighbors(agent, max_neighbors);
+ NavigationServer3D::get_singleton()->agent_set_max_neighbors(agent, max_neighbors);
}
void NavigationAgent3D::set_time_horizon(real_t p_time) {
time_horizon = p_time;
- NavigationServer::get_singleton()->agent_set_time_horizon(agent, time_horizon);
+ NavigationServer3D::get_singleton()->agent_set_time_horizon(agent, time_horizon);
}
void NavigationAgent3D::set_max_speed(real_t p_max_speed) {
max_speed = p_max_speed;
- NavigationServer::get_singleton()->agent_set_max_speed(agent, max_speed);
+ NavigationServer3D::get_singleton()->agent_set_max_speed(agent, max_speed);
}
void NavigationAgent3D::set_path_max_distance(real_t p_pmd) {
@@ -279,8 +279,8 @@ Vector3 NavigationAgent3D::get_final_location() {
void NavigationAgent3D::set_velocity(Vector3 p_velocity) {
target_velocity = p_velocity;
- NavigationServer::get_singleton()->agent_set_target_velocity(agent, target_velocity);
- NavigationServer::get_singleton()->agent_set_velocity(agent, prev_safe_velocity);
+ NavigationServer3D::get_singleton()->agent_set_target_velocity(agent, target_velocity);
+ NavigationServer3D::get_singleton()->agent_set_velocity(agent, prev_safe_velocity);
velocity_submitted = true;
}
@@ -316,7 +316,7 @@ void NavigationAgent3D::update_navigation() {
bool reload_path = false;
- if (NavigationServer::get_singleton()->agent_is_map_changed(agent)) {
+ if (NavigationServer3D::get_singleton()->agent_is_map_changed(agent)) {
reload_path = true;
} else if (navigation_path.size() == 0) {
reload_path = true;
@@ -337,7 +337,7 @@ void NavigationAgent3D::update_navigation() {
}
if (reload_path) {
- navigation_path = NavigationServer::get_singleton()->map_get_path(navigation->get_rid(), o, target_location, true);
+ navigation_path = NavigationServer3D::get_singleton()->map_get_path(navigation->get_rid(), o, target_location, true);
navigation_finished = false;
nav_path_index = 0;
emit_signal("path_changed");
diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp
index 9eef4a1340..63c273b4ca 100644
--- a/scene/3d/navigation_obstacle_3d.cpp
+++ b/scene/3d/navigation_obstacle_3d.cpp
@@ -33,7 +33,7 @@
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/navigation_3d.h"
#include "scene/3d/physics_body_3d.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
void NavigationObstacle3D::_bind_methods() {
@@ -71,15 +71,15 @@ void NavigationObstacle3D::_notification(int p_what) {
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
Node3D *spatial = Object::cast_to<Node3D>(get_parent());
if (spatial) {
- NavigationServer::get_singleton()->agent_set_position(agent, spatial->get_global_transform().origin);
+ NavigationServer3D::get_singleton()->agent_set_position(agent, spatial->get_global_transform().origin);
}
PhysicsBody3D *rigid = Object::cast_to<PhysicsBody3D>(get_parent());
if (rigid) {
Vector3 v = rigid->get_linear_velocity();
- NavigationServer::get_singleton()->agent_set_velocity(agent, v);
- NavigationServer::get_singleton()->agent_set_target_velocity(agent, v);
+ NavigationServer3D::get_singleton()->agent_set_velocity(agent, v);
+ NavigationServer3D::get_singleton()->agent_set_target_velocity(agent, v);
}
} break;
@@ -89,11 +89,11 @@ void NavigationObstacle3D::_notification(int p_what) {
NavigationObstacle3D::NavigationObstacle3D() :
navigation(NULL),
agent(RID()) {
- agent = NavigationServer::get_singleton()->agent_create();
+ agent = NavigationServer3D::get_singleton()->agent_create();
}
NavigationObstacle3D::~NavigationObstacle3D() {
- NavigationServer::get_singleton()->free(agent);
+ NavigationServer3D::get_singleton()->free(agent);
agent = RID(); // Pointless
}
@@ -102,7 +102,7 @@ void NavigationObstacle3D::set_navigation(Navigation3D *p_nav) {
return; // Pointless
navigation = p_nav;
- NavigationServer::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
+ NavigationServer3D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid());
}
void NavigationObstacle3D::set_navigation_node(Node *p_nav) {
@@ -155,9 +155,9 @@ void NavigationObstacle3D::update_agent_shape() {
radius = 1.0; // Never a 0 radius
// Initialize the Agent as an object
- NavigationServer::get_singleton()->agent_set_neighbor_dist(agent, 0.0);
- NavigationServer::get_singleton()->agent_set_max_neighbors(agent, 0);
- NavigationServer::get_singleton()->agent_set_time_horizon(agent, 0.0);
- NavigationServer::get_singleton()->agent_set_radius(agent, radius);
- NavigationServer::get_singleton()->agent_set_max_speed(agent, 0.0);
+ NavigationServer3D::get_singleton()->agent_set_neighbor_dist(agent, 0.0);
+ NavigationServer3D::get_singleton()->agent_set_max_neighbors(agent, 0);
+ NavigationServer3D::get_singleton()->agent_set_time_horizon(agent, 0.0);
+ NavigationServer3D::get_singleton()->agent_set_radius(agent, radius);
+ NavigationServer3D::get_singleton()->agent_set_max_speed(agent, 0.0);
}
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp
index 8035e6149d..4bb2c72172 100644
--- a/scene/3d/navigation_region_3d.cpp
+++ b/scene/3d/navigation_region_3d.cpp
@@ -32,7 +32,7 @@
#include "core/os/thread.h"
#include "mesh_instance_3d.h"
#include "navigation_3d.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
void NavigationRegion3D::set_enabled(bool p_enabled) {
@@ -45,12 +45,12 @@ void NavigationRegion3D::set_enabled(bool p_enabled) {
if (!enabled) {
- NavigationServer::get_singleton()->region_set_map(region, RID());
+ NavigationServer3D::get_singleton()->region_set_map(region, RID());
} else {
if (navigation) {
- NavigationServer::get_singleton()->region_set_map(region, navigation->get_rid());
+ NavigationServer3D::get_singleton()->region_set_map(region, navigation->get_rid());
}
}
@@ -86,7 +86,7 @@ void NavigationRegion3D::_notification(int p_what) {
if (enabled) {
- NavigationServer::get_singleton()->region_set_map(region, navigation->get_rid());
+ NavigationServer3D::get_singleton()->region_set_map(region, navigation->get_rid());
}
break;
}
@@ -110,14 +110,14 @@ void NavigationRegion3D::_notification(int p_what) {
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
- NavigationServer::get_singleton()->region_set_transform(region, get_global_transform());
+ NavigationServer3D::get_singleton()->region_set_transform(region, get_global_transform());
} break;
case NOTIFICATION_EXIT_TREE: {
if (navigation) {
- NavigationServer::get_singleton()->region_set_map(region, RID());
+ NavigationServer3D::get_singleton()->region_set_map(region, RID());
}
if (debug_view) {
@@ -144,7 +144,7 @@ void NavigationRegion3D::set_navigation_mesh(const Ref<NavigationMesh> &p_navmes
navmesh->add_change_receptor(this);
}
- NavigationServer::get_singleton()->region_set_navmesh(region, p_navmesh);
+ NavigationServer3D::get_singleton()->region_set_navmesh(region, p_navmesh);
if (debug_view && navmesh.is_valid()) {
Object::cast_to<MeshInstance3D>(debug_view)->set_mesh(navmesh->get_debug_mesh());
@@ -171,7 +171,7 @@ void _bake_navigation_mesh(void *p_user_data) {
if (args->nav_region->get_navigation_mesh().is_valid()) {
Ref<NavigationMesh> nav_mesh = args->nav_region->get_navigation_mesh()->duplicate();
- NavigationServer::get_singleton()->region_bake_navmesh(nav_mesh, args->nav_region);
+ NavigationServer3D::get_singleton()->region_bake_navmesh(nav_mesh, args->nav_region);
args->nav_region->call_deferred("_bake_finished", nav_mesh);
memdelete(args);
} else {
@@ -244,7 +244,7 @@ NavigationRegion3D::NavigationRegion3D() {
enabled = true;
set_notify_transform(true);
- region = NavigationServer::get_singleton()->region_create();
+ region = NavigationServer3D::get_singleton()->region_create();
navigation = NULL;
debug_view = NULL;
@@ -254,5 +254,5 @@ NavigationRegion3D::NavigationRegion3D() {
NavigationRegion3D::~NavigationRegion3D() {
if (navmesh.is_valid())
navmesh->remove_change_receptor(this);
- NavigationServer::get_singleton()->free(region);
+ NavigationServer3D::get_singleton()->free(region);
}
diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp
index ce1643aa6c..1f3e2b8373 100644
--- a/scene/3d/physics_body_3d.cpp
+++ b/scene/3d/physics_body_3d.cpp
@@ -38,7 +38,7 @@
#include "core/rid.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/scene_string_names.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
#ifdef TOOLS_ENABLED
#include "editor/plugins/node_3d_editor_plugin.h"
@@ -61,7 +61,7 @@ float PhysicsBody3D::get_inverse_mass() const {
void PhysicsBody3D::set_collision_layer(uint32_t p_layer) {
collision_layer = p_layer;
- PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), p_layer);
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(get_rid(), p_layer);
}
uint32_t PhysicsBody3D::get_collision_layer() const {
@@ -72,7 +72,7 @@ uint32_t PhysicsBody3D::get_collision_layer() const {
void PhysicsBody3D::set_collision_mask(uint32_t p_mask) {
collision_mask = p_mask;
- PhysicsServer::get_singleton()->body_set_collision_mask(get_rid(), p_mask);
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(get_rid(), p_mask);
}
uint32_t PhysicsBody3D::get_collision_mask() const {
@@ -112,11 +112,11 @@ bool PhysicsBody3D::get_collision_layer_bit(int p_bit) const {
Array PhysicsBody3D::get_collision_exceptions() {
List<RID> exceptions;
- PhysicsServer::get_singleton()->body_get_collision_exceptions(get_rid(), &exceptions);
+ PhysicsServer3D::get_singleton()->body_get_collision_exceptions(get_rid(), &exceptions);
Array ret;
for (List<RID>::Element *E = exceptions.front(); E; E = E->next()) {
RID body = E->get();
- ObjectID instance_id = PhysicsServer::get_singleton()->body_get_object_instance_id(body);
+ ObjectID instance_id = PhysicsServer3D::get_singleton()->body_get_object_instance_id(body);
Object *obj = ObjectDB::get_instance(instance_id);
PhysicsBody3D *physics_body = Object::cast_to<PhysicsBody3D>(obj);
ret.append(physics_body);
@@ -129,7 +129,7 @@ void PhysicsBody3D::add_collision_exception_with(Node *p_node) {
ERR_FAIL_NULL(p_node);
CollisionObject3D *collision_object = Object::cast_to<CollisionObject3D>(p_node);
ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject.");
- PhysicsServer::get_singleton()->body_add_collision_exception(get_rid(), collision_object->get_rid());
+ PhysicsServer3D::get_singleton()->body_add_collision_exception(get_rid(), collision_object->get_rid());
}
void PhysicsBody3D::remove_collision_exception_with(Node *p_node) {
@@ -137,7 +137,7 @@ void PhysicsBody3D::remove_collision_exception_with(Node *p_node) {
ERR_FAIL_NULL(p_node);
CollisionObject3D *collision_object = Object::cast_to<CollisionObject3D>(p_node);
ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject.");
- PhysicsServer::get_singleton()->body_remove_collision_exception(get_rid(), collision_object->get_rid());
+ PhysicsServer3D::get_singleton()->body_remove_collision_exception(get_rid(), collision_object->get_rid());
}
void PhysicsBody3D::_set_layers(uint32_t p_mask) {
@@ -171,8 +171,8 @@ void PhysicsBody3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask");
}
-PhysicsBody3D::PhysicsBody3D(PhysicsServer::BodyMode p_mode) :
- CollisionObject3D(PhysicsServer::get_singleton()->body_create(p_mode), false) {
+PhysicsBody3D::PhysicsBody3D(PhysicsServer3D::BodyMode p_mode) :
+ CollisionObject3D(PhysicsServer3D::get_singleton()->body_create(p_mode), false) {
collision_layer = 1;
collision_mask = 1;
@@ -200,13 +200,13 @@ Ref<PhysicsMaterial> StaticBody3D::get_physics_material_override() const {
void StaticBody3D::set_constant_linear_velocity(const Vector3 &p_vel) {
constant_linear_velocity = p_vel;
- PhysicsServer::get_singleton()->body_set_state(get_rid(), PhysicsServer::BODY_STATE_LINEAR_VELOCITY, constant_linear_velocity);
+ PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_LINEAR_VELOCITY, constant_linear_velocity);
}
void StaticBody3D::set_constant_angular_velocity(const Vector3 &p_vel) {
constant_angular_velocity = p_vel;
- PhysicsServer::get_singleton()->body_set_state(get_rid(), PhysicsServer::BODY_STATE_ANGULAR_VELOCITY, constant_angular_velocity);
+ PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY, constant_angular_velocity);
}
Vector3 StaticBody3D::get_constant_linear_velocity() const {
@@ -238,18 +238,18 @@ void StaticBody3D::_bind_methods() {
}
StaticBody3D::StaticBody3D() :
- PhysicsBody3D(PhysicsServer::BODY_MODE_STATIC) {
+ PhysicsBody3D(PhysicsServer3D::BODY_MODE_STATIC) {
}
StaticBody3D::~StaticBody3D() {}
void StaticBody3D::_reload_physics_characteristics() {
if (physics_material_override.is_null()) {
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_BOUNCE, 0);
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, 1);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_BOUNCE, 0);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_FRICTION, 1);
} else {
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
}
}
@@ -372,7 +372,7 @@ struct _RigidBodyInOut {
void RigidBody3D::_direct_state_changed(Object *p_state) {
#ifdef DEBUG_ENABLED
- state = Object::cast_to<PhysicsDirectBodyState>(p_state);
+ state = Object::cast_to<PhysicsDirectBodyState3D>(p_state);
#else
state = (PhysicsDirectBodyState *)p_state; //trust it
#endif
@@ -502,20 +502,20 @@ void RigidBody3D::set_mode(Mode p_mode) {
case MODE_RIGID: {
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_RIGID);
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_RIGID);
} break;
case MODE_STATIC: {
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_STATIC);
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_STATIC);
} break;
case MODE_CHARACTER: {
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_CHARACTER);
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_CHARACTER);
} break;
case MODE_KINEMATIC: {
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_KINEMATIC);
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_KINEMATIC);
} break;
}
update_configuration_warning();
@@ -532,7 +532,7 @@ void RigidBody3D::set_mass(real_t p_mass) {
mass = p_mass;
_change_notify("mass");
_change_notify("weight");
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_MASS, mass);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_MASS, mass);
}
real_t RigidBody3D::get_mass() const {
@@ -570,7 +570,7 @@ Ref<PhysicsMaterial> RigidBody3D::get_physics_material_override() const {
void RigidBody3D::set_gravity_scale(real_t p_gravity_scale) {
gravity_scale = p_gravity_scale;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
}
real_t RigidBody3D::get_gravity_scale() const {
@@ -581,7 +581,7 @@ void RigidBody3D::set_linear_damp(real_t p_linear_damp) {
ERR_FAIL_COND(p_linear_damp < -1);
linear_damp = p_linear_damp;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_LINEAR_DAMP, linear_damp);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_LINEAR_DAMP, linear_damp);
}
real_t RigidBody3D::get_linear_damp() const {
@@ -592,7 +592,7 @@ void RigidBody3D::set_angular_damp(real_t p_angular_damp) {
ERR_FAIL_COND(p_angular_damp < -1);
angular_damp = p_angular_damp;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_ANGULAR_DAMP, angular_damp);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_ANGULAR_DAMP, angular_damp);
}
real_t RigidBody3D::get_angular_damp() const {
@@ -608,7 +608,7 @@ void RigidBody3D::set_axis_velocity(const Vector3 &p_axis) {
if (state) {
set_linear_velocity(v);
} else {
- PhysicsServer::get_singleton()->body_set_axis_velocity(get_rid(), p_axis);
+ PhysicsServer3D::get_singleton()->body_set_axis_velocity(get_rid(), p_axis);
linear_velocity = v;
}
}
@@ -619,7 +619,7 @@ void RigidBody3D::set_linear_velocity(const Vector3 &p_velocity) {
if (state)
state->set_linear_velocity(linear_velocity);
else
- PhysicsServer::get_singleton()->body_set_state(get_rid(), PhysicsServer::BODY_STATE_LINEAR_VELOCITY, linear_velocity);
+ PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_LINEAR_VELOCITY, linear_velocity);
}
Vector3 RigidBody3D::get_linear_velocity() const {
@@ -633,7 +633,7 @@ void RigidBody3D::set_angular_velocity(const Vector3 &p_velocity) {
if (state)
state->set_angular_velocity(angular_velocity);
else
- PhysicsServer::get_singleton()->body_set_state(get_rid(), PhysicsServer::BODY_STATE_ANGULAR_VELOCITY, angular_velocity);
+ PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY, angular_velocity);
}
Vector3 RigidBody3D::get_angular_velocity() const {
@@ -646,7 +646,7 @@ void RigidBody3D::set_use_custom_integrator(bool p_enable) {
return;
custom_integrator = p_enable;
- PhysicsServer::get_singleton()->body_set_omit_force_integration(get_rid(), p_enable);
+ PhysicsServer3D::get_singleton()->body_set_omit_force_integration(get_rid(), p_enable);
}
bool RigidBody3D::is_using_custom_integrator() {
@@ -656,13 +656,13 @@ bool RigidBody3D::is_using_custom_integrator() {
void RigidBody3D::set_sleeping(bool p_sleeping) {
sleeping = p_sleeping;
- PhysicsServer::get_singleton()->body_set_state(get_rid(), PhysicsServer::BODY_STATE_SLEEPING, sleeping);
+ PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_SLEEPING, sleeping);
}
void RigidBody3D::set_can_sleep(bool p_active) {
can_sleep = p_active;
- PhysicsServer::get_singleton()->body_set_state(get_rid(), PhysicsServer::BODY_STATE_CAN_SLEEP, p_active);
+ PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_CAN_SLEEP, p_active);
}
bool RigidBody3D::is_able_to_sleep() const {
@@ -678,7 +678,7 @@ bool RigidBody3D::is_sleeping() const {
void RigidBody3D::set_max_contacts_reported(int p_amount) {
max_contacts_reported = p_amount;
- PhysicsServer::get_singleton()->body_set_max_contacts_reported(get_rid(), p_amount);
+ PhysicsServer3D::get_singleton()->body_set_max_contacts_reported(get_rid(), p_amount);
}
int RigidBody3D::get_max_contacts_reported() const {
@@ -687,34 +687,34 @@ int RigidBody3D::get_max_contacts_reported() const {
}
void RigidBody3D::add_central_force(const Vector3 &p_force) {
- PhysicsServer::get_singleton()->body_add_central_force(get_rid(), p_force);
+ PhysicsServer3D::get_singleton()->body_add_central_force(get_rid(), p_force);
}
void RigidBody3D::add_force(const Vector3 &p_force, const Vector3 &p_pos) {
- PhysicsServer::get_singleton()->body_add_force(get_rid(), p_force, p_pos);
+ PhysicsServer3D::get_singleton()->body_add_force(get_rid(), p_force, p_pos);
}
void RigidBody3D::add_torque(const Vector3 &p_torque) {
- PhysicsServer::get_singleton()->body_add_torque(get_rid(), p_torque);
+ PhysicsServer3D::get_singleton()->body_add_torque(get_rid(), p_torque);
}
void RigidBody3D::apply_central_impulse(const Vector3 &p_impulse) {
- PhysicsServer::get_singleton()->body_apply_central_impulse(get_rid(), p_impulse);
+ PhysicsServer3D::get_singleton()->body_apply_central_impulse(get_rid(), p_impulse);
}
void RigidBody3D::apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse) {
- PhysicsServer::get_singleton()->body_apply_impulse(get_rid(), p_pos, p_impulse);
+ PhysicsServer3D::get_singleton()->body_apply_impulse(get_rid(), p_pos, p_impulse);
}
void RigidBody3D::apply_torque_impulse(const Vector3 &p_impulse) {
- PhysicsServer::get_singleton()->body_apply_torque_impulse(get_rid(), p_impulse);
+ PhysicsServer3D::get_singleton()->body_apply_torque_impulse(get_rid(), p_impulse);
}
void RigidBody3D::set_use_continuous_collision_detection(bool p_enable) {
ccd = p_enable;
- PhysicsServer::get_singleton()->body_set_enable_continuous_collision_detection(get_rid(), p_enable);
+ PhysicsServer3D::get_singleton()->body_set_enable_continuous_collision_detection(get_rid(), p_enable);
}
bool RigidBody3D::is_using_continuous_collision_detection() const {
@@ -757,12 +757,12 @@ bool RigidBody3D::is_contact_monitor_enabled() const {
return contact_monitor != NULL;
}
-void RigidBody3D::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool p_lock) {
- PhysicsServer::get_singleton()->body_set_axis_lock(get_rid(), p_axis, p_lock);
+void RigidBody3D::set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool p_lock) {
+ PhysicsServer3D::get_singleton()->body_set_axis_lock(get_rid(), p_axis, p_lock);
}
-bool RigidBody3D::get_axis_lock(PhysicsServer::BodyAxis p_axis) const {
- return PhysicsServer::get_singleton()->body_is_axis_locked(get_rid(), p_axis);
+bool RigidBody3D::get_axis_lock(PhysicsServer3D::BodyAxis p_axis) const {
+ return PhysicsServer3D::get_singleton()->body_is_axis_locked(get_rid(), p_axis);
}
Array RigidBody3D::get_colliding_bodies() const {
@@ -878,12 +878,12 @@ void RigidBody3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sleeping"), "set_sleeping", "is_sleeping");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "can_sleep"), "set_can_sleep", "is_able_to_sleep");
ADD_GROUP("Axis Lock", "axis_lock_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_linear_x"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_X);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_linear_y"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_Y);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_linear_z"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_Z);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_x"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_ANGULAR_X);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_y"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_ANGULAR_Y);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_z"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_ANGULAR_Z);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_linear_x"), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_LINEAR_X);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_linear_y"), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_LINEAR_Y);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_linear_z"), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_LINEAR_Z);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_x"), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_ANGULAR_X);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_y"), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_ANGULAR_Y);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_z"), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_ANGULAR_Z);
ADD_GROUP("Linear", "linear_");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "linear_velocity"), "set_linear_velocity", "get_linear_velocity");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
@@ -904,7 +904,7 @@ void RigidBody3D::_bind_methods() {
}
RigidBody3D::RigidBody3D() :
- PhysicsBody3D(PhysicsServer::BODY_MODE_RIGID) {
+ PhysicsBody3D(PhysicsServer3D::BODY_MODE_RIGID) {
mode = MODE_RIGID;
@@ -924,7 +924,7 @@ RigidBody3D::RigidBody3D() :
contact_monitor = NULL;
can_sleep = true;
- PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
}
RigidBody3D::~RigidBody3D() {
@@ -935,11 +935,11 @@ RigidBody3D::~RigidBody3D() {
void RigidBody3D::_reload_physics_characteristics() {
if (physics_material_override.is_null()) {
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_BOUNCE, 0);
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, 1);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_BOUNCE, 0);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_FRICTION, 1);
} else {
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_BOUNCE, physics_material_override->computed_bounce());
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_FRICTION, physics_material_override->computed_friction());
}
}
@@ -974,8 +974,8 @@ Vector3 KinematicBody3D::get_angular_velocity() const {
bool KinematicBody3D::move_and_collide(const Vector3 &p_motion, bool p_infinite_inertia, Collision &r_collision, bool p_exclude_raycast_shapes, bool p_test_only) {
Transform gt = get_global_transform();
- PhysicsServer::MotionResult result;
- bool colliding = PhysicsServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, &result, p_exclude_raycast_shapes);
+ PhysicsServer3D::MotionResult result;
+ bool colliding = PhysicsServer3D::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, &result, p_exclude_raycast_shapes);
if (colliding) {
r_collision.collider_metadata = result.collider_metadata;
@@ -1168,17 +1168,17 @@ bool KinematicBody3D::test_move(const Transform &p_from, const Vector3 &p_motion
ERR_FAIL_COND_V(!is_inside_tree(), false);
- return PhysicsServer::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, p_infinite_inertia);
+ return PhysicsServer3D::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, p_infinite_inertia);
}
bool KinematicBody3D::separate_raycast_shapes(bool p_infinite_inertia, Collision &r_collision) {
- PhysicsServer::SeparationResult sep_res[8]; //max 8 rays
+ PhysicsServer3D::SeparationResult sep_res[8]; //max 8 rays
Transform gt = get_global_transform();
Vector3 recover;
- int hits = PhysicsServer::get_singleton()->body_test_ray_separation(get_rid(), gt, p_infinite_inertia, recover, sep_res, 8, margin);
+ int hits = PhysicsServer3D::get_singleton()->body_test_ray_separation(get_rid(), gt, p_infinite_inertia, recover, sep_res, 8, margin);
int deepest = -1;
float deepest_depth;
for (int i = 0; i < hits; i++) {
@@ -1208,18 +1208,18 @@ bool KinematicBody3D::separate_raycast_shapes(bool p_infinite_inertia, Collision
}
}
-void KinematicBody3D::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool p_lock) {
- PhysicsServer::get_singleton()->body_set_axis_lock(get_rid(), p_axis, p_lock);
+void KinematicBody3D::set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool p_lock) {
+ PhysicsServer3D::get_singleton()->body_set_axis_lock(get_rid(), p_axis, p_lock);
}
-bool KinematicBody3D::get_axis_lock(PhysicsServer::BodyAxis p_axis) const {
- return PhysicsServer::get_singleton()->body_is_axis_locked(get_rid(), p_axis);
+bool KinematicBody3D::get_axis_lock(PhysicsServer3D::BodyAxis p_axis) const {
+ return PhysicsServer3D::get_singleton()->body_is_axis_locked(get_rid(), p_axis);
}
void KinematicBody3D::set_safe_margin(float p_margin) {
margin = p_margin;
- PhysicsServer::get_singleton()->body_set_kinematic_safe_margin(get_rid(), margin);
+ PhysicsServer3D::get_singleton()->body_set_kinematic_safe_margin(get_rid(), margin);
}
float KinematicBody3D::get_safe_margin() const {
@@ -1289,16 +1289,16 @@ void KinematicBody3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_slide_count"), &KinematicBody3D::get_slide_count);
ClassDB::bind_method(D_METHOD("get_slide_collision", "slide_idx"), &KinematicBody3D::_get_slide_collision);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_x", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_X);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_y", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_Y);
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_z", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_Z);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_x", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_LINEAR_X);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_y", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_LINEAR_Y);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_z", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer3D::BODY_AXIS_LINEAR_Z);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
}
void KinematicBody3D::_direct_state_changed(Object *p_state) {
#ifdef DEBUG_ENABLED
- PhysicsDirectBodyState *state = Object::cast_to<PhysicsDirectBodyState>(p_state);
+ PhysicsDirectBodyState3D *state = Object::cast_to<PhysicsDirectBodyState3D>(p_state);
#else
PhysicsDirectBodyState *state = (PhysicsDirectBodyState *)p_state; //trust it
#endif
@@ -1308,7 +1308,7 @@ void KinematicBody3D::_direct_state_changed(Object *p_state) {
}
KinematicBody3D::KinematicBody3D() :
- PhysicsBody3D(PhysicsServer::BODY_MODE_KINEMATIC) {
+ PhysicsBody3D(PhysicsServer3D::BODY_MODE_KINEMATIC) {
margin = 0.001;
locked_axis = 0;
@@ -1316,7 +1316,7 @@ KinematicBody3D::KinematicBody3D() :
on_ceiling = false;
on_wall = false;
- PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
}
KinematicBody3D::~KinematicBody3D() {
@@ -1437,11 +1437,11 @@ void PhysicalBone3D::JointData::_get_property_list(List<PropertyInfo> *p_list) c
}
void PhysicalBone3D::apply_central_impulse(const Vector3 &p_impulse) {
- PhysicsServer::get_singleton()->body_apply_central_impulse(get_rid(), p_impulse);
+ PhysicsServer3D::get_singleton()->body_apply_central_impulse(get_rid(), p_impulse);
}
void PhysicalBone3D::apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse) {
- PhysicsServer::get_singleton()->body_apply_impulse(get_rid(), p_pos, p_impulse);
+ PhysicsServer3D::get_singleton()->body_apply_impulse(get_rid(), p_pos, p_impulse);
}
void PhysicalBone3D::reset_physics_simulation_state() {
@@ -1470,17 +1470,17 @@ bool PhysicalBone3D::PinJointData::_set(const StringName &p_name, const Variant
if ("joint_constraints/bias" == p_name) {
bias = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PIN_JOINT_BIAS, bias);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PIN_JOINT_BIAS, bias);
} else if ("joint_constraints/damping" == p_name) {
damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PIN_JOINT_DAMPING, damping);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PIN_JOINT_DAMPING, damping);
} else if ("joint_constraints/impulse_clamp" == p_name) {
impulse_clamp = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PIN_JOINT_IMPULSE_CLAMP, impulse_clamp);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP, impulse_clamp);
} else {
return false;
@@ -1523,27 +1523,27 @@ bool PhysicalBone3D::ConeJointData::_set(const StringName &p_name, const Variant
if ("joint_constraints/swing_span" == p_name) {
swing_span = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN, swing_span);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN, swing_span);
} else if ("joint_constraints/twist_span" == p_name) {
twist_span = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN, twist_span);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN, twist_span);
} else if ("joint_constraints/bias" == p_name) {
bias = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_BIAS, bias);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_BIAS, bias);
} else if ("joint_constraints/softness" == p_name) {
softness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_SOFTNESS, softness);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS, softness);
} else if ("joint_constraints/relaxation" == p_name) {
relaxation = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_RELAXATION, relaxation);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION, relaxation);
} else {
return false;
@@ -1592,32 +1592,32 @@ bool PhysicalBone3D::HingeJointData::_set(const StringName &p_name, const Varian
if ("joint_constraints/angular_limit_enabled" == p_name) {
angular_limit_enabled = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_flag(j, PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT, angular_limit_enabled);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_flag(j, PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT, angular_limit_enabled);
} else if ("joint_constraints/angular_limit_upper" == p_name) {
angular_limit_upper = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_UPPER, angular_limit_upper);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER, angular_limit_upper);
} else if ("joint_constraints/angular_limit_lower" == p_name) {
angular_limit_lower = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_LOWER, angular_limit_lower);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER, angular_limit_lower);
} else if ("joint_constraints/angular_limit_bias" == p_name) {
angular_limit_bias = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_BIAS, angular_limit_bias);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS, angular_limit_bias);
} else if ("joint_constraints/angular_limit_softness" == p_name) {
angular_limit_softness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS, angular_limit_softness);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS, angular_limit_softness);
} else if ("joint_constraints/angular_limit_relaxation" == p_name) {
angular_limit_relaxation = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION, angular_limit_relaxation);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION, angular_limit_relaxation);
} else {
return false;
@@ -1669,52 +1669,52 @@ bool PhysicalBone3D::SliderJointData::_set(const StringName &p_name, const Varia
if ("joint_constraints/linear_limit_upper" == p_name) {
linear_limit_upper = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER, linear_limit_upper);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER, linear_limit_upper);
} else if ("joint_constraints/linear_limit_lower" == p_name) {
linear_limit_lower = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER, linear_limit_lower);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER, linear_limit_lower);
} else if ("joint_constraints/linear_limit_softness" == p_name) {
linear_limit_softness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, linear_limit_softness);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, linear_limit_softness);
} else if ("joint_constraints/linear_limit_restitution" == p_name) {
linear_limit_restitution = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, linear_limit_restitution);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, linear_limit_restitution);
} else if ("joint_constraints/linear_limit_damping" == p_name) {
linear_limit_damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, linear_limit_restitution);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, linear_limit_restitution);
} else if ("joint_constraints/angular_limit_upper" == p_name) {
angular_limit_upper = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, angular_limit_upper);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, angular_limit_upper);
} else if ("joint_constraints/angular_limit_lower" == p_name) {
angular_limit_lower = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, angular_limit_lower);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, angular_limit_lower);
} else if ("joint_constraints/angular_limit_softness" == p_name) {
angular_limit_softness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness);
} else if ("joint_constraints/angular_limit_restitution" == p_name) {
angular_limit_restitution = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness);
} else if ("joint_constraints/angular_limit_damping" == p_name) {
angular_limit_damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, angular_limit_damping);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, angular_limit_damping);
} else {
return false;
@@ -1797,107 +1797,107 @@ bool PhysicalBone3D::SixDOFJointData::_set(const StringName &p_name, const Varia
if ("linear_limit_enabled" == var_name) {
axis_data[axis].linear_limit_enabled = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, axis_data[axis].linear_limit_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, axis_data[axis].linear_limit_enabled);
} else if ("linear_limit_upper" == var_name) {
axis_data[axis].linear_limit_upper = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT, axis_data[axis].linear_limit_upper);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT, axis_data[axis].linear_limit_upper);
} else if ("linear_limit_lower" == var_name) {
axis_data[axis].linear_limit_lower = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT, axis_data[axis].linear_limit_lower);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT, axis_data[axis].linear_limit_lower);
} else if ("linear_limit_softness" == var_name) {
axis_data[axis].linear_limit_softness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, axis_data[axis].linear_limit_softness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, axis_data[axis].linear_limit_softness);
} else if ("linear_spring_enabled" == var_name) {
axis_data[axis].linear_spring_enabled = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING, axis_data[axis].linear_spring_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING, axis_data[axis].linear_spring_enabled);
} else if ("linear_spring_stiffness" == var_name) {
axis_data[axis].linear_spring_stiffness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS, axis_data[axis].linear_spring_stiffness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS, axis_data[axis].linear_spring_stiffness);
} else if ("linear_spring_damping" == var_name) {
axis_data[axis].linear_spring_damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING, axis_data[axis].linear_spring_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING, axis_data[axis].linear_spring_damping);
} else if ("linear_equilibrium_point" == var_name) {
axis_data[axis].linear_equilibrium_point = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT, axis_data[axis].linear_equilibrium_point);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT, axis_data[axis].linear_equilibrium_point);
} else if ("linear_restitution" == var_name) {
axis_data[axis].linear_restitution = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION, axis_data[axis].linear_restitution);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION, axis_data[axis].linear_restitution);
} else if ("linear_damping" == var_name) {
axis_data[axis].linear_damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING, axis_data[axis].linear_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING, axis_data[axis].linear_damping);
} else if ("angular_limit_enabled" == var_name) {
axis_data[axis].angular_limit_enabled = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, axis_data[axis].angular_limit_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, axis_data[axis].angular_limit_enabled);
} else if ("angular_limit_upper" == var_name) {
axis_data[axis].angular_limit_upper = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, axis_data[axis].angular_limit_upper);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, axis_data[axis].angular_limit_upper);
} else if ("angular_limit_lower" == var_name) {
axis_data[axis].angular_limit_lower = Math::deg2rad(real_t(p_value));
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, axis_data[axis].angular_limit_lower);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, axis_data[axis].angular_limit_lower);
} else if ("angular_limit_softness" == var_name) {
axis_data[axis].angular_limit_softness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, axis_data[axis].angular_limit_softness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, axis_data[axis].angular_limit_softness);
} else if ("angular_restitution" == var_name) {
axis_data[axis].angular_restitution = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION, axis_data[axis].angular_restitution);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION, axis_data[axis].angular_restitution);
} else if ("angular_damping" == var_name) {
axis_data[axis].angular_damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING, axis_data[axis].angular_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING, axis_data[axis].angular_damping);
} else if ("erp" == var_name) {
axis_data[axis].erp = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_ERP, axis_data[axis].erp);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP, axis_data[axis].erp);
} else if ("angular_spring_enabled" == var_name) {
axis_data[axis].angular_spring_enabled = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING, axis_data[axis].angular_spring_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING, axis_data[axis].angular_spring_enabled);
} else if ("angular_spring_stiffness" == var_name) {
axis_data[axis].angular_spring_stiffness = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS, axis_data[axis].angular_spring_stiffness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS, axis_data[axis].angular_spring_stiffness);
} else if ("angular_spring_damping" == var_name) {
axis_data[axis].angular_spring_damping = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING, axis_data[axis].angular_spring_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING, axis_data[axis].angular_spring_damping);
} else if ("angular_equilibrium_point" == var_name) {
axis_data[axis].angular_equilibrium_point = p_value;
if (j.is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT, axis_data[axis].angular_equilibrium_point);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT, axis_data[axis].angular_equilibrium_point);
} else {
return false;
@@ -2080,7 +2080,7 @@ void PhysicalBone3D::_notification(int p_what) {
}
parent_skeleton = NULL;
if (joint.is_valid()) {
- PhysicsServer::get_singleton()->free(joint);
+ PhysicsServer3D::get_singleton()->free(joint);
joint = RID();
}
break;
@@ -2101,10 +2101,10 @@ void PhysicalBone3D::_direct_state_changed(Object *p_state) {
/// Update bone transform
- PhysicsDirectBodyState *state;
+ PhysicsDirectBodyState3D *state;
#ifdef DEBUG_ENABLED
- state = Object::cast_to<PhysicsDirectBodyState>(p_state);
+ state = Object::cast_to<PhysicsDirectBodyState3D>(p_state);
#else
state = (PhysicsDirectBodyState *)p_state; //trust it
#endif
@@ -2197,7 +2197,7 @@ void PhysicalBone3D::_fix_joint_offset() {
void PhysicalBone3D::_reload_joint() {
if (joint.is_valid()) {
- PhysicsServer::get_singleton()->free(joint);
+ PhysicsServer3D::get_singleton()->free(joint);
joint = RID();
}
@@ -2217,78 +2217,78 @@ void PhysicalBone3D::_reload_joint() {
switch (get_joint_type()) {
case JOINT_TYPE_PIN: {
- joint = PhysicsServer::get_singleton()->joint_create_pin(body_a->get_rid(), local_a.origin, get_rid(), joint_offset.origin);
+ joint = PhysicsServer3D::get_singleton()->joint_create_pin(body_a->get_rid(), local_a.origin, get_rid(), joint_offset.origin);
const PinJointData *pjd(static_cast<const PinJointData *>(joint_data));
- PhysicsServer::get_singleton()->pin_joint_set_param(joint, PhysicsServer::PIN_JOINT_BIAS, pjd->bias);
- PhysicsServer::get_singleton()->pin_joint_set_param(joint, PhysicsServer::PIN_JOINT_DAMPING, pjd->damping);
- PhysicsServer::get_singleton()->pin_joint_set_param(joint, PhysicsServer::PIN_JOINT_IMPULSE_CLAMP, pjd->impulse_clamp);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(joint, PhysicsServer3D::PIN_JOINT_BIAS, pjd->bias);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(joint, PhysicsServer3D::PIN_JOINT_DAMPING, pjd->damping);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(joint, PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP, pjd->impulse_clamp);
} break;
case JOINT_TYPE_CONE: {
- joint = PhysicsServer::get_singleton()->joint_create_cone_twist(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ joint = PhysicsServer3D::get_singleton()->joint_create_cone_twist(body_a->get_rid(), local_a, get_rid(), joint_offset);
const ConeJointData *cjd(static_cast<const ConeJointData *>(joint_data));
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN, cjd->swing_span);
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN, cjd->twist_span);
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_BIAS, cjd->bias);
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_SOFTNESS, cjd->softness);
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_RELAXATION, cjd->relaxation);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN, cjd->swing_span);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN, cjd->twist_span);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer3D::CONE_TWIST_JOINT_BIAS, cjd->bias);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS, cjd->softness);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION, cjd->relaxation);
} break;
case JOINT_TYPE_HINGE: {
- joint = PhysicsServer::get_singleton()->joint_create_hinge(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ joint = PhysicsServer3D::get_singleton()->joint_create_hinge(body_a->get_rid(), local_a, get_rid(), joint_offset);
const HingeJointData *hjd(static_cast<const HingeJointData *>(joint_data));
- PhysicsServer::get_singleton()->hinge_joint_set_flag(joint, PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT, hjd->angular_limit_enabled);
- PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_UPPER, hjd->angular_limit_upper);
- PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_LOWER, hjd->angular_limit_lower);
- PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_BIAS, hjd->angular_limit_bias);
- PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS, hjd->angular_limit_softness);
- PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION, hjd->angular_limit_relaxation);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_flag(joint, PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT, hjd->angular_limit_enabled);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(joint, PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER, hjd->angular_limit_upper);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(joint, PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER, hjd->angular_limit_lower);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(joint, PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS, hjd->angular_limit_bias);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(joint, PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS, hjd->angular_limit_softness);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(joint, PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION, hjd->angular_limit_relaxation);
} break;
case JOINT_TYPE_SLIDER: {
- joint = PhysicsServer::get_singleton()->joint_create_slider(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ joint = PhysicsServer3D::get_singleton()->joint_create_slider(body_a->get_rid(), local_a, get_rid(), joint_offset);
const SliderJointData *sjd(static_cast<const SliderJointData *>(joint_data));
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER, sjd->linear_limit_upper);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER, sjd->linear_limit_lower);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, sjd->linear_limit_softness);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, sjd->linear_limit_restitution);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, sjd->linear_limit_restitution);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, sjd->angular_limit_upper);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, sjd->angular_limit_lower);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, sjd->angular_limit_softness);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, sjd->angular_limit_softness);
- PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, sjd->angular_limit_damping);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER, sjd->linear_limit_upper);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER, sjd->linear_limit_lower);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, sjd->linear_limit_softness);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, sjd->linear_limit_restitution);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, sjd->linear_limit_restitution);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, sjd->angular_limit_upper);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, sjd->angular_limit_lower);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, sjd->angular_limit_softness);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, sjd->angular_limit_softness);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(joint, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, sjd->angular_limit_damping);
} break;
case JOINT_TYPE_6DOF: {
- joint = PhysicsServer::get_singleton()->joint_create_generic_6dof(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ joint = PhysicsServer3D::get_singleton()->joint_create_generic_6dof(body_a->get_rid(), local_a, get_rid(), joint_offset);
const SixDOFJointData *g6dofjd(static_cast<const SixDOFJointData *>(joint_data));
for (int axis = 0; axis < 3; ++axis) {
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, g6dofjd->axis_data[axis].linear_limit_enabled);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT, g6dofjd->axis_data[axis].linear_limit_upper);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT, g6dofjd->axis_data[axis].linear_limit_lower);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].linear_limit_softness);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING, g6dofjd->axis_data[axis].linear_spring_enabled);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].linear_spring_stiffness);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING, g6dofjd->axis_data[axis].linear_spring_damping);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].linear_equilibrium_point);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION, g6dofjd->axis_data[axis].linear_restitution);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING, g6dofjd->axis_data[axis].linear_damping);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, g6dofjd->axis_data[axis].angular_limit_enabled);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, g6dofjd->axis_data[axis].angular_limit_upper);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, g6dofjd->axis_data[axis].angular_limit_lower);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].angular_limit_softness);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION, g6dofjd->axis_data[axis].angular_restitution);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING, g6dofjd->axis_data[axis].angular_damping);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_ERP, g6dofjd->axis_data[axis].erp);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING, g6dofjd->axis_data[axis].angular_spring_enabled);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].angular_spring_stiffness);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING, g6dofjd->axis_data[axis].angular_spring_damping);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].angular_equilibrium_point);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, g6dofjd->axis_data[axis].linear_limit_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT, g6dofjd->axis_data[axis].linear_limit_upper);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT, g6dofjd->axis_data[axis].linear_limit_lower);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].linear_limit_softness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING, g6dofjd->axis_data[axis].linear_spring_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].linear_spring_stiffness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING, g6dofjd->axis_data[axis].linear_spring_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].linear_equilibrium_point);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION, g6dofjd->axis_data[axis].linear_restitution);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING, g6dofjd->axis_data[axis].linear_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, g6dofjd->axis_data[axis].angular_limit_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, g6dofjd->axis_data[axis].angular_limit_upper);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, g6dofjd->axis_data[axis].angular_limit_lower);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].angular_limit_softness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION, g6dofjd->axis_data[axis].angular_restitution);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING, g6dofjd->axis_data[axis].angular_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP, g6dofjd->axis_data[axis].erp);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING, g6dofjd->axis_data[axis].angular_spring_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].angular_spring_stiffness);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING, g6dofjd->axis_data[axis].angular_spring_damping);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].angular_equilibrium_point);
}
} break;
@@ -2441,7 +2441,7 @@ void PhysicalBone3D::set_mass(real_t p_mass) {
ERR_FAIL_COND(p_mass <= 0);
mass = p_mass;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_MASS, mass);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_MASS, mass);
}
real_t PhysicalBone3D::get_mass() const {
@@ -2464,7 +2464,7 @@ void PhysicalBone3D::set_friction(real_t p_friction) {
ERR_FAIL_COND(p_friction < 0 || p_friction > 1);
friction = p_friction;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, friction);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_FRICTION, friction);
}
real_t PhysicalBone3D::get_friction() const {
@@ -2477,7 +2477,7 @@ void PhysicalBone3D::set_bounce(real_t p_bounce) {
ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1);
bounce = p_bounce;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_BOUNCE, bounce);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_BOUNCE, bounce);
}
real_t PhysicalBone3D::get_bounce() const {
@@ -2488,7 +2488,7 @@ real_t PhysicalBone3D::get_bounce() const {
void PhysicalBone3D::set_gravity_scale(real_t p_gravity_scale) {
gravity_scale = p_gravity_scale;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
+ PhysicsServer3D::get_singleton()->body_set_param(get_rid(), PhysicsServer3D::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
}
real_t PhysicalBone3D::get_gravity_scale() const {
@@ -2497,7 +2497,7 @@ real_t PhysicalBone3D::get_gravity_scale() const {
}
PhysicalBone3D::PhysicalBone3D() :
- PhysicsBody3D(PhysicsServer::BODY_MODE_STATIC),
+ PhysicsBody3D(PhysicsServer3D::BODY_MODE_STATIC),
#ifdef TOOLS_ENABLED
gizmo_move_joint(false),
#endif
@@ -2566,10 +2566,10 @@ void PhysicalBone3D::_start_physics_simulation() {
return;
}
reset_to_rest_position();
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_RIGID);
- PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), get_collision_layer());
- PhysicsServer::get_singleton()->body_set_collision_mask(get_rid(), get_collision_mask());
- PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_RIGID);
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(get_rid(), get_collision_layer());
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(get_rid(), get_collision_mask());
+ PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
set_as_toplevel(true);
_internal_simulate_physics = true;
}
@@ -2579,16 +2579,16 @@ void PhysicalBone3D::_stop_physics_simulation() {
return;
}
if (parent_skeleton->get_animate_physical_bones()) {
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_KINEMATIC);
- PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), get_collision_layer());
- PhysicsServer::get_singleton()->body_set_collision_mask(get_rid(), get_collision_mask());
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_KINEMATIC);
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(get_rid(), get_collision_layer());
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(get_rid(), get_collision_mask());
} else {
- PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_STATIC);
- PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), 0);
- PhysicsServer::get_singleton()->body_set_collision_mask(get_rid(), 0);
+ PhysicsServer3D::get_singleton()->body_set_mode(get_rid(), PhysicsServer3D::BODY_MODE_STATIC);
+ PhysicsServer3D::get_singleton()->body_set_collision_layer(get_rid(), 0);
+ PhysicsServer3D::get_singleton()->body_set_collision_mask(get_rid(), 0);
}
if (_internal_simulate_physics) {
- PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, "");
+ PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, "");
parent_skeleton->set_bone_global_pose_override(bone_id, Transform(), 0.0, false);
set_as_toplevel(false);
_internal_simulate_physics = false;
diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h
index e7a403122b..ed7cfa8733 100644
--- a/scene/3d/physics_body_3d.h
+++ b/scene/3d/physics_body_3d.h
@@ -34,7 +34,7 @@
#include "core/vset.h"
#include "scene/3d/collision_object_3d.h"
#include "scene/resources/physics_material.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
#include "skeleton_3d.h"
class PhysicsBody3D : public CollisionObject3D {
@@ -49,7 +49,7 @@ class PhysicsBody3D : public CollisionObject3D {
protected:
static void _bind_methods();
- PhysicsBody3D(PhysicsServer::BodyMode p_mode);
+ PhysicsBody3D(PhysicsServer3D::BodyMode p_mode);
public:
virtual Vector3 get_linear_velocity() const;
@@ -118,7 +118,7 @@ public:
protected:
bool can_sleep;
- PhysicsDirectBodyState *state;
+ PhysicsDirectBodyState3D *state;
Mode mode;
real_t mass;
@@ -234,8 +234,8 @@ public:
void set_use_continuous_collision_detection(bool p_enable);
bool is_using_continuous_collision_detection() const;
- void set_axis_lock(PhysicsServer::BodyAxis p_axis, bool p_lock);
- bool get_axis_lock(PhysicsServer::BodyAxis p_axis) const;
+ void set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool p_lock);
+ bool get_axis_lock(PhysicsServer3D::BodyAxis p_axis) const;
Array get_colliding_bodies() const;
@@ -296,7 +296,7 @@ private:
Vector<Ref<KinematicCollision3D>> slide_colliders;
Ref<KinematicCollision3D> motion_cache;
- _FORCE_INLINE_ bool _ignores_mode(PhysicsServer::BodyMode) const;
+ _FORCE_INLINE_ bool _ignores_mode(PhysicsServer3D::BodyMode) const;
Ref<KinematicCollision3D> _move(const Vector3 &p_motion, bool p_infinite_inertia = true, bool p_exclude_raycast_shapes = true, bool p_test_only = false);
Ref<KinematicCollision3D> _get_slide_collision(int p_bounce);
@@ -316,8 +316,8 @@ public:
bool separate_raycast_shapes(bool p_infinite_inertia, Collision &r_collision);
- void set_axis_lock(PhysicsServer::BodyAxis p_axis, bool p_lock);
- bool get_axis_lock(PhysicsServer::BodyAxis p_axis) const;
+ void set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool p_lock);
+ bool get_axis_lock(PhysicsServer3D::BodyAxis p_axis) const;
void set_safe_margin(float p_margin);
float get_safe_margin() const;
@@ -381,7 +381,7 @@ public:
struct JointData {
virtual JointType get_joint_type() { return JOINT_TYPE_NONE; }
- /// "j" is used to set the parameter inside the PhysicsServer
+ /// "j" is used to set the parameter inside the PhysicsServer3D
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
diff --git a/scene/3d/physics_joint_3d.cpp b/scene/3d/physics_joint_3d.cpp
index dd7868cb38..f6b3e79300 100644
--- a/scene/3d/physics_joint_3d.cpp
+++ b/scene/3d/physics_joint_3d.cpp
@@ -34,9 +34,9 @@ void Joint3D::_update_joint(bool p_only_free) {
if (joint.is_valid()) {
if (ba.is_valid() && bb.is_valid())
- PhysicsServer::get_singleton()->body_remove_collision_exception(ba, bb);
+ PhysicsServer3D::get_singleton()->body_remove_collision_exception(ba, bb);
- PhysicsServer::get_singleton()->free(joint);
+ PhysicsServer3D::get_singleton()->free(joint);
joint = RID();
ba = RID();
bb = RID();
@@ -62,13 +62,13 @@ void Joint3D::_update_joint(bool p_only_free) {
if (!joint.is_valid())
return;
- PhysicsServer::get_singleton()->joint_set_solver_priority(joint, solver_priority);
+ PhysicsServer3D::get_singleton()->joint_set_solver_priority(joint, solver_priority);
ba = body_a->get_rid();
if (body_b)
bb = body_b->get_rid();
- PhysicsServer::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
+ PhysicsServer3D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
}
void Joint3D::set_node_a(const NodePath &p_node_a) {
@@ -101,7 +101,7 @@ void Joint3D::set_solver_priority(int p_priority) {
solver_priority = p_priority;
if (joint.is_valid())
- PhysicsServer::get_singleton()->joint_set_solver_priority(joint, solver_priority);
+ PhysicsServer3D::get_singleton()->joint_set_solver_priority(joint, solver_priority);
}
int Joint3D::get_solver_priority() const {
@@ -186,7 +186,7 @@ void PinJoint3D::set_param(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, 3);
params[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->pin_joint_set_param(get_joint(), PhysicsServer::PinJointParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(get_joint(), PhysicsServer3D::PinJointParam(p_param), p_value);
}
float PinJoint3D::get_param(Param p_param) const {
@@ -205,9 +205,9 @@ RID PinJoint3D::_configure_joint(PhysicsBody3D *body_a, PhysicsBody3D *body_b) {
else
local_b = pinpos;
- RID j = PhysicsServer::get_singleton()->joint_create_pin(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
+ RID j = PhysicsServer3D::get_singleton()->joint_create_pin(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
for (int i = 0; i < 3; i++) {
- PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PinJointParam(i), params[i]);
+ PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PinJointParam(i), params[i]);
}
return j;
}
@@ -290,7 +290,7 @@ void HingeJoint3D::set_param(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
params[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_param(get_joint(), PhysicsServer::HingeJointParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(get_joint(), PhysicsServer3D::HingeJointParam(p_param), p_value);
update_gizmo();
}
@@ -305,7 +305,7 @@ void HingeJoint3D::set_flag(Flag p_flag, bool p_value) {
ERR_FAIL_INDEX(p_flag, FLAG_MAX);
flags[p_flag] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->hinge_joint_set_flag(get_joint(), PhysicsServer::HingeJointFlag(p_flag), p_value);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_flag(get_joint(), PhysicsServer3D::HingeJointFlag(p_flag), p_value);
update_gizmo();
}
@@ -331,13 +331,13 @@ RID HingeJoint3D::_configure_joint(PhysicsBody3D *body_a, PhysicsBody3D *body_b)
local_b.orthonormalize();
- RID j = PhysicsServer::get_singleton()->joint_create_hinge(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
+ RID j = PhysicsServer3D::get_singleton()->joint_create_hinge(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
for (int i = 0; i < PARAM_MAX; i++) {
- PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HingeJointParam(i), params[i]);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HingeJointParam(i), params[i]);
}
for (int i = 0; i < FLAG_MAX; i++) {
set_flag(Flag(i), flags[i]);
- PhysicsServer::get_singleton()->hinge_joint_set_flag(j, PhysicsServer::HingeJointFlag(i), flags[i]);
+ PhysicsServer3D::get_singleton()->hinge_joint_set_flag(j, PhysicsServer3D::HingeJointFlag(i), flags[i]);
}
return j;
}
@@ -448,7 +448,7 @@ void SliderJoint3D::set_param(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
params[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->slider_joint_set_param(get_joint(), PhysicsServer::SliderJointParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(get_joint(), PhysicsServer3D::SliderJointParam(p_param), p_value);
update_gizmo();
}
float SliderJoint3D::get_param(Param p_param) const {
@@ -473,9 +473,9 @@ RID SliderJoint3D::_configure_joint(PhysicsBody3D *body_a, PhysicsBody3D *body_b
local_b.orthonormalize();
- RID j = PhysicsServer::get_singleton()->joint_create_slider(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
+ RID j = PhysicsServer3D::get_singleton()->joint_create_slider(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
for (int i = 0; i < PARAM_MAX; i++) {
- PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SliderJointParam(i), params[i]);
+ PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SliderJointParam(i), params[i]);
}
return j;
@@ -561,7 +561,7 @@ void ConeTwistJoint3D::set_param(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
params[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(get_joint(), PhysicsServer::ConeTwistJointParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(get_joint(), PhysicsServer3D::ConeTwistJointParam(p_param), p_value);
update_gizmo();
}
@@ -590,9 +590,9 @@ RID ConeTwistJoint3D::_configure_joint(PhysicsBody3D *body_a, PhysicsBody3D *bod
local_b.orthonormalize();
- RID j = PhysicsServer::get_singleton()->joint_create_cone_twist(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
+ RID j = PhysicsServer3D::get_singleton()->joint_create_cone_twist(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
for (int i = 0; i < PARAM_MAX; i++) {
- PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::ConeTwistJointParam(i), params[i]);
+ PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::ConeTwistJointParam(i), params[i]);
}
return j;
@@ -832,7 +832,7 @@ void Generic6DOFJoint3D::set_param_x(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
params_x[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_X, PhysicsServer::G6DOFJointAxisParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_X, PhysicsServer3D::G6DOFJointAxisParam(p_param), p_value);
update_gizmo();
}
@@ -847,7 +847,7 @@ void Generic6DOFJoint3D::set_param_y(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
params_y[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_Y, PhysicsServer::G6DOFJointAxisParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_Y, PhysicsServer3D::G6DOFJointAxisParam(p_param), p_value);
update_gizmo();
}
float Generic6DOFJoint3D::get_param_y(Param p_param) const {
@@ -861,7 +861,7 @@ void Generic6DOFJoint3D::set_param_z(Param p_param, float p_value) {
ERR_FAIL_INDEX(p_param, PARAM_MAX);
params_z[p_param] = p_value;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_Z, PhysicsServer::G6DOFJointAxisParam(p_param), p_value);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_Z, PhysicsServer3D::G6DOFJointAxisParam(p_param), p_value);
update_gizmo();
}
float Generic6DOFJoint3D::get_param_z(Param p_param) const {
@@ -875,7 +875,7 @@ void Generic6DOFJoint3D::set_flag_x(Flag p_flag, bool p_enabled) {
ERR_FAIL_INDEX(p_flag, FLAG_MAX);
flags_x[p_flag] = p_enabled;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_X, PhysicsServer::G6DOFJointAxisFlag(p_flag), p_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_X, PhysicsServer3D::G6DOFJointAxisFlag(p_flag), p_enabled);
update_gizmo();
}
bool Generic6DOFJoint3D::get_flag_x(Flag p_flag) const {
@@ -889,7 +889,7 @@ void Generic6DOFJoint3D::set_flag_y(Flag p_flag, bool p_enabled) {
ERR_FAIL_INDEX(p_flag, FLAG_MAX);
flags_y[p_flag] = p_enabled;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_Y, PhysicsServer::G6DOFJointAxisFlag(p_flag), p_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_Y, PhysicsServer3D::G6DOFJointAxisFlag(p_flag), p_enabled);
update_gizmo();
}
bool Generic6DOFJoint3D::get_flag_y(Flag p_flag) const {
@@ -903,7 +903,7 @@ void Generic6DOFJoint3D::set_flag_z(Flag p_flag, bool p_enabled) {
ERR_FAIL_INDEX(p_flag, FLAG_MAX);
flags_z[p_flag] = p_enabled;
if (get_joint().is_valid())
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_Z, PhysicsServer::G6DOFJointAxisFlag(p_flag), p_enabled);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_Z, PhysicsServer3D::G6DOFJointAxisFlag(p_flag), p_enabled);
update_gizmo();
}
bool Generic6DOFJoint3D::get_flag_z(Flag p_flag) const {
@@ -915,7 +915,7 @@ bool Generic6DOFJoint3D::get_flag_z(Flag p_flag) const {
void Generic6DOFJoint3D::set_precision(int p_precision) {
precision = p_precision;
- PhysicsServer::get_singleton()->generic_6dof_joint_set_precision(
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_precision(
get_joint(),
precision);
}
@@ -939,16 +939,16 @@ RID Generic6DOFJoint3D::_configure_joint(PhysicsBody3D *body_a, PhysicsBody3D *b
local_b.orthonormalize();
- RID j = PhysicsServer::get_singleton()->joint_create_generic_6dof(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
+ RID j = PhysicsServer3D::get_singleton()->joint_create_generic_6dof(body_a->get_rid(), local_a, body_b ? body_b->get_rid() : RID(), local_b);
for (int i = 0; i < PARAM_MAX; i++) {
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, Vector3::AXIS_X, PhysicsServer::G6DOFJointAxisParam(i), params_x[i]);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, Vector3::AXIS_Y, PhysicsServer::G6DOFJointAxisParam(i), params_y[i]);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, Vector3::AXIS_Z, PhysicsServer::G6DOFJointAxisParam(i), params_z[i]);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, Vector3::AXIS_X, PhysicsServer3D::G6DOFJointAxisParam(i), params_x[i]);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, Vector3::AXIS_Y, PhysicsServer3D::G6DOFJointAxisParam(i), params_y[i]);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(j, Vector3::AXIS_Z, PhysicsServer3D::G6DOFJointAxisParam(i), params_z[i]);
}
for (int i = 0; i < FLAG_MAX; i++) {
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, Vector3::AXIS_X, PhysicsServer::G6DOFJointAxisFlag(i), flags_x[i]);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, Vector3::AXIS_Y, PhysicsServer::G6DOFJointAxisFlag(i), flags_y[i]);
- PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, Vector3::AXIS_Z, PhysicsServer::G6DOFJointAxisFlag(i), flags_z[i]);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, Vector3::AXIS_X, PhysicsServer3D::G6DOFJointAxisFlag(i), flags_x[i]);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, Vector3::AXIS_Y, PhysicsServer3D::G6DOFJointAxisFlag(i), flags_y[i]);
+ PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(j, Vector3::AXIS_Z, PhysicsServer3D::G6DOFJointAxisFlag(i), flags_z[i]);
}
return j;
diff --git a/scene/3d/physics_joint_3d.h b/scene/3d/physics_joint_3d.h
index b7c131c666..ce0c7af5d1 100644
--- a/scene/3d/physics_joint_3d.h
+++ b/scene/3d/physics_joint_3d.h
@@ -82,9 +82,9 @@ class PinJoint3D : public Joint3D {
public:
enum Param {
- PARAM_BIAS = PhysicsServer::PIN_JOINT_BIAS,
- PARAM_DAMPING = PhysicsServer::PIN_JOINT_DAMPING,
- PARAM_IMPULSE_CLAMP = PhysicsServer::PIN_JOINT_IMPULSE_CLAMP
+ PARAM_BIAS = PhysicsServer3D::PIN_JOINT_BIAS,
+ PARAM_DAMPING = PhysicsServer3D::PIN_JOINT_DAMPING,
+ PARAM_IMPULSE_CLAMP = PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP
};
protected:
@@ -107,21 +107,21 @@ class HingeJoint3D : public Joint3D {
public:
enum Param {
- PARAM_BIAS = PhysicsServer::HINGE_JOINT_BIAS,
- PARAM_LIMIT_UPPER = PhysicsServer::HINGE_JOINT_LIMIT_UPPER,
- PARAM_LIMIT_LOWER = PhysicsServer::HINGE_JOINT_LIMIT_LOWER,
- PARAM_LIMIT_BIAS = PhysicsServer::HINGE_JOINT_LIMIT_BIAS,
- PARAM_LIMIT_SOFTNESS = PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS,
- PARAM_LIMIT_RELAXATION = PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION,
- PARAM_MOTOR_TARGET_VELOCITY = PhysicsServer::HINGE_JOINT_MOTOR_TARGET_VELOCITY,
- PARAM_MOTOR_MAX_IMPULSE = PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE,
- PARAM_MAX = PhysicsServer::HINGE_JOINT_MAX
+ PARAM_BIAS = PhysicsServer3D::HINGE_JOINT_BIAS,
+ PARAM_LIMIT_UPPER = PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER,
+ PARAM_LIMIT_LOWER = PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER,
+ PARAM_LIMIT_BIAS = PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS,
+ PARAM_LIMIT_SOFTNESS = PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS,
+ PARAM_LIMIT_RELAXATION = PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION,
+ PARAM_MOTOR_TARGET_VELOCITY = PhysicsServer3D::HINGE_JOINT_MOTOR_TARGET_VELOCITY,
+ PARAM_MOTOR_MAX_IMPULSE = PhysicsServer3D::HINGE_JOINT_MOTOR_MAX_IMPULSE,
+ PARAM_MAX = PhysicsServer3D::HINGE_JOINT_MAX
};
enum Flag {
- FLAG_USE_LIMIT = PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT,
- FLAG_ENABLE_MOTOR = PhysicsServer::HINGE_JOINT_FLAG_ENABLE_MOTOR,
- FLAG_MAX = PhysicsServer::HINGE_JOINT_FLAG_MAX
+ FLAG_USE_LIMIT = PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT,
+ FLAG_ENABLE_MOTOR = PhysicsServer3D::HINGE_JOINT_FLAG_ENABLE_MOTOR,
+ FLAG_MAX = PhysicsServer3D::HINGE_JOINT_FLAG_MAX
};
protected:
@@ -155,30 +155,30 @@ class SliderJoint3D : public Joint3D {
public:
enum Param {
- PARAM_LINEAR_LIMIT_UPPER = PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER,
- PARAM_LINEAR_LIMIT_LOWER = PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER,
- PARAM_LINEAR_LIMIT_SOFTNESS = PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS,
- PARAM_LINEAR_LIMIT_RESTITUTION = PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION,
- PARAM_LINEAR_LIMIT_DAMPING = PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING,
- PARAM_LINEAR_MOTION_SOFTNESS = PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS,
- PARAM_LINEAR_MOTION_RESTITUTION = PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION,
- PARAM_LINEAR_MOTION_DAMPING = PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_DAMPING,
- PARAM_LINEAR_ORTHOGONAL_SOFTNESS = PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS,
- PARAM_LINEAR_ORTHOGONAL_RESTITUTION = PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION,
- PARAM_LINEAR_ORTHOGONAL_DAMPING = PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING,
-
- PARAM_ANGULAR_LIMIT_UPPER = PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER,
- PARAM_ANGULAR_LIMIT_LOWER = PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER,
- PARAM_ANGULAR_LIMIT_SOFTNESS = PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS,
- PARAM_ANGULAR_LIMIT_RESTITUTION = PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION,
- PARAM_ANGULAR_LIMIT_DAMPING = PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING,
- PARAM_ANGULAR_MOTION_SOFTNESS = PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS,
- PARAM_ANGULAR_MOTION_RESTITUTION = PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION,
- PARAM_ANGULAR_MOTION_DAMPING = PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_DAMPING,
- PARAM_ANGULAR_ORTHOGONAL_SOFTNESS = PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS,
- PARAM_ANGULAR_ORTHOGONAL_RESTITUTION = PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION,
- PARAM_ANGULAR_ORTHOGONAL_DAMPING = PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING,
- PARAM_MAX = PhysicsServer::SLIDER_JOINT_MAX
+ PARAM_LINEAR_LIMIT_UPPER = PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER,
+ PARAM_LINEAR_LIMIT_LOWER = PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER,
+ PARAM_LINEAR_LIMIT_SOFTNESS = PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS,
+ PARAM_LINEAR_LIMIT_RESTITUTION = PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION,
+ PARAM_LINEAR_LIMIT_DAMPING = PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING,
+ PARAM_LINEAR_MOTION_SOFTNESS = PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS,
+ PARAM_LINEAR_MOTION_RESTITUTION = PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION,
+ PARAM_LINEAR_MOTION_DAMPING = PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_DAMPING,
+ PARAM_LINEAR_ORTHOGONAL_SOFTNESS = PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS,
+ PARAM_LINEAR_ORTHOGONAL_RESTITUTION = PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION,
+ PARAM_LINEAR_ORTHOGONAL_DAMPING = PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING,
+
+ PARAM_ANGULAR_LIMIT_UPPER = PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER,
+ PARAM_ANGULAR_LIMIT_LOWER = PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER,
+ PARAM_ANGULAR_LIMIT_SOFTNESS = PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS,
+ PARAM_ANGULAR_LIMIT_RESTITUTION = PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION,
+ PARAM_ANGULAR_LIMIT_DAMPING = PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING,
+ PARAM_ANGULAR_MOTION_SOFTNESS = PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS,
+ PARAM_ANGULAR_MOTION_RESTITUTION = PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION,
+ PARAM_ANGULAR_MOTION_DAMPING = PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_DAMPING,
+ PARAM_ANGULAR_ORTHOGONAL_SOFTNESS = PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS,
+ PARAM_ANGULAR_ORTHOGONAL_RESTITUTION = PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION,
+ PARAM_ANGULAR_ORTHOGONAL_DAMPING = PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING,
+ PARAM_MAX = PhysicsServer3D::SLIDER_JOINT_MAX
};
@@ -244,39 +244,39 @@ class Generic6DOFJoint3D : public Joint3D {
public:
enum Param {
- PARAM_LINEAR_LOWER_LIMIT = PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT,
- PARAM_LINEAR_UPPER_LIMIT = PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT,
- PARAM_LINEAR_LIMIT_SOFTNESS = PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS,
- PARAM_LINEAR_RESTITUTION = PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION,
- PARAM_LINEAR_DAMPING = PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING,
- PARAM_LINEAR_MOTOR_TARGET_VELOCITY = PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY,
- PARAM_LINEAR_MOTOR_FORCE_LIMIT = PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT,
- PARAM_LINEAR_SPRING_STIFFNESS = PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS,
- PARAM_LINEAR_SPRING_DAMPING = PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING,
- PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT = PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT,
- PARAM_ANGULAR_LOWER_LIMIT = PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT,
- PARAM_ANGULAR_UPPER_LIMIT = PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT,
- PARAM_ANGULAR_LIMIT_SOFTNESS = PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS,
- PARAM_ANGULAR_DAMPING = PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING,
- PARAM_ANGULAR_RESTITUTION = PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION,
- PARAM_ANGULAR_FORCE_LIMIT = PhysicsServer::G6DOF_JOINT_ANGULAR_FORCE_LIMIT,
- PARAM_ANGULAR_ERP = PhysicsServer::G6DOF_JOINT_ANGULAR_ERP,
- PARAM_ANGULAR_MOTOR_TARGET_VELOCITY = PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY,
- PARAM_ANGULAR_MOTOR_FORCE_LIMIT = PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT,
- PARAM_ANGULAR_SPRING_STIFFNESS = PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS,
- PARAM_ANGULAR_SPRING_DAMPING = PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING,
- PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT = PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT,
- PARAM_MAX = PhysicsServer::G6DOF_JOINT_MAX,
+ PARAM_LINEAR_LOWER_LIMIT = PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT,
+ PARAM_LINEAR_UPPER_LIMIT = PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT,
+ PARAM_LINEAR_LIMIT_SOFTNESS = PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS,
+ PARAM_LINEAR_RESTITUTION = PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION,
+ PARAM_LINEAR_DAMPING = PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING,
+ PARAM_LINEAR_MOTOR_TARGET_VELOCITY = PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY,
+ PARAM_LINEAR_MOTOR_FORCE_LIMIT = PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT,
+ PARAM_LINEAR_SPRING_STIFFNESS = PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS,
+ PARAM_LINEAR_SPRING_DAMPING = PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING,
+ PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT = PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT,
+ PARAM_ANGULAR_LOWER_LIMIT = PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT,
+ PARAM_ANGULAR_UPPER_LIMIT = PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT,
+ PARAM_ANGULAR_LIMIT_SOFTNESS = PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS,
+ PARAM_ANGULAR_DAMPING = PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING,
+ PARAM_ANGULAR_RESTITUTION = PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION,
+ PARAM_ANGULAR_FORCE_LIMIT = PhysicsServer3D::G6DOF_JOINT_ANGULAR_FORCE_LIMIT,
+ PARAM_ANGULAR_ERP = PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP,
+ PARAM_ANGULAR_MOTOR_TARGET_VELOCITY = PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY,
+ PARAM_ANGULAR_MOTOR_FORCE_LIMIT = PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT,
+ PARAM_ANGULAR_SPRING_STIFFNESS = PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS,
+ PARAM_ANGULAR_SPRING_DAMPING = PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING,
+ PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT = PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT,
+ PARAM_MAX = PhysicsServer3D::G6DOF_JOINT_MAX,
};
enum Flag {
- FLAG_ENABLE_LINEAR_LIMIT = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT,
- FLAG_ENABLE_ANGULAR_LIMIT = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
- FLAG_ENABLE_LINEAR_SPRING = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING,
- FLAG_ENABLE_ANGULAR_SPRING = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING,
- FLAG_ENABLE_MOTOR = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR,
- FLAG_ENABLE_LINEAR_MOTOR = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR,
- FLAG_MAX = PhysicsServer::G6DOF_JOINT_FLAG_MAX
+ FLAG_ENABLE_LINEAR_LIMIT = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT,
+ FLAG_ENABLE_ANGULAR_LIMIT = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
+ FLAG_ENABLE_LINEAR_SPRING = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING,
+ FLAG_ENABLE_ANGULAR_SPRING = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING,
+ FLAG_ENABLE_MOTOR = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR,
+ FLAG_ENABLE_LINEAR_MOTOR = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR,
+ FLAG_MAX = PhysicsServer3D::G6DOF_JOINT_FLAG_MAX
};
protected:
diff --git a/scene/3d/ray_cast_3d.cpp b/scene/3d/ray_cast_3d.cpp
index e22c44a3a2..d00af3b128 100644
--- a/scene/3d/ray_cast_3d.cpp
+++ b/scene/3d/ray_cast_3d.cpp
@@ -33,7 +33,7 @@
#include "collision_object_3d.h"
#include "core/engine.h"
#include "mesh_instance_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
void RayCast3D::set_cast_to(const Vector3 &p_point) {
@@ -199,7 +199,7 @@ void RayCast3D::_update_raycast_state() {
Ref<World3D> w3d = get_world();
ERR_FAIL_COND(w3d.is_null());
- PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(w3d->get_space());
+ PhysicsDirectSpaceState3D *dss = PhysicsServer3D::get_singleton()->space_get_direct_state(w3d->get_space());
ERR_FAIL_COND(!dss);
Transform gt = get_global_transform();
@@ -208,7 +208,7 @@ void RayCast3D::_update_raycast_state() {
if (to == Vector3())
to = Vector3(0, 0.01, 0);
- PhysicsDirectSpaceState::RayResult rr;
+ PhysicsDirectSpaceState3D::RayResult rr;
if (dss->intersect_ray(gt.get_origin(), gt.xform(to), rr, exclude, collision_mask, collide_with_bodies, collide_with_areas)) {
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index 3cf8e43ec2..24bf8b43d1 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -33,7 +33,7 @@
void ReflectionProbe::set_intensity(float p_intensity) {
intensity = p_intensity;
- VS::get_singleton()->reflection_probe_set_intensity(probe, p_intensity);
+ RS::get_singleton()->reflection_probe_set_intensity(probe, p_intensity);
}
float ReflectionProbe::get_intensity() const {
@@ -44,12 +44,12 @@ float ReflectionProbe::get_intensity() const {
void ReflectionProbe::set_interior_ambient(Color p_ambient) {
interior_ambient = p_ambient;
- VS::get_singleton()->reflection_probe_set_interior_ambient(probe, p_ambient);
+ RS::get_singleton()->reflection_probe_set_interior_ambient(probe, p_ambient);
}
void ReflectionProbe::set_interior_ambient_energy(float p_energy) {
interior_ambient_energy = p_energy;
- VS::get_singleton()->reflection_probe_set_interior_ambient_energy(probe, p_energy);
+ RS::get_singleton()->reflection_probe_set_interior_ambient_energy(probe, p_energy);
}
float ReflectionProbe::get_interior_ambient_energy() const {
@@ -64,7 +64,7 @@ Color ReflectionProbe::get_interior_ambient() const {
void ReflectionProbe::set_interior_ambient_probe_contribution(float p_contribution) {
interior_ambient_probe_contribution = p_contribution;
- VS::get_singleton()->reflection_probe_set_interior_ambient_probe_contribution(probe, p_contribution);
+ RS::get_singleton()->reflection_probe_set_interior_ambient_probe_contribution(probe, p_contribution);
}
float ReflectionProbe::get_interior_ambient_probe_contribution() const {
@@ -75,7 +75,7 @@ float ReflectionProbe::get_interior_ambient_probe_contribution() const {
void ReflectionProbe::set_max_distance(float p_distance) {
max_distance = p_distance;
- VS::get_singleton()->reflection_probe_set_max_distance(probe, p_distance);
+ RS::get_singleton()->reflection_probe_set_max_distance(probe, p_distance);
}
float ReflectionProbe::get_max_distance() const {
@@ -97,8 +97,8 @@ void ReflectionProbe::set_extents(const Vector3 &p_extents) {
}
}
- VS::get_singleton()->reflection_probe_set_extents(probe, extents);
- VS::get_singleton()->reflection_probe_set_origin_offset(probe, origin_offset);
+ RS::get_singleton()->reflection_probe_set_extents(probe, extents);
+ RS::get_singleton()->reflection_probe_set_origin_offset(probe, origin_offset);
_change_notify("extents");
update_gizmo();
}
@@ -117,8 +117,8 @@ void ReflectionProbe::set_origin_offset(const Vector3 &p_extents) {
origin_offset[i] = SGN(origin_offset[i]) * (extents[i] - 0.01);
}
}
- VS::get_singleton()->reflection_probe_set_extents(probe, extents);
- VS::get_singleton()->reflection_probe_set_origin_offset(probe, origin_offset);
+ RS::get_singleton()->reflection_probe_set_extents(probe, extents);
+ RS::get_singleton()->reflection_probe_set_origin_offset(probe, origin_offset);
_change_notify("origin_offset");
update_gizmo();
@@ -131,7 +131,7 @@ Vector3 ReflectionProbe::get_origin_offset() const {
void ReflectionProbe::set_enable_box_projection(bool p_enable) {
box_projection = p_enable;
- VS::get_singleton()->reflection_probe_set_enable_box_projection(probe, p_enable);
+ RS::get_singleton()->reflection_probe_set_enable_box_projection(probe, p_enable);
}
bool ReflectionProbe::is_box_projection_enabled() const {
@@ -141,7 +141,7 @@ bool ReflectionProbe::is_box_projection_enabled() const {
void ReflectionProbe::set_as_interior(bool p_enable) {
interior = p_enable;
- VS::get_singleton()->reflection_probe_set_as_interior(probe, interior);
+ RS::get_singleton()->reflection_probe_set_as_interior(probe, interior);
_change_notify();
}
@@ -153,7 +153,7 @@ bool ReflectionProbe::is_set_as_interior() const {
void ReflectionProbe::set_enable_shadows(bool p_enable) {
enable_shadows = p_enable;
- VS::get_singleton()->reflection_probe_set_enable_shadows(probe, p_enable);
+ RS::get_singleton()->reflection_probe_set_enable_shadows(probe, p_enable);
}
bool ReflectionProbe::are_shadows_enabled() const {
@@ -163,7 +163,7 @@ bool ReflectionProbe::are_shadows_enabled() const {
void ReflectionProbe::set_cull_mask(uint32_t p_layers) {
cull_mask = p_layers;
- VS::get_singleton()->reflection_probe_set_cull_mask(probe, p_layers);
+ RS::get_singleton()->reflection_probe_set_cull_mask(probe, p_layers);
}
uint32_t ReflectionProbe::get_cull_mask() const {
@@ -172,7 +172,7 @@ uint32_t ReflectionProbe::get_cull_mask() const {
void ReflectionProbe::set_update_mode(UpdateMode p_mode) {
update_mode = p_mode;
- VS::get_singleton()->reflection_probe_set_update_mode(probe, VS::ReflectionProbeUpdateMode(p_mode));
+ RS::get_singleton()->reflection_probe_set_update_mode(probe, RS::ReflectionProbeUpdateMode(p_mode));
}
ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const {
@@ -272,12 +272,12 @@ ReflectionProbe::ReflectionProbe() {
cull_mask = (1 << 20) - 1;
update_mode = UPDATE_ONCE;
- probe = VisualServer::get_singleton()->reflection_probe_create();
- VS::get_singleton()->instance_set_base(get_instance(), probe);
+ probe = RenderingServer::get_singleton()->reflection_probe_create();
+ RS::get_singleton()->instance_set_base(get_instance(), probe);
set_disable_scale(true);
}
ReflectionProbe::~ReflectionProbe() {
- VS::get_singleton()->free(probe);
+ RS::get_singleton()->free(probe);
}
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h
index 9cc0c3e8c7..3867d13435 100644
--- a/scene/3d/reflection_probe.h
+++ b/scene/3d/reflection_probe.h
@@ -34,7 +34,7 @@
#include "scene/3d/visual_instance_3d.h"
#include "scene/resources/sky.h"
#include "scene/resources/texture.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class ReflectionProbe : public VisualInstance3D {
GDCLASS(ReflectionProbe, VisualInstance3D);
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp
index 1ea6647d61..1b05641c9d 100644
--- a/scene/3d/skeleton_3d.cpp
+++ b/scene/3d/skeleton_3d.cpp
@@ -62,7 +62,7 @@ SkinReference::~SkinReference() {
skeleton_node->skin_bindings.erase(this);
}
- VS::get_singleton()->free(skeleton);
+ RS::get_singleton()->free(skeleton);
}
bool Skeleton3D::_set(const StringName &p_path, const Variant &p_value) {
@@ -227,7 +227,7 @@ void Skeleton3D::_notification(int p_what) {
case NOTIFICATION_UPDATE_SKELETON: {
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
Bone *bonesptr = bones.ptrw();
int len = bones.size();
@@ -320,7 +320,7 @@ void Skeleton3D::_notification(int p_what) {
uint32_t bind_count = skin->get_bind_count();
if (E->get()->bind_count != bind_count) {
- VS::get_singleton()->skeleton_allocate(skeleton, bind_count);
+ RS::get_singleton()->skeleton_allocate(skeleton, bind_count);
E->get()->bind_count = bind_count;
E->get()->skin_bone_indices.resize(bind_count);
E->get()->skin_bone_indices_ptrs = E->get()->skin_bone_indices.ptrw();
@@ -802,9 +802,9 @@ void _physical_bones_add_remove_collision_exception(bool p_add, Node *p_node, RI
CollisionObject3D *co = Object::cast_to<CollisionObject3D>(p_node);
if (co) {
if (p_add) {
- PhysicsServer::get_singleton()->body_add_collision_exception(co->get_rid(), p_exception);
+ PhysicsServer3D::get_singleton()->body_add_collision_exception(co->get_rid(), p_exception);
} else {
- PhysicsServer::get_singleton()->body_remove_collision_exception(co->get_rid(), p_exception);
+ PhysicsServer3D::get_singleton()->body_remove_collision_exception(co->get_rid(), p_exception);
}
}
}
@@ -871,7 +871,7 @@ Ref<SkinReference> Skeleton3D::register_skin(const Ref<Skin> &p_skin) {
skin_ref->skeleton_node = this;
skin_ref->bind_count = 0;
- skin_ref->skeleton = VisualServer::get_singleton()->skeleton_create();
+ skin_ref->skeleton = RenderingServer::get_singleton()->skeleton_create();
skin_ref->skeleton_node = this;
skin_ref->skin = skin;
diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp
index 6c93c3c1c7..ee9ce1dd71 100644
--- a/scene/3d/soft_body_3d.cpp
+++ b/scene/3d/soft_body_3d.cpp
@@ -36,11 +36,11 @@
#include "scene/3d/collision_object_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/skeleton_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
-SoftBodyVisualServerHandler::SoftBodyVisualServerHandler() {}
+SoftBodyRenderingServerHandler::SoftBodyRenderingServerHandler() {}
-void SoftBodyVisualServerHandler::prepare(RID p_mesh, int p_surface) {
+void SoftBodyRenderingServerHandler::prepare(RID p_mesh, int p_surface) {
clear();
ERR_FAIL_COND(!p_mesh.is_valid());
@@ -51,19 +51,19 @@ void SoftBodyVisualServerHandler::prepare(RID p_mesh, int p_surface) {
#warning Softbody is not working, needs to be redone considering that these functions no longer exist
#endif
#if 0
- const uint32_t surface_format = VS::get_singleton()->mesh_surface_get_format(mesh, surface);
- const int surface_vertex_len = VS::get_singleton()->mesh_surface_get_array_len(mesh, p_surface);
- const int surface_index_len = VS::get_singleton()->mesh_surface_get_array_index_len(mesh, p_surface);
- uint32_t surface_offsets[VS::ARRAY_MAX];
-
- buffer = VS::get_singleton()->mesh_surface_get_array(mesh, surface);
- stride = VS::get_singleton()->mesh_surface_make_offsets_from_format(surface_format, surface_vertex_len, surface_index_len, surface_offsets);
- offset_vertices = surface_offsets[VS::ARRAY_VERTEX];
- offset_normal = surface_offsets[VS::ARRAY_NORMAL];
+ const uint32_t surface_format = RS::get_singleton()->mesh_surface_get_format(mesh, surface);
+ const int surface_vertex_len = RS::get_singleton()->mesh_surface_get_array_len(mesh, p_surface);
+ const int surface_index_len = RS::get_singleton()->mesh_surface_get_array_index_len(mesh, p_surface);
+ uint32_t surface_offsets[RS::ARRAY_MAX];
+
+ buffer = RS::get_singleton()->mesh_surface_get_array(mesh, surface);
+ stride = RS::get_singleton()->mesh_surface_make_offsets_from_format(surface_format, surface_vertex_len, surface_index_len, surface_offsets);
+ offset_vertices = surface_offsets[RS::ARRAY_VERTEX];
+ offset_normal = surface_offsets[RS::ARRAY_NORMAL];
#endif
}
-void SoftBodyVisualServerHandler::clear() {
+void SoftBodyRenderingServerHandler::clear() {
if (mesh.is_valid()) {
buffer.resize(0);
@@ -72,28 +72,28 @@ void SoftBodyVisualServerHandler::clear() {
mesh = RID();
}
-void SoftBodyVisualServerHandler::open() {
+void SoftBodyRenderingServerHandler::open() {
write_buffer = buffer.ptrw();
}
-void SoftBodyVisualServerHandler::close() {
+void SoftBodyRenderingServerHandler::close() {
//write_buffer.release();
}
-void SoftBodyVisualServerHandler::commit_changes() {
- VS::get_singleton()->mesh_surface_update_region(mesh, surface, 0, buffer);
+void SoftBodyRenderingServerHandler::commit_changes() {
+ RS::get_singleton()->mesh_surface_update_region(mesh, surface, 0, buffer);
}
-void SoftBodyVisualServerHandler::set_vertex(int p_vertex_id, const void *p_vector3) {
+void SoftBodyRenderingServerHandler::set_vertex(int p_vertex_id, const void *p_vector3) {
copymem(&write_buffer[p_vertex_id * stride + offset_vertices], p_vector3, sizeof(float) * 3);
}
-void SoftBodyVisualServerHandler::set_normal(int p_vertex_id, const void *p_vector3) {
+void SoftBodyRenderingServerHandler::set_normal(int p_vertex_id, const void *p_vector3) {
copymem(&write_buffer[p_vertex_id * stride + offset_normal], p_vector3, sizeof(float) * 3);
}
-void SoftBodyVisualServerHandler::set_aabb(const AABB &p_aabb) {
- VS::get_singleton()->mesh_set_custom_aabb(mesh, p_aabb);
+void SoftBodyRenderingServerHandler::set_aabb(const AABB &p_aabb) {
+ RS::get_singleton()->mesh_set_custom_aabb(mesh, p_aabb);
}
SoftBody3D::PinnedPoint::PinnedPoint() :
@@ -120,7 +120,7 @@ void SoftBody3D::_update_pickable() {
if (!is_inside_tree())
return;
bool pickable = ray_pickable && is_visible_in_tree();
- PhysicsServer::get_singleton()->soft_body_set_ray_pickable(physics_rid, pickable);
+ PhysicsServer3D::get_singleton()->soft_body_set_ray_pickable(physics_rid, pickable);
}
bool SoftBody3D::_set(const StringName &p_name, const Variant &p_value) {
@@ -270,7 +270,7 @@ void SoftBody3D::_notification(int p_what) {
}
RID space = get_world()->get_space();
- PhysicsServer::get_singleton()->soft_body_set_space(physics_rid, space);
+ PhysicsServer3D::get_singleton()->soft_body_set_space(physics_rid, space);
prepare_physics_server();
} break;
case NOTIFICATION_READY: {
@@ -285,10 +285,10 @@ void SoftBody3D::_notification(int p_what) {
return;
}
- PhysicsServer::get_singleton()->soft_body_set_transform(physics_rid, get_global_transform());
+ PhysicsServer3D::get_singleton()->soft_body_set_transform(physics_rid, get_global_transform());
set_notify_transform(false);
- // Required to be top level with Transform at center of world in order to modify VisualServer only to support custom Transform
+ // Required to be top level with Transform at center of world in order to modify RenderingServer only to support custom Transform
set_as_toplevel(true);
set_transform(Transform());
set_notify_transform(true);
@@ -301,7 +301,7 @@ void SoftBody3D::_notification(int p_what) {
} break;
case NOTIFICATION_EXIT_WORLD: {
- PhysicsServer::get_singleton()->soft_body_set_space(physics_rid, RID());
+ PhysicsServer3D::get_singleton()->soft_body_set_space(physics_rid, RID());
} break;
}
@@ -418,7 +418,7 @@ void SoftBody3D::_update_physics_server() {
const PinnedPoint *r = pinned_points.ptr();
for (int i = 0; i < pinned_points_indices_size; ++i) {
if (r[i].spatial_attachment) {
- PhysicsServer::get_singleton()->soft_body_move_point(physics_rid, r[i].point_index, r[i].spatial_attachment->get_global_transform().xform(r[i].offset));
+ PhysicsServer3D::get_singleton()->soft_body_move_point(physics_rid, r[i].point_index, r[i].spatial_attachment->get_global_transform().xform(r[i].offset));
}
}
}
@@ -427,9 +427,9 @@ void SoftBody3D::_draw_soft_mesh() {
if (get_mesh().is_null())
return;
- if (!visual_server_handler.is_ready()) {
+ if (!rendering_server_handler.is_ready()) {
- visual_server_handler.prepare(get_mesh()->get_rid(), 0);
+ rendering_server_handler.prepare(get_mesh()->get_rid(), 0);
/// Necessary in order to render the mesh correctly (Soft body nodes are in global space)
simulation_started = true;
@@ -439,11 +439,11 @@ void SoftBody3D::_draw_soft_mesh() {
_update_physics_server();
- visual_server_handler.open();
- PhysicsServer::get_singleton()->soft_body_update_visual_server(physics_rid, &visual_server_handler);
- visual_server_handler.close();
+ rendering_server_handler.open();
+ PhysicsServer3D::get_singleton()->soft_body_update_rendering_server(physics_rid, &rendering_server_handler);
+ rendering_server_handler.close();
- visual_server_handler.commit_changes();
+ rendering_server_handler.commit_changes();
}
void SoftBody3D::prepare_physics_server() {
@@ -451,9 +451,9 @@ void SoftBody3D::prepare_physics_server() {
if (Engine::get_singleton()->is_editor_hint()) {
if (get_mesh().is_valid())
- PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh());
+ PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh());
else
- PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, NULL);
+ PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, NULL);
return;
}
@@ -461,13 +461,13 @@ void SoftBody3D::prepare_physics_server() {
if (get_mesh().is_valid()) {
become_mesh_owner();
- PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh());
- VS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh));
+ PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh());
+ RS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh));
} else {
- PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, NULL);
- if (VS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh))) {
- VS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh));
+ PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, NULL);
+ if (RS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh))) {
+ RS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh));
}
}
}
@@ -508,7 +508,7 @@ void SoftBody3D::become_mesh_owner() {
void SoftBody3D::set_collision_mask(uint32_t p_mask) {
collision_mask = p_mask;
- PhysicsServer::get_singleton()->soft_body_set_collision_mask(physics_rid, p_mask);
+ PhysicsServer3D::get_singleton()->soft_body_set_collision_mask(physics_rid, p_mask);
}
uint32_t SoftBody3D::get_collision_mask() const {
@@ -516,7 +516,7 @@ uint32_t SoftBody3D::get_collision_mask() const {
}
void SoftBody3D::set_collision_layer(uint32_t p_layer) {
collision_layer = p_layer;
- PhysicsServer::get_singleton()->soft_body_set_collision_layer(physics_rid, p_layer);
+ PhysicsServer3D::get_singleton()->soft_body_set_collision_layer(physics_rid, p_layer);
}
uint32_t SoftBody3D::get_collision_layer() const {
@@ -570,11 +570,11 @@ Vector<SoftBody3D::PinnedPoint> SoftBody3D::get_pinned_points_indices() {
Array SoftBody3D::get_collision_exceptions() {
List<RID> exceptions;
- PhysicsServer::get_singleton()->soft_body_get_collision_exceptions(physics_rid, &exceptions);
+ PhysicsServer3D::get_singleton()->soft_body_get_collision_exceptions(physics_rid, &exceptions);
Array ret;
for (List<RID>::Element *E = exceptions.front(); E; E = E->next()) {
RID body = E->get();
- ObjectID instance_id = PhysicsServer::get_singleton()->body_get_object_instance_id(body);
+ ObjectID instance_id = PhysicsServer3D::get_singleton()->body_get_object_instance_id(body);
Object *obj = ObjectDB::get_instance(instance_id);
PhysicsBody3D *physics_body = Object::cast_to<PhysicsBody3D>(obj);
ret.append(physics_body);
@@ -586,90 +586,90 @@ void SoftBody3D::add_collision_exception_with(Node *p_node) {
ERR_FAIL_NULL(p_node);
CollisionObject3D *collision_object = Object::cast_to<CollisionObject3D>(p_node);
ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject.");
- PhysicsServer::get_singleton()->soft_body_add_collision_exception(physics_rid, collision_object->get_rid());
+ PhysicsServer3D::get_singleton()->soft_body_add_collision_exception(physics_rid, collision_object->get_rid());
}
void SoftBody3D::remove_collision_exception_with(Node *p_node) {
ERR_FAIL_NULL(p_node);
CollisionObject3D *collision_object = Object::cast_to<CollisionObject3D>(p_node);
ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject.");
- PhysicsServer::get_singleton()->soft_body_remove_collision_exception(physics_rid, collision_object->get_rid());
+ PhysicsServer3D::get_singleton()->soft_body_remove_collision_exception(physics_rid, collision_object->get_rid());
}
int SoftBody3D::get_simulation_precision() {
- return PhysicsServer::get_singleton()->soft_body_get_simulation_precision(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_simulation_precision(physics_rid);
}
void SoftBody3D::set_simulation_precision(int p_simulation_precision) {
- PhysicsServer::get_singleton()->soft_body_set_simulation_precision(physics_rid, p_simulation_precision);
+ PhysicsServer3D::get_singleton()->soft_body_set_simulation_precision(physics_rid, p_simulation_precision);
}
real_t SoftBody3D::get_total_mass() {
- return PhysicsServer::get_singleton()->soft_body_get_total_mass(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_total_mass(physics_rid);
}
void SoftBody3D::set_total_mass(real_t p_total_mass) {
- PhysicsServer::get_singleton()->soft_body_set_total_mass(physics_rid, p_total_mass);
+ PhysicsServer3D::get_singleton()->soft_body_set_total_mass(physics_rid, p_total_mass);
}
void SoftBody3D::set_linear_stiffness(real_t p_linear_stiffness) {
- PhysicsServer::get_singleton()->soft_body_set_linear_stiffness(physics_rid, p_linear_stiffness);
+ PhysicsServer3D::get_singleton()->soft_body_set_linear_stiffness(physics_rid, p_linear_stiffness);
}
real_t SoftBody3D::get_linear_stiffness() {
- return PhysicsServer::get_singleton()->soft_body_get_linear_stiffness(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_linear_stiffness(physics_rid);
}
void SoftBody3D::set_areaAngular_stiffness(real_t p_areaAngular_stiffness) {
- PhysicsServer::get_singleton()->soft_body_set_areaAngular_stiffness(physics_rid, p_areaAngular_stiffness);
+ PhysicsServer3D::get_singleton()->soft_body_set_areaAngular_stiffness(physics_rid, p_areaAngular_stiffness);
}
real_t SoftBody3D::get_areaAngular_stiffness() {
- return PhysicsServer::get_singleton()->soft_body_get_areaAngular_stiffness(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_areaAngular_stiffness(physics_rid);
}
void SoftBody3D::set_volume_stiffness(real_t p_volume_stiffness) {
- PhysicsServer::get_singleton()->soft_body_set_volume_stiffness(physics_rid, p_volume_stiffness);
+ PhysicsServer3D::get_singleton()->soft_body_set_volume_stiffness(physics_rid, p_volume_stiffness);
}
real_t SoftBody3D::get_volume_stiffness() {
- return PhysicsServer::get_singleton()->soft_body_get_volume_stiffness(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_volume_stiffness(physics_rid);
}
real_t SoftBody3D::get_pressure_coefficient() {
- return PhysicsServer::get_singleton()->soft_body_get_pressure_coefficient(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_pressure_coefficient(physics_rid);
}
void SoftBody3D::set_pose_matching_coefficient(real_t p_pose_matching_coefficient) {
- PhysicsServer::get_singleton()->soft_body_set_pose_matching_coefficient(physics_rid, p_pose_matching_coefficient);
+ PhysicsServer3D::get_singleton()->soft_body_set_pose_matching_coefficient(physics_rid, p_pose_matching_coefficient);
}
real_t SoftBody3D::get_pose_matching_coefficient() {
- return PhysicsServer::get_singleton()->soft_body_get_pose_matching_coefficient(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_pose_matching_coefficient(physics_rid);
}
void SoftBody3D::set_pressure_coefficient(real_t p_pressure_coefficient) {
- PhysicsServer::get_singleton()->soft_body_set_pressure_coefficient(physics_rid, p_pressure_coefficient);
+ PhysicsServer3D::get_singleton()->soft_body_set_pressure_coefficient(physics_rid, p_pressure_coefficient);
}
real_t SoftBody3D::get_damping_coefficient() {
- return PhysicsServer::get_singleton()->soft_body_get_damping_coefficient(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_damping_coefficient(physics_rid);
}
void SoftBody3D::set_damping_coefficient(real_t p_damping_coefficient) {
- PhysicsServer::get_singleton()->soft_body_set_damping_coefficient(physics_rid, p_damping_coefficient);
+ PhysicsServer3D::get_singleton()->soft_body_set_damping_coefficient(physics_rid, p_damping_coefficient);
}
real_t SoftBody3D::get_drag_coefficient() {
- return PhysicsServer::get_singleton()->soft_body_get_drag_coefficient(physics_rid);
+ return PhysicsServer3D::get_singleton()->soft_body_get_drag_coefficient(physics_rid);
}
void SoftBody3D::set_drag_coefficient(real_t p_drag_coefficient) {
- PhysicsServer::get_singleton()->soft_body_set_drag_coefficient(physics_rid, p_drag_coefficient);
+ PhysicsServer3D::get_singleton()->soft_body_set_drag_coefficient(physics_rid, p_drag_coefficient);
}
Vector3 SoftBody3D::get_point_transform(int p_point_index) {
- return PhysicsServer::get_singleton()->soft_body_get_point_global_position(physics_rid, p_point_index);
+ return PhysicsServer3D::get_singleton()->soft_body_get_point_global_position(physics_rid, p_point_index);
}
void SoftBody3D::pin_point_toggle(int p_point_index) {
@@ -701,7 +701,7 @@ bool SoftBody3D::is_ray_pickable() const {
}
SoftBody3D::SoftBody3D() :
- physics_rid(PhysicsServer::get_singleton()->soft_body_create()),
+ physics_rid(PhysicsServer3D::get_singleton()->soft_body_create()),
mesh_owner(false),
collision_mask(1),
collision_layer(1),
@@ -709,18 +709,18 @@ SoftBody3D::SoftBody3D() :
pinned_points_cache_dirty(true),
ray_pickable(true) {
- PhysicsServer::get_singleton()->body_attach_object_instance_id(physics_rid, get_instance_id());
+ PhysicsServer3D::get_singleton()->body_attach_object_instance_id(physics_rid, get_instance_id());
}
SoftBody3D::~SoftBody3D() {
- PhysicsServer::get_singleton()->free(physics_rid);
+ PhysicsServer3D::get_singleton()->free(physics_rid);
}
void SoftBody3D::reset_softbody_pin() {
- PhysicsServer::get_singleton()->soft_body_remove_all_pinned_points(physics_rid);
+ PhysicsServer3D::get_singleton()->soft_body_remove_all_pinned_points(physics_rid);
const PinnedPoint *pps = pinned_points.ptr();
for (int i = pinned_points.size() - 1; 0 < i; --i) {
- PhysicsServer::get_singleton()->soft_body_pin_point(physics_rid, pps[i].point_index, true);
+ PhysicsServer3D::get_singleton()->soft_body_pin_point(physics_rid, pps[i].point_index, true);
}
}
@@ -747,7 +747,7 @@ void SoftBody3D::_update_cache_pin_points_datas() {
}
void SoftBody3D::_pin_point_on_physics_server(int p_point_index, bool pin) {
- PhysicsServer::get_singleton()->soft_body_pin_point(physics_rid, p_point_index, pin);
+ PhysicsServer3D::get_singleton()->soft_body_pin_point(physics_rid, p_point_index, pin);
}
void SoftBody3D::_add_pinned_point(int p_point_index, const NodePath &p_spatial_attachment_path) {
@@ -761,7 +761,7 @@ void SoftBody3D::_add_pinned_point(int p_point_index, const NodePath &p_spatial_
if (!p_spatial_attachment_path.is_empty() && has_node(p_spatial_attachment_path)) {
pp.spatial_attachment = Object::cast_to<Node3D>(get_node(p_spatial_attachment_path));
- pp.offset = (pp.spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer::get_singleton()->soft_body_get_point_global_position(physics_rid, pp.point_index));
+ pp.offset = (pp.spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer3D::get_singleton()->soft_body_get_point_global_position(physics_rid, pp.point_index));
}
pinned_points.push_back(pp);
@@ -773,7 +773,7 @@ void SoftBody3D::_add_pinned_point(int p_point_index, const NodePath &p_spatial_
if (!p_spatial_attachment_path.is_empty() && has_node(p_spatial_attachment_path)) {
pinned_point->spatial_attachment = Object::cast_to<Node3D>(get_node(p_spatial_attachment_path));
- pinned_point->offset = (pinned_point->spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer::get_singleton()->soft_body_get_point_global_position(physics_rid, pinned_point->point_index));
+ pinned_point->offset = (pinned_point->spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer3D::get_singleton()->soft_body_get_point_global_position(physics_rid, pinned_point->point_index));
}
}
}
@@ -793,7 +793,7 @@ void SoftBody3D::_reset_points_offsets() {
if (!r[i].spatial_attachment)
continue;
- w[i].offset = (r[i].spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer::get_singleton()->soft_body_get_point_global_position(physics_rid, r[i].point_index));
+ w[i].offset = (r[i].spatial_attachment->get_global_transform().affine_inverse() * get_global_transform()).xform(PhysicsServer3D::get_singleton()->soft_body_get_point_global_position(physics_rid, r[i].point_index));
}
}
diff --git a/scene/3d/soft_body_3d.h b/scene/3d/soft_body_3d.h
index a1a4b4fa2f..7dd5880985 100644
--- a/scene/3d/soft_body_3d.h
+++ b/scene/3d/soft_body_3d.h
@@ -35,7 +35,7 @@
class SoftBody3D;
-class SoftBodyVisualServerHandler {
+class SoftBodyRenderingServerHandler {
friend class SoftBody3D;
@@ -49,7 +49,7 @@ class SoftBodyVisualServerHandler {
uint8_t *write_buffer;
private:
- SoftBodyVisualServerHandler();
+ SoftBodyRenderingServerHandler();
bool is_ready() { return mesh.is_valid(); }
void prepare(RID p_mesh_rid, int p_surface);
void clear();
@@ -79,7 +79,7 @@ public:
};
private:
- SoftBodyVisualServerHandler visual_server_handler;
+ SoftBodyRenderingServerHandler rendering_server_handler;
RID physics_rid;
diff --git a/scene/3d/spring_arm_3d.cpp b/scene/3d/spring_arm_3d.cpp
index 1856171539..281be3f7d3 100644
--- a/scene/3d/spring_arm_3d.cpp
+++ b/scene/3d/spring_arm_3d.cpp
@@ -32,7 +32,7 @@
#include "core/engine.h"
#include "scene/3d/collision_object_3d.h"
#include "scene/resources/sphere_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
SpringArm3D::SpringArm3D() :
spring_length(1),
@@ -146,7 +146,7 @@ void SpringArm3D::process_spring() {
if (shape.is_null()) {
motion = Vector3(cast_direction * (spring_length));
- PhysicsDirectSpaceState::RayResult r;
+ PhysicsDirectSpaceState3D::RayResult r;
bool intersected = get_world()->get_direct_space_state()->intersect_ray(get_global_transform().origin, get_global_transform().origin + motion, r, excluded_objects, mask);
if (intersected) {
float dist = get_global_transform().origin.distance_to(r.position);
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index fd22076091..360e95e76a 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -377,13 +377,13 @@ SpriteBase3D::SpriteBase3D() {
modulate = Color(1, 1, 1, 1);
pending_update = false;
opacity = 1.0;
- immediate = VisualServer::get_singleton()->immediate_create();
+ immediate = RenderingServer::get_singleton()->immediate_create();
set_base(immediate);
}
SpriteBase3D::~SpriteBase3D() {
- VisualServer::get_singleton()->free(immediate);
+ RenderingServer::get_singleton()->free(immediate);
}
///////////////////////////////////////////
@@ -392,7 +392,7 @@ void Sprite3D::_draw() {
RID immediate = get_immediate();
- VS::get_singleton()->immediate_clear(immediate);
+ RS::get_singleton()->immediate_clear(immediate);
if (!texture.is_valid())
return;
Vector2 tsize = texture->get_size();
@@ -475,9 +475,9 @@ void Sprite3D::_draw() {
}
RID mat = StandardMaterial3D::get_material_rid_for_2d(get_draw_flag(FLAG_SHADED), get_draw_flag(FLAG_TRANSPARENT), get_draw_flag(FLAG_DOUBLE_SIDED), get_alpha_cut_mode() == ALPHA_CUT_DISCARD, get_alpha_cut_mode() == ALPHA_CUT_OPAQUE_PREPASS, get_billboard_mode() == StandardMaterial3D::BILLBOARD_ENABLED, get_billboard_mode() == StandardMaterial3D::BILLBOARD_FIXED_Y);
- VS::get_singleton()->immediate_set_material(immediate, mat);
+ RS::get_singleton()->immediate_set_material(immediate, mat);
- VS::get_singleton()->immediate_begin(immediate, VS::PRIMITIVE_TRIANGLES, texture->get_rid());
+ RS::get_singleton()->immediate_begin(immediate, RS::PRIMITIVE_TRIANGLES, texture->get_rid());
int x_axis = ((axis + 1) % 3);
int y_axis = ((axis + 2) % 3);
@@ -502,15 +502,15 @@ void Sprite3D::_draw() {
static const int index[6] = { 0, 1, 2, 0, 2, 3 };
- VS::get_singleton()->immediate_normal(immediate, normal);
- VS::get_singleton()->immediate_tangent(immediate, tangent);
- VS::get_singleton()->immediate_color(immediate, color);
- VS::get_singleton()->immediate_uv(immediate, uvs[i]);
+ RS::get_singleton()->immediate_normal(immediate, normal);
+ RS::get_singleton()->immediate_tangent(immediate, tangent);
+ RS::get_singleton()->immediate_color(immediate, color);
+ RS::get_singleton()->immediate_uv(immediate, uvs[i]);
Vector3 vtx;
vtx[x_axis] = vertices[index[i]][0];
vtx[y_axis] = vertices[index[i]][1];
- VS::get_singleton()->immediate_vertex(immediate, vtx);
+ RS::get_singleton()->immediate_vertex(immediate, vtx);
if (i == 0) {
aabb.position = vtx;
aabb.size = Vector3();
@@ -519,7 +519,7 @@ void Sprite3D::_draw() {
}
}
set_aabb(aabb);
- VS::get_singleton()->immediate_end(immediate);
+ RS::get_singleton()->immediate_end(immediate);
}
void Sprite3D::_texture_changed() {
@@ -717,7 +717,7 @@ Sprite3D::Sprite3D() {
void AnimatedSprite3D::_draw() {
RID immediate = get_immediate();
- VS::get_singleton()->immediate_clear(immediate);
+ RS::get_singleton()->immediate_clear(immediate);
if (frames.is_null()) {
return;
@@ -810,9 +810,9 @@ void AnimatedSprite3D::_draw() {
RID mat = StandardMaterial3D::get_material_rid_for_2d(get_draw_flag(FLAG_SHADED), get_draw_flag(FLAG_TRANSPARENT), get_draw_flag(FLAG_DOUBLE_SIDED), get_alpha_cut_mode() == ALPHA_CUT_DISCARD, get_alpha_cut_mode() == ALPHA_CUT_OPAQUE_PREPASS, get_billboard_mode() == StandardMaterial3D::BILLBOARD_ENABLED, get_billboard_mode() == StandardMaterial3D::BILLBOARD_FIXED_Y);
- VS::get_singleton()->immediate_set_material(immediate, mat);
+ RS::get_singleton()->immediate_set_material(immediate, mat);
- VS::get_singleton()->immediate_begin(immediate, VS::PRIMITIVE_TRIANGLES, texture->get_rid());
+ RS::get_singleton()->immediate_begin(immediate, RS::PRIMITIVE_TRIANGLES, texture->get_rid());
int x_axis = ((axis + 1) % 3);
int y_axis = ((axis + 2) % 3);
@@ -840,15 +840,15 @@ void AnimatedSprite3D::_draw() {
0, 2, 3
};
- VS::get_singleton()->immediate_normal(immediate, normal);
- VS::get_singleton()->immediate_tangent(immediate, tangent);
- VS::get_singleton()->immediate_color(immediate, color);
- VS::get_singleton()->immediate_uv(immediate, uvs[i]);
+ RS::get_singleton()->immediate_normal(immediate, normal);
+ RS::get_singleton()->immediate_tangent(immediate, tangent);
+ RS::get_singleton()->immediate_color(immediate, color);
+ RS::get_singleton()->immediate_uv(immediate, uvs[i]);
Vector3 vtx;
vtx[x_axis] = vertices[indices[i]][0];
vtx[y_axis] = vertices[indices[i]][1];
- VS::get_singleton()->immediate_vertex(immediate, vtx);
+ RS::get_singleton()->immediate_vertex(immediate, vtx);
if (i == 0) {
aabb.position = vtx;
aabb.size = Vector3();
@@ -857,7 +857,7 @@ void AnimatedSprite3D::_draw() {
}
}
set_aabb(aabb);
- VS::get_singleton()->immediate_end(immediate);
+ RS::get_singleton()->immediate_end(immediate);
}
void AnimatedSprite3D::_validate_property(PropertyInfo &property) const {
diff --git a/scene/3d/vehicle_body_3d.cpp b/scene/3d/vehicle_body_3d.cpp
index 5d601b0d43..5984b776b2 100644
--- a/scene/3d/vehicle_body_3d.cpp
+++ b/scene/3d/vehicle_body_3d.cpp
@@ -111,7 +111,7 @@ String VehicleWheel3D::get_configuration_warning() const {
return String();
}
-void VehicleWheel3D::_update(PhysicsDirectBodyState *s) {
+void VehicleWheel3D::_update(PhysicsDirectBodyState3D *s) {
if (m_raycastInfo.m_isInContact)
@@ -388,7 +388,7 @@ VehicleWheel3D::VehicleWheel3D() {
body = NULL;
}
-void VehicleBody3D::_update_wheel_transform(VehicleWheel3D &wheel, PhysicsDirectBodyState *s) {
+void VehicleBody3D::_update_wheel_transform(VehicleWheel3D &wheel, PhysicsDirectBodyState3D *s) {
wheel.m_raycastInfo.m_isInContact = false;
@@ -405,7 +405,7 @@ void VehicleBody3D::_update_wheel_transform(VehicleWheel3D &wheel, PhysicsDirect
wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.get_basis().xform(wheel.m_wheelAxleCS).normalized();
}
-void VehicleBody3D::_update_wheel(int p_idx, PhysicsDirectBodyState *s) {
+void VehicleBody3D::_update_wheel(int p_idx, PhysicsDirectBodyState3D *s) {
VehicleWheel3D &wheel = *wheels[p_idx];
_update_wheel_transform(wheel, s);
@@ -430,7 +430,7 @@ void VehicleBody3D::_update_wheel(int p_idx, PhysicsDirectBodyState *s) {
wheel.m_raycastInfo.m_hardPointWS + wheel.m_raycastInfo.m_wheelDirectionWS * wheel.m_raycastInfo.m_suspensionLength);
}
-real_t VehicleBody3D::_ray_cast(int p_idx, PhysicsDirectBodyState *s) {
+real_t VehicleBody3D::_ray_cast(int p_idx, PhysicsDirectBodyState3D *s) {
VehicleWheel3D &wheel = *wheels[p_idx];
@@ -448,9 +448,9 @@ real_t VehicleBody3D::_ray_cast(int p_idx, PhysicsDirectBodyState *s) {
real_t param = real_t(0.);
- PhysicsDirectSpaceState::RayResult rr;
+ PhysicsDirectSpaceState3D::RayResult rr;
- PhysicsDirectSpaceState *ss = s->get_space_state();
+ PhysicsDirectSpaceState3D *ss = s->get_space_state();
bool col = ss->intersect_ray(source, target, rr, exclude);
@@ -513,7 +513,7 @@ real_t VehicleBody3D::_ray_cast(int p_idx, PhysicsDirectBodyState *s) {
return depth;
}
-void VehicleBody3D::_update_suspension(PhysicsDirectBodyState *s) {
+void VehicleBody3D::_update_suspension(PhysicsDirectBodyState3D *s) {
real_t chassisMass = mass;
@@ -558,7 +558,7 @@ void VehicleBody3D::_update_suspension(PhysicsDirectBodyState *s) {
}
//bilateral constraint between two dynamic objects
-void VehicleBody3D::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vector3 &pos1,
+void VehicleBody3D::_resolve_single_bilateral(PhysicsDirectBodyState3D *s, const Vector3 &pos1,
PhysicsBody3D *body2, const Vector3 &pos2, const Vector3 &normal, real_t &impulse, const real_t p_rollInfluence) {
real_t normalLenSqr = normal.length_squared();
@@ -636,7 +636,7 @@ void VehicleBody3D::_resolve_single_bilateral(PhysicsDirectBodyState *s, const V
#endif
}
-VehicleBody3D::btVehicleWheelContactPoint::btVehicleWheelContactPoint(PhysicsDirectBodyState *s, PhysicsBody3D *body1, const Vector3 &frictionPosWorld, const Vector3 &frictionDirectionWorld, real_t maxImpulse) :
+VehicleBody3D::btVehicleWheelContactPoint::btVehicleWheelContactPoint(PhysicsDirectBodyState3D *s, PhysicsBody3D *body1, const Vector3 &frictionPosWorld, const Vector3 &frictionDirectionWorld, real_t maxImpulse) :
m_s(s),
m_body1(body1),
m_frictionPositionWorld(frictionPosWorld),
@@ -698,7 +698,7 @@ real_t VehicleBody3D::_calc_rolling_friction(btVehicleWheelContactPoint &contact
}
static const real_t sideFrictionStiffness2 = real_t(1.0);
-void VehicleBody3D::_update_friction(PhysicsDirectBodyState *s) {
+void VehicleBody3D::_update_friction(PhysicsDirectBodyState3D *s) {
//calculate the impulse, so that the wheels don't move sidewards
int numWheel = wheels.size();
@@ -854,7 +854,7 @@ void VehicleBody3D::_direct_state_changed(Object *p_state) {
RigidBody3D::_direct_state_changed(p_state);
- state = Object::cast_to<PhysicsDirectBodyState>(p_state);
+ state = Object::cast_to<PhysicsDirectBodyState3D>(p_state);
float step = state->get_step();
@@ -992,7 +992,7 @@ VehicleBody3D::VehicleBody3D() {
ccd = false;
exclude.insert(get_rid());
- //PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ //PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
set_mass(40);
}
diff --git a/scene/3d/vehicle_body_3d.h b/scene/3d/vehicle_body_3d.h
index 1ca9b6253f..d5e896263d 100644
--- a/scene/3d/vehicle_body_3d.h
+++ b/scene/3d/vehicle_body_3d.h
@@ -91,7 +91,7 @@ class VehicleWheel3D : public Node3D {
PhysicsBody3D *m_groundObject; //could be general void* ptr
} m_raycastInfo;
- void _update(PhysicsDirectBodyState *s);
+ void _update(PhysicsDirectBodyState3D *s);
protected:
void _notification(int p_what);
@@ -170,24 +170,24 @@ class VehicleBody3D : public RigidBody3D {
Vector<real_t> m_sideImpulse;
struct btVehicleWheelContactPoint {
- PhysicsDirectBodyState *m_s;
+ PhysicsDirectBodyState3D *m_s;
PhysicsBody3D *m_body1;
Vector3 m_frictionPositionWorld;
Vector3 m_frictionDirectionWorld;
real_t m_jacDiagABInv;
real_t m_maxImpulse;
- btVehicleWheelContactPoint(PhysicsDirectBodyState *s, PhysicsBody3D *body1, const Vector3 &frictionPosWorld, const Vector3 &frictionDirectionWorld, real_t maxImpulse);
+ btVehicleWheelContactPoint(PhysicsDirectBodyState3D *s, PhysicsBody3D *body1, const Vector3 &frictionPosWorld, const Vector3 &frictionDirectionWorld, real_t maxImpulse);
};
- void _resolve_single_bilateral(PhysicsDirectBodyState *s, const Vector3 &pos1, PhysicsBody3D *body2, const Vector3 &pos2, const Vector3 &normal, real_t &impulse, const real_t p_rollInfluence);
+ void _resolve_single_bilateral(PhysicsDirectBodyState3D *s, const Vector3 &pos1, PhysicsBody3D *body2, const Vector3 &pos2, const Vector3 &normal, real_t &impulse, const real_t p_rollInfluence);
real_t _calc_rolling_friction(btVehicleWheelContactPoint &contactPoint);
- void _update_friction(PhysicsDirectBodyState *s);
- void _update_suspension(PhysicsDirectBodyState *s);
- real_t _ray_cast(int p_idx, PhysicsDirectBodyState *s);
- void _update_wheel_transform(VehicleWheel3D &wheel, PhysicsDirectBodyState *s);
- void _update_wheel(int p_idx, PhysicsDirectBodyState *s);
+ void _update_friction(PhysicsDirectBodyState3D *s);
+ void _update_suspension(PhysicsDirectBodyState3D *s);
+ real_t _ray_cast(int p_idx, PhysicsDirectBodyState3D *s);
+ void _update_wheel_transform(VehicleWheel3D &wheel, PhysicsDirectBodyState3D *s);
+ void _update_wheel(int p_idx, PhysicsDirectBodyState3D *s);
friend class VehicleWheel3D;
Vector<VehicleWheel3D *> wheels;
diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp
index 14a975c023..775a9b76e2 100644
--- a/scene/3d/visual_instance_3d.cpp
+++ b/scene/3d/visual_instance_3d.cpp
@@ -31,7 +31,7 @@
#include "visual_instance_3d.h"
#include "scene/scene_string_names.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#include "skeleton_3d.h"
AABB VisualInstance3D::get_transformed_aabb() const {
@@ -45,7 +45,7 @@ void VisualInstance3D::_update_visibility() {
return;
_change_notify("visible");
- VS::get_singleton()->instance_set_visible(get_instance(), is_visible_in_tree());
+ RS::get_singleton()->instance_set_visible(get_instance(), is_visible_in_tree());
}
void VisualInstance3D::_notification(int p_what) {
@@ -58,23 +58,23 @@ void VisualInstance3D::_notification(int p_what) {
/*
Skeleton *skeleton=Object::cast_to<Skeleton>(get_parent());
if (skeleton)
- VisualServer::get_singleton()->instance_attach_skeleton( instance, skeleton->get_skeleton() );
+ RenderingServer::get_singleton()->instance_attach_skeleton( instance, skeleton->get_skeleton() );
*/
ERR_FAIL_COND(get_world().is_null());
- VisualServer::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario());
+ RenderingServer::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario());
_update_visibility();
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
Transform gt = get_global_transform();
- VisualServer::get_singleton()->instance_set_transform(instance, gt);
+ RenderingServer::get_singleton()->instance_set_transform(instance, gt);
} break;
case NOTIFICATION_EXIT_WORLD: {
- VisualServer::get_singleton()->instance_set_scenario(instance, RID());
- VisualServer::get_singleton()->instance_attach_skeleton(instance, RID());
- //VS::get_singleton()->instance_geometry_set_baked_light_sampler(instance, RID() );
+ RenderingServer::get_singleton()->instance_set_scenario(instance, RID());
+ RenderingServer::get_singleton()->instance_attach_skeleton(instance, RID());
+ //RS::get_singleton()->instance_geometry_set_baked_light_sampler(instance, RID() );
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@@ -97,7 +97,7 @@ RID VisualInstance3D::_get_visual_instance_rid() const {
void VisualInstance3D::set_layer_mask(uint32_t p_mask) {
layers = p_mask;
- VisualServer::get_singleton()->instance_set_layer_mask(instance, p_mask);
+ RenderingServer::get_singleton()->instance_set_layer_mask(instance, p_mask);
}
uint32_t VisualInstance3D::get_layer_mask() const {
@@ -137,7 +137,7 @@ void VisualInstance3D::_bind_methods() {
void VisualInstance3D::set_base(const RID &p_base) {
- VisualServer::get_singleton()->instance_set_base(instance, p_base);
+ RenderingServer::get_singleton()->instance_set_base(instance, p_base);
base = p_base;
}
@@ -148,21 +148,21 @@ RID VisualInstance3D::get_base() const {
VisualInstance3D::VisualInstance3D() {
- instance = VisualServer::get_singleton()->instance_create();
- VisualServer::get_singleton()->instance_attach_object_instance_id(instance, get_instance_id());
+ instance = RenderingServer::get_singleton()->instance_create();
+ RenderingServer::get_singleton()->instance_attach_object_instance_id(instance, get_instance_id());
layers = 1;
set_notify_transform(true);
}
VisualInstance3D::~VisualInstance3D() {
- VisualServer::get_singleton()->free(instance);
+ RenderingServer::get_singleton()->free(instance);
}
void GeometryInstance3D::set_material_override(const Ref<Material> &p_material) {
material_override = p_material;
- VS::get_singleton()->instance_geometry_set_material_override(get_instance(), p_material.is_valid() ? p_material->get_rid() : RID());
+ RS::get_singleton()->instance_geometry_set_material_override(get_instance(), p_material.is_valid() ? p_material->get_rid() : RID());
}
Ref<Material> GeometryInstance3D::get_material_override() const {
@@ -173,7 +173,7 @@ Ref<Material> GeometryInstance3D::get_material_override() const {
void GeometryInstance3D::set_lod_min_distance(float p_dist) {
lod_min_distance = p_dist;
- VS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
+ RS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
}
float GeometryInstance3D::get_lod_min_distance() const {
@@ -184,7 +184,7 @@ float GeometryInstance3D::get_lod_min_distance() const {
void GeometryInstance3D::set_lod_max_distance(float p_dist) {
lod_max_distance = p_dist;
- VS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
+ RS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
}
float GeometryInstance3D::get_lod_max_distance() const {
@@ -195,7 +195,7 @@ float GeometryInstance3D::get_lod_max_distance() const {
void GeometryInstance3D::set_lod_min_hysteresis(float p_dist) {
lod_min_hysteresis = p_dist;
- VS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
+ RS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
}
float GeometryInstance3D::get_lod_min_hysteresis() const {
@@ -206,7 +206,7 @@ float GeometryInstance3D::get_lod_min_hysteresis() const {
void GeometryInstance3D::set_lod_max_hysteresis(float p_dist) {
lod_max_hysteresis = p_dist;
- VS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
+ RS::get_singleton()->instance_geometry_set_draw_range(get_instance(), lod_min_distance, lod_max_distance, lod_min_hysteresis, lod_max_hysteresis);
}
float GeometryInstance3D::get_lod_max_hysteresis() const {
@@ -224,7 +224,7 @@ void GeometryInstance3D::set_flag(Flags p_flag, bool p_value) {
return;
flags[p_flag] = p_value;
- VS::get_singleton()->instance_geometry_set_flag(get_instance(), (VS::InstanceFlags)p_flag, p_value);
+ RS::get_singleton()->instance_geometry_set_flag(get_instance(), (RS::InstanceFlags)p_flag, p_value);
}
bool GeometryInstance3D::get_flag(Flags p_flag) const {
@@ -238,7 +238,7 @@ void GeometryInstance3D::set_cast_shadows_setting(ShadowCastingSetting p_shadow_
shadow_casting_setting = p_shadow_casting_setting;
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(get_instance(), (VS::ShadowCastingSetting)p_shadow_casting_setting);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(get_instance(), (RS::ShadowCastingSetting)p_shadow_casting_setting);
}
GeometryInstance3D::ShadowCastingSetting GeometryInstance3D::get_cast_shadows_setting() const {
@@ -250,7 +250,7 @@ void GeometryInstance3D::set_extra_cull_margin(float p_margin) {
ERR_FAIL_COND(p_margin < 0);
extra_cull_margin = p_margin;
- VS::get_singleton()->instance_set_extra_visibility_margin(get_instance(), extra_cull_margin);
+ RS::get_singleton()->instance_set_extra_visibility_margin(get_instance(), extra_cull_margin);
}
float GeometryInstance3D::get_extra_cull_margin() const {
@@ -260,7 +260,7 @@ float GeometryInstance3D::get_extra_cull_margin() const {
void GeometryInstance3D::set_custom_aabb(AABB aabb) {
- VS::get_singleton()->instance_set_custom_aabb(get_instance(), aabb);
+ RS::get_singleton()->instance_set_custom_aabb(get_instance(), aabb);
}
void GeometryInstance3D::_bind_methods() {
@@ -331,5 +331,5 @@ GeometryInstance3D::GeometryInstance3D() {
shadow_casting_setting = SHADOW_CASTING_SETTING_ON;
extra_cull_margin = 0;
- //VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
+ //RS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
}
diff --git a/scene/3d/visual_instance_3d.h b/scene/3d/visual_instance_3d.h
index 59a935fdee..9476c28848 100644
--- a/scene/3d/visual_instance_3d.h
+++ b/scene/3d/visual_instance_3d.h
@@ -86,17 +86,17 @@ class GeometryInstance3D : public VisualInstance3D {
public:
enum Flags {
- FLAG_USE_BAKED_LIGHT = VS::INSTANCE_FLAG_USE_BAKED_LIGHT,
- FLAG_USE_DYNAMIC_GI = VS::INSTANCE_FLAG_USE_DYNAMIC_GI,
- FLAG_DRAW_NEXT_FRAME_IF_VISIBLE = VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE,
- FLAG_MAX = VS::INSTANCE_FLAG_MAX,
+ FLAG_USE_BAKED_LIGHT = RS::INSTANCE_FLAG_USE_BAKED_LIGHT,
+ FLAG_USE_DYNAMIC_GI = RS::INSTANCE_FLAG_USE_DYNAMIC_GI,
+ FLAG_DRAW_NEXT_FRAME_IF_VISIBLE = RS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE,
+ FLAG_MAX = RS::INSTANCE_FLAG_MAX,
};
enum ShadowCastingSetting {
- SHADOW_CASTING_SETTING_OFF = VS::SHADOW_CASTING_SETTING_OFF,
- SHADOW_CASTING_SETTING_ON = VS::SHADOW_CASTING_SETTING_ON,
- SHADOW_CASTING_SETTING_DOUBLE_SIDED = VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED,
- SHADOW_CASTING_SETTING_SHADOWS_ONLY = VS::SHADOW_CASTING_SETTING_SHADOWS_ONLY
+ SHADOW_CASTING_SETTING_OFF = RS::SHADOW_CASTING_SETTING_OFF,
+ SHADOW_CASTING_SETTING_ON = RS::SHADOW_CASTING_SETTING_ON,
+ SHADOW_CASTING_SETTING_DOUBLE_SIDED = RS::SHADOW_CASTING_SETTING_DOUBLE_SIDED,
+ SHADOW_CASTING_SETTING_SHADOWS_ONLY = RS::SHADOW_CASTING_SETTING_SHADOWS_ONLY
};
private:
diff --git a/scene/animation/root_motion_view.cpp b/scene/animation/root_motion_view.cpp
index ce9b8bd213..f993127b07 100644
--- a/scene/animation/root_motion_view.cpp
+++ b/scene/animation/root_motion_view.cpp
@@ -79,7 +79,7 @@ void RootMotionView::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- VS::get_singleton()->immediate_set_material(immediate, StandardMaterial3D::get_material_rid_for_2d(false, true, false, false, false));
+ RS::get_singleton()->immediate_set_material(immediate, StandardMaterial3D::get_material_rid_for_2d(false, true, false, false, false));
first = true;
}
@@ -122,11 +122,11 @@ void RootMotionView::_notification(int p_what) {
}
accumulated.origin.z = Math::fposmod(accumulated.origin.z, cell_size);
- VS::get_singleton()->immediate_clear(immediate);
+ RS::get_singleton()->immediate_clear(immediate);
int cells_in_radius = int((radius / cell_size) + 1.0);
- VS::get_singleton()->immediate_begin(immediate, VS::PRIMITIVE_LINES);
+ RS::get_singleton()->immediate_begin(immediate, RS::PRIMITIVE_LINES);
for (int i = -cells_in_radius; i < cells_in_radius; i++) {
for (int j = -cells_in_radius; j < cells_in_radius; j++) {
@@ -142,21 +142,21 @@ void RootMotionView::_notification(int p_what) {
c_i.a *= MAX(0, 1.0 - from_i.length() / radius);
c_j.a *= MAX(0, 1.0 - from_j.length() / radius);
- VS::get_singleton()->immediate_color(immediate, c);
- VS::get_singleton()->immediate_vertex(immediate, from);
+ RS::get_singleton()->immediate_color(immediate, c);
+ RS::get_singleton()->immediate_vertex(immediate, from);
- VS::get_singleton()->immediate_color(immediate, c_i);
- VS::get_singleton()->immediate_vertex(immediate, from_i);
+ RS::get_singleton()->immediate_color(immediate, c_i);
+ RS::get_singleton()->immediate_vertex(immediate, from_i);
- VS::get_singleton()->immediate_color(immediate, c);
- VS::get_singleton()->immediate_vertex(immediate, from);
+ RS::get_singleton()->immediate_color(immediate, c);
+ RS::get_singleton()->immediate_vertex(immediate, from);
- VS::get_singleton()->immediate_color(immediate, c_j);
- VS::get_singleton()->immediate_vertex(immediate, from_j);
+ RS::get_singleton()->immediate_color(immediate, c_j);
+ RS::get_singleton()->immediate_vertex(immediate, from_j);
}
}
- VS::get_singleton()->immediate_end(immediate);
+ RS::get_singleton()->immediate_end(immediate);
}
}
@@ -197,12 +197,12 @@ RootMotionView::RootMotionView() {
radius = 10;
cell_size = 1;
set_process_internal(true);
- immediate = VisualServer::get_singleton()->immediate_create();
+ immediate = RenderingServer::get_singleton()->immediate_create();
set_base(immediate);
color = Color(0.5, 0.5, 1.0);
}
RootMotionView::~RootMotionView() {
set_base(RID());
- VisualServer::get_singleton()->free(immediate);
+ RenderingServer::get_singleton()->free(immediate);
}
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index f71d322412..1f8487c173 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -31,7 +31,7 @@
#include "button.h"
#include "core/translation.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
Size2 Button::get_minimum_size() const {
diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp
index d68bd4fe4e..470450e3ed 100644
--- a/scene/gui/check_box.cpp
+++ b/scene/gui/check_box.cpp
@@ -30,7 +30,7 @@
#include "check_box.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
Size2 CheckBox::get_icon_size() const {
Ref<Texture2D> checked = Control::get_theme_icon("checked");
diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp
index ac967a128c..96484424f8 100644
--- a/scene/gui/check_button.cpp
+++ b/scene/gui/check_button.cpp
@@ -31,7 +31,7 @@
#include "check_button.h"
#include "core/print_string.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
Size2 CheckButton::get_icon_size() const {
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 14bca0e2c8..0d982dbc02 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -40,7 +40,7 @@
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
#include "scene/scene_string_names.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_settings.h"
@@ -470,7 +470,7 @@ void Control::_update_canvas_item_transform() {
Transform2D xform = _get_internal_transform();
xform[2] += get_position();
- VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform);
+ RenderingServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform);
}
void Control::_notification(int p_notification) {
@@ -588,8 +588,8 @@ void Control::_notification(int p_notification) {
case NOTIFICATION_DRAW: {
_update_canvas_item_transform();
- VisualServer::get_singleton()->canvas_item_set_custom_rect(get_canvas_item(), !data.disable_visibility_clip, Rect2(Point2(), get_size()));
- VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), data.clip_contents);
+ RenderingServer::get_singleton()->canvas_item_set_custom_rect(get_canvas_item(), !data.disable_visibility_clip, Rect2(Point2(), get_size()));
+ RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), data.clip_contents);
//emit_signal(SceneStringNames::get_singleton()->draw);
} break;
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 2db44d0b66..47a5ac68d2 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -859,9 +859,9 @@ void ItemList::_notification(int p_what) {
}
if (has_focus()) {
- VisualServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), true);
+ RenderingServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), true);
draw_style_box(get_theme_stylebox("bg_focus"), Rect2(Point2(), size));
- VisualServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), false);
+ RenderingServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), false);
}
if (shape_changed) {
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index ef1bb958f6..1ffc9712cc 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -84,7 +84,7 @@ void Label::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
if (clip) {
- VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true);
+ RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true);
}
if (word_cache_dirty)
@@ -105,7 +105,7 @@ void Label::_notification(int p_what) {
style->draw(ci, Rect2(Point2(0, 0), get_size()));
- VisualServer::get_singleton()->canvas_item_set_distance_field_mode(get_canvas_item(), font.is_valid() && font->is_distance_field_hint());
+ RenderingServer::get_singleton()->canvas_item_set_distance_field_mode(get_canvas_item(), font.is_valid() && font->is_distance_field_hint());
int font_h = font->get_height() + line_spacing;
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 734e27b1b6..6c5f77f874 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -815,9 +815,9 @@ void LineEdit::_notification(int p_what) {
bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
if (selected) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 3)), font_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 3)), font_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
}
drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
@@ -839,7 +839,7 @@ void LineEdit::_notification(int p_what) {
bool selected = selection.enabled && char_ofs >= selection.begin && char_ofs < selection.end;
if (selected)
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, caret_height)), selection_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, caret_height)), selection_color);
int yofs = y_ofs + (caret_height - font->get_height()) / 2;
drawer.draw_char(ci, Point2(x_ofs, yofs + font_ascent), cchar, next, selected ? font_color_selected : font_color);
@@ -847,9 +847,9 @@ void LineEdit::_notification(int p_what) {
if (char_ofs == cursor_pos && draw_caret && !using_placeholder) {
if (ime_text.length() == 0) {
#ifdef TOOLS_ENABLED
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
#else
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
#endif
}
}
@@ -874,9 +874,9 @@ void LineEdit::_notification(int p_what) {
bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
if (selected) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 3)), font_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 3)), font_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
}
drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
@@ -905,9 +905,9 @@ void LineEdit::_notification(int p_what) {
}
}
#ifdef TOOLS_ENABLED
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(caret_x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(caret_x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
#else
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(caret_x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(caret_x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
#endif
}
}
diff --git a/scene/gui/nine_patch_rect.cpp b/scene/gui/nine_patch_rect.cpp
index 0ef1f53006..cf10c4cfbd 100644
--- a/scene/gui/nine_patch_rect.cpp
+++ b/scene/gui/nine_patch_rect.cpp
@@ -30,7 +30,7 @@
#include "nine_patch_rect.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void NinePatchRect::_notification(int p_what) {
@@ -45,7 +45,7 @@ void NinePatchRect::_notification(int p_what) {
texture->get_rect_region(rect, src_rect, rect, src_rect);
RID ci = get_canvas_item();
- VS::get_singleton()->canvas_item_add_nine_patch(ci, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NinePatchAxisMode(axis_h), VS::NinePatchAxisMode(axis_v), draw_center);
+ RS::get_singleton()->canvas_item_add_nine_patch(ci, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), RS::NinePatchAxisMode(axis_h), RS::NinePatchAxisMode(axis_v), draw_center);
}
}
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index df28a4c12f..d17eec4050 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -603,7 +603,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
#ifdef TOOLS_ENABLED
underline_width *= EDSCALE;
#endif
- VS::get_singleton()->canvas_item_add_line(ci, p_ofs + Point2(align_ofs + wofs, uy), p_ofs + Point2(align_ofs + wofs + w, uy), uc, underline_width);
+ RS::get_singleton()->canvas_item_add_line(ci, p_ofs + Point2(align_ofs + wofs, uy), p_ofs + Point2(align_ofs + wofs + w, uy), uc, underline_width);
} else if (strikethrough) {
Color uc = color;
uc.a *= 0.5;
@@ -612,7 +612,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
#ifdef TOOLS_ENABLED
strikethrough_width *= EDSCALE;
#endif
- VS::get_singleton()->canvas_item_add_line(ci, p_ofs + Point2(align_ofs + wofs, uy), p_ofs + Point2(align_ofs + wofs + w, uy), uc, strikethrough_width);
+ RS::get_singleton()->canvas_item_add_line(ci, p_ofs + Point2(align_ofs + wofs, uy), p_ofs + Point2(align_ofs + wofs + w, uy), uc, strikethrough_width);
}
}
@@ -991,9 +991,9 @@ void RichTextLabel::_notification(int p_what) {
draw_style_box(get_theme_stylebox("normal"), Rect2(Point2(), size));
if (has_focus()) {
- VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci, true);
+ RenderingServer::get_singleton()->canvas_item_add_clip_ignore(ci, true);
draw_style_box(get_theme_stylebox("focus"), Rect2(Point2(), size));
- VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci, false);
+ RenderingServer::get_singleton()->canvas_item_add_clip_ignore(ci, false);
}
int ofs = vscroll->get_value();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index fb477ee3b4..7071652f2a 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -728,7 +728,7 @@ void TextEdit::_notification(int p_what) {
_update_scrollbars();
RID ci = get_canvas_item();
- VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true);
+ RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true);
int xmargin_beg = cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width + cache.fold_gutter_width + cache.info_gutter_width;
int xmargin_end = size.width - cache.style_normal->get_margin(MARGIN_RIGHT) - cache.minimap_width;
@@ -749,14 +749,14 @@ void TextEdit::_notification(int p_what) {
if (syntax_coloring) {
if (cache.background_color.a > 0.01) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(), get_size()), cache.background_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(), get_size()), cache.background_color);
}
}
if (line_length_guidelines) {
const int hard_x = xmargin_beg + (int)cache.font->get_char_size('0').width * line_length_guideline_hard_col - cursor.x_ofs;
if (hard_x > xmargin_beg && hard_x < xmargin_end) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(hard_x, 0), Point2(hard_x, size.height), cache.line_length_guideline_color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2(hard_x, 0), Point2(hard_x, size.height), cache.line_length_guideline_color);
}
// Draw a "Soft" line length guideline, less visible than the hard line length guideline.
@@ -764,7 +764,7 @@ void TextEdit::_notification(int p_what) {
// Only drawn if its column differs from the hard line length guideline.
const int soft_x = xmargin_beg + (int)cache.font->get_char_size('0').width * line_length_guideline_soft_col - cursor.x_ofs;
if (hard_x != soft_x && soft_x > xmargin_beg && soft_x < xmargin_end) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(soft_x, 0), Point2(soft_x, size.height), cache.line_length_guideline_color * Color(1, 1, 1, 0.5));
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2(soft_x, 0), Point2(soft_x, size.height), cache.line_length_guideline_color * Color(1, 1, 1, 0.5));
}
}
@@ -955,7 +955,7 @@ void TextEdit::_notification(int p_what) {
// draw the minimap
Color viewport_color = (cache.background_color.get_v() < 0.5) ? Color(1, 1, 1, 0.1) : Color(0, 0, 0, 0.1);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2((xmargin_end + 2), viewport_offset_y, cache.minimap_width, viewport_height), viewport_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2((xmargin_end + 2), viewport_offset_y, cache.minimap_width, viewport_height), viewport_color);
for (int i = 0; i < minimap_draw_amount; i++) {
minimap_line++;
@@ -1008,7 +1008,7 @@ void TextEdit::_notification(int p_what) {
}
if (minimap_line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2((xmargin_end + 2), i * 3, cache.minimap_width, 2), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2((xmargin_end + 2), i * 3, cache.minimap_width, 2), cache.current_line_color);
}
Color previous_color;
@@ -1057,7 +1057,7 @@ void TextEdit::_notification(int p_what) {
// take one for zero indexing, and if we hit whitespace / the end of a word.
int chars = MAX(0, (j - (characters - 1)) - (is_whitespace ? 1 : 0)) + 1;
int char_x_ofs = indent_px + ((xmargin_end + minimap_char_size.x) + (minimap_char_size.x * chars)) + tabs;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_x_ofs, minimap_line_height * i), Point2(minimap_char_size.x * characters, minimap_char_size.y)), previous_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_x_ofs, minimap_line_height * i), Point2(minimap_char_size.x * characters, minimap_char_size.y)), previous_color);
}
if (out_of_bounds) {
@@ -1164,24 +1164,24 @@ void TextEdit::_notification(int p_what) {
}
if (text.is_marked(line)) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.mark_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.mark_color);
}
if (str.length() == 0) {
// Draw line background if empty as we won't loop at at all.
if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(ofs_x, ofs_y, xmargin_end, get_row_height()), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(ofs_x, ofs_y, xmargin_end, get_row_height()), cache.current_line_color);
}
// Give visual indication of empty selected line.
if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) {
int char_w = cache.font->get_char_size(' ').width;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
}
} else {
// If it has text, then draw current line marker in the margin, as line number etc will draw over it, draw the rest of line marker later.
if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg + ofs_x, get_row_height()), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg + ofs_x, get_row_height()), cache.current_line_color);
}
}
@@ -1190,9 +1190,9 @@ void TextEdit::_notification(int p_what) {
if (text.is_breakpoint(line) && !draw_breakpoint_gutter) {
#ifdef TOOLS_ENABLED
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.breakpoint_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.breakpoint_color);
#else
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color);
#endif
}
@@ -1202,7 +1202,7 @@ void TextEdit::_notification(int p_what) {
int vertical_gap = (get_row_height() * 40) / 100;
int horizontal_gap = (cache.breakpoint_gutter_width * 30) / 100;
int marker_radius = get_row_height() - (vertical_gap * 2);
- VisualServer::get_singleton()->canvas_item_add_circle(ci, Point2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2 + marker_radius / 2, ofs_y + vertical_gap + marker_radius / 2), marker_radius, Color(cache.bookmark_color.r, cache.bookmark_color.g, cache.bookmark_color.b));
+ RenderingServer::get_singleton()->canvas_item_add_circle(ci, Point2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2 + marker_radius / 2, ofs_y + vertical_gap + marker_radius / 2), marker_radius, Color(cache.bookmark_color.r, cache.bookmark_color.g, cache.bookmark_color.b));
}
}
@@ -1214,7 +1214,7 @@ void TextEdit::_notification(int p_what) {
int marker_height = get_row_height() - (vertical_gap * 2);
int marker_width = cache.breakpoint_gutter_width - (horizontal_gap * 2);
// No transparency on marker.
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2, ofs_y + vertical_gap, marker_width, marker_height), Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b));
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2, ofs_y + vertical_gap, marker_width, marker_height), Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b));
}
}
@@ -1254,9 +1254,9 @@ void TextEdit::_notification(int p_what) {
cache.executing_icon->draw_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2 - icon_extra_size / 2, ofs_y + vertical_gap - icon_extra_size / 2, marker_width, marker_height), false, Color(cache.executing_line_color.r, cache.executing_line_color.g, cache.executing_line_color.b));
} else {
#ifdef TOOLS_ENABLED
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.executing_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.executing_line_color);
#else
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.executing_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.executing_line_color);
#endif
}
}
@@ -1315,10 +1315,10 @@ void TextEdit::_notification(int p_what) {
if (j == str.length() - 1) {
// End of line when last char is skipped.
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
} else if ((char_ofs + char_margin) > xmargin_beg) {
// Char next to margin is skipped.
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, (char_ofs + char_margin) - (xmargin_beg + ofs_x), get_row_height()), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, (char_ofs + char_margin) - (xmargin_beg + ofs_x), get_row_height()), cache.current_line_color);
}
}
continue;
@@ -1338,7 +1338,7 @@ void TextEdit::_notification(int p_what) {
in_search_result = j >= search_text_col && j < search_text_col + search_text.length();
if (in_search_result) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin, ofs_y), Size2i(char_w, get_row_height())), cache.search_result_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin, ofs_y), Size2i(char_w, get_row_height())), cache.search_result_color);
}
}
@@ -1348,32 +1348,32 @@ void TextEdit::_notification(int p_what) {
if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
// Draw the wrap indent offset highlight.
if (line_wrap_index != 0 && j == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + ofs_x - indent_px, ofs_y, indent_px, get_row_height()), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + ofs_x - indent_px, ofs_y, indent_px, get_row_height()), cache.current_line_color);
}
// If its the last char draw to end of the line.
if (j == str.length() - 1) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
}
// Actual text.
if (!in_selection) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.current_line_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.current_line_color);
}
}
if (in_selection) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.selection_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.selection_color);
}
if (in_search_result) {
Color border_color = (line == search_result_line && j >= search_result_col && j < search_result_col + search_text.length()) ? cache.font_color : cache.search_result_border_color;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, 1)), border_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y + get_row_height() - 1), Size2i(char_w, 1)), border_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, 1)), border_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y + get_row_height() - 1), Size2i(char_w, 1)), border_color);
if (j == search_text_col)
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(1, get_row_height())), border_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(1, get_row_height())), border_color);
if (j == search_text_col + search_text.length() - 1)
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + char_w + ofs_x - 1, ofs_y), Size2i(1, get_row_height())), border_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + char_w + ofs_x - 1, ofs_y), Size2i(1, get_row_height())), border_color);
}
if (highlight_all_occurrences && !only_whitespaces_highlighted) {
@@ -1392,7 +1392,7 @@ void TextEdit::_notification(int p_what) {
}
if (in_highlighted_word) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.word_highlighted_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.word_highlighted_color);
}
}
}
@@ -1449,9 +1449,9 @@ void TextEdit::_notification(int p_what) {
bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
if (selected) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
}
drawer.draw_char(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + ascent), cchar, next, color);
@@ -1468,7 +1468,7 @@ void TextEdit::_notification(int p_what) {
#else
int caret_h = (block_caret) ? 4 : 2;
#endif
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, caret_h)), cache.caret_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, caret_h)), cache.caret_color);
} else {
#ifdef TOOLS_ENABLED
caret_w = (block_caret) ? caret_w : 2 * EDSCALE;
@@ -1476,7 +1476,7 @@ void TextEdit::_notification(int p_what) {
caret_w = (block_caret) ? caret_w : 2;
#endif
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, cache.font->get_height())), cache.caret_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, cache.font->get_height())), cache.caret_color);
}
}
}
@@ -1544,9 +1544,9 @@ void TextEdit::_notification(int p_what) {
bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
if (selected) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
}
drawer.draw_char(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + ascent), cchar, next, color);
@@ -1564,7 +1564,7 @@ void TextEdit::_notification(int p_what) {
#else
int caret_h = (block_caret) ? 4 : 2;
#endif
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(char_w, caret_h)), cache.caret_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(char_w, caret_h)), cache.caret_color);
} else {
int char_w = cache.font->get_char_size(' ').width;
#ifdef TOOLS_ENABLED
@@ -1573,7 +1573,7 @@ void TextEdit::_notification(int p_what) {
int caret_w = (block_caret) ? char_w : 2;
#endif
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, cache.font->get_height())), cache.caret_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, cache.font->get_height())), cache.caret_color);
}
}
}
@@ -1634,10 +1634,10 @@ void TextEdit::_notification(int p_what) {
draw_style_box(csb, Rect2(completion_rect.position - csb->get_offset(), completion_rect.size + csb->get_minimum_size() + Size2(scrollw, 0)));
if (cache.completion_background_color.a > 0.01) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(completion_rect.position, completion_rect.size + Size2(scrollw, 0)), cache.completion_background_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(completion_rect.position, completion_rect.size + Size2(scrollw, 0)), cache.completion_background_color);
}
int line_from = CLAMP(completion_index - lines / 2, 0, completion_options_size - lines);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(completion_rect.position.x, completion_rect.position.y + (completion_index - line_from) * get_row_height()), Size2(completion_rect.size.width, get_row_height())), cache.completion_selected_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(completion_rect.position.x, completion_rect.position.y + (completion_index - line_from) * get_row_height()), Size2(completion_rect.size.width, get_row_height())), cache.completion_selected_color);
draw_rect(Rect2(completion_rect.position + Vector2(icon_area_size.x + icon_hsep, 0), Size2(MIN(nofs, completion_rect.size.width - (icon_area_size.x + icon_hsep)), completion_rect.size.height)), cache.completion_existing_color);
for (int i = 0; i < lines; i++) {
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp
index abf6b2ed49..0dd43e4a35 100644
--- a/scene/gui/texture_progress.cpp
+++ b/scene/gui/texture_progress.cpp
@@ -300,7 +300,7 @@ void TextureProgress::draw_nine_patch_stretched(const Ref<Texture2D> &p_texture,
p_texture->get_rect_region(dst_rect, src_rect, dst_rect, src_rect);
RID ci = get_canvas_item();
- VS::get_singleton()->canvas_item_add_nine_patch(ci, dst_rect, src_rect, p_texture->get_rid(), topleft, bottomright, VS::NINE_PATCH_STRETCH, VS::NINE_PATCH_STRETCH, true, p_modulate);
+ RS::get_singleton()->canvas_item_add_nine_patch(ci, dst_rect, src_rect, p_texture->get_rid(), topleft, bottomright, RS::NINE_PATCH_STRETCH, RS::NINE_PATCH_STRETCH, true, p_modulate);
}
void TextureProgress::_notification(int p_what) {
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index 6dafd3bf4f..baa138847f 100644
--- a/scene/gui/texture_rect.cpp
+++ b/scene/gui/texture_rect.cpp
@@ -30,7 +30,7 @@
#include "texture_rect.h"
#include "core/core_string_names.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void TextureRect::_notification(int p_what) {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 653ac74164..87425b49cd 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1220,7 +1220,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
if (cache.draw_guides) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2i(cell_rect.position.x, cell_rect.position.y + cell_rect.size.height), cell_rect.position + cell_rect.size, cache.guide_color, 1);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(cell_rect.position.x, cell_rect.position.y + cell_rect.size.height), cell_rect.position + cell_rect.size, cache.guide_color, 1);
}
if (i == 0) {
@@ -1266,12 +1266,12 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
r.size.x += cache.hseparation;
}
if (p_item->cells[i].custom_bg_outline) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), p_item->cells[i].bg_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y - 1, r.size.x, 1), p_item->cells[i].bg_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, 1, r.size.y), p_item->cells[i].bg_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), p_item->cells[i].bg_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), p_item->cells[i].bg_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y - 1, r.size.x, 1), p_item->cells[i].bg_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, 1, r.size.y), p_item->cells[i].bg_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), p_item->cells[i].bg_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, r, p_item->cells[i].bg_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, r, p_item->cells[i].bg_color);
}
}
@@ -1280,16 +1280,16 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
Rect2 r = cell_rect;
if (drop_mode_section == -1 || drop_mode_section == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), cache.drop_position_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, r.size.x, 1), cache.drop_position_color);
}
if (drop_mode_section == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, 1, r.size.y), cache.drop_position_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), cache.drop_position_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y, 1, r.size.y), cache.drop_position_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x + r.size.x - 1, r.position.y, 1, r.size.y), cache.drop_position_color);
}
if (drop_mode_section == 1 || drop_mode_section == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y, r.size.x, 1), cache.drop_position_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(r.position.x, r.position.y + r.size.y, r.size.x, 1), cache.drop_position_color);
}
}
@@ -1509,8 +1509,8 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
Point2i parent_pos = Point2i(parent_ofs - cache.arrow->get_width() / 2, p_pos.y + label_h / 2 + cache.arrow->get_height() / 2) - cache.offset + p_draw_ofs;
if (root_pos.y + line_width >= 0) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x - Math::floor(line_width / 2), root_pos.y), cache.relationship_line_color, line_width);
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y), Point2i(parent_pos.x, prev_ofs), cache.relationship_line_color, line_width);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x - Math::floor(line_width / 2), root_pos.y), cache.relationship_line_color, line_width);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y), Point2i(parent_pos.x, prev_ofs), cache.relationship_line_color, line_width);
}
if (htotal < 0) {
@@ -3030,9 +3030,9 @@ void Tree::_notification(int p_what) {
bg->draw(ci, Rect2(Point2(), get_size()));
if (has_focus()) {
- VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci, true);
+ RenderingServer::get_singleton()->canvas_item_add_clip_ignore(ci, true);
bg_focus->draw(ci, Rect2(Point2(), get_size()));
- VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci, false);
+ RenderingServer::get_singleton()->canvas_item_add_clip_ignore(ci, false);
}
int tbh = _get_title_button_height();
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp
index 7a0fc3352b..4a415415f1 100644
--- a/scene/main/canvas_item.cpp
+++ b/scene/main/canvas_item.cpp
@@ -40,8 +40,7 @@
#include "scene/resources/style_box.h"
#include "scene/resources/texture.h"
#include "scene/scene_string_names.h"
-#include "servers/visual/visual_server_raster.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
Mutex CanvasItemMaterial::material_mutex;
SelfList<CanvasItemMaterial>::List *CanvasItemMaterial::dirty_materials = NULL;
@@ -78,7 +77,7 @@ void CanvasItemMaterial::_update_shader() {
shader_map[current_key].users--;
if (shader_map[current_key].users == 0) {
//deallocate shader, as it's no longer in use
- VS::get_singleton()->free(shader_map[current_key].shader);
+ RS::get_singleton()->free(shader_map[current_key].shader);
shader_map.erase(current_key);
}
}
@@ -87,7 +86,7 @@ void CanvasItemMaterial::_update_shader() {
if (shader_map.has(mk)) {
- VS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
shader_map[mk].users++;
return;
}
@@ -138,14 +137,14 @@ void CanvasItemMaterial::_update_shader() {
}
ShaderData shader_data;
- shader_data.shader = VS::get_singleton()->shader_create();
+ shader_data.shader = RS::get_singleton()->shader_create();
shader_data.users = 1;
- VS::get_singleton()->shader_set_code(shader_data.shader, code);
+ RS::get_singleton()->shader_set_code(shader_data.shader, code);
shader_map[mk] = shader_data;
- VS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
}
void CanvasItemMaterial::flush_changes() {
@@ -207,7 +206,7 @@ bool CanvasItemMaterial::get_particles_animation() const {
void CanvasItemMaterial::set_particles_anim_h_frames(int p_frames) {
particles_anim_h_frames = p_frames;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_h_frames, p_frames);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_h_frames, p_frames);
}
int CanvasItemMaterial::get_particles_anim_h_frames() const {
@@ -217,7 +216,7 @@ int CanvasItemMaterial::get_particles_anim_h_frames() const {
void CanvasItemMaterial::set_particles_anim_v_frames(int p_frames) {
particles_anim_v_frames = p_frames;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_v_frames, p_frames);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_v_frames, p_frames);
}
int CanvasItemMaterial::get_particles_anim_v_frames() const {
@@ -228,7 +227,7 @@ int CanvasItemMaterial::get_particles_anim_v_frames() const {
void CanvasItemMaterial::set_particles_anim_loop(bool p_loop) {
particles_anim_loop = p_loop;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, particles_anim_loop);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, particles_anim_loop);
}
bool CanvasItemMaterial::get_particles_anim_loop() const {
@@ -316,11 +315,11 @@ CanvasItemMaterial::~CanvasItemMaterial() {
shader_map[current_key].users--;
if (shader_map[current_key].users == 0) {
//deallocate shader, as it's no longer in use
- VS::get_singleton()->free(shader_map[current_key].shader);
+ RS::get_singleton()->free(shader_map[current_key].shader);
shader_map.erase(current_key);
}
- VS::get_singleton()->material_set_shader(_get_material(), RID());
+ RS::get_singleton()->material_set_shader(_get_material(), RID());
}
}
@@ -388,7 +387,7 @@ void CanvasItem::show() {
return;
visible = true;
- VisualServer::get_singleton()->canvas_item_set_visible(canvas_item, true);
+ RenderingServer::get_singleton()->canvas_item_set_visible(canvas_item, true);
if (!is_inside_tree())
return;
@@ -403,7 +402,7 @@ void CanvasItem::hide() {
return;
visible = false;
- VisualServer::get_singleton()->canvas_item_set_visible(canvas_item, false);
+ RenderingServer::get_singleton()->canvas_item_set_visible(canvas_item, false);
if (!is_inside_tree())
return;
@@ -424,7 +423,7 @@ void CanvasItem::_update_callback() {
return;
}
- VisualServer::get_singleton()->canvas_item_clear(get_canvas_item());
+ RenderingServer::get_singleton()->canvas_item_clear(get_canvas_item());
//todo updating = true - only allow drawing here
if (is_visible_in_tree()) { //todo optimize this!!
if (first_draw) {
@@ -494,9 +493,9 @@ void CanvasItem::_toplevel_raise_self() {
return;
if (canvas_layer)
- VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item, canvas_layer->get_sort_index());
+ RenderingServer::get_singleton()->canvas_item_set_draw_index(canvas_item, canvas_layer->get_sort_index());
else
- VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item, get_viewport()->gui_get_canvas_sort_index());
+ RenderingServer::get_singleton()->canvas_item_set_draw_index(canvas_item, get_viewport()->gui_get_canvas_sort_index());
}
void CanvasItem::_enter_canvas() {
@@ -525,7 +524,7 @@ void CanvasItem::_enter_canvas() {
else
canvas = get_viewport()->find_world_2d()->get_canvas();
- VisualServer::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
+ RenderingServer::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
group = "root_canvas" + itos(canvas.get_id());
@@ -541,8 +540,8 @@ void CanvasItem::_enter_canvas() {
CanvasItem *parent = get_parent_item();
canvas_layer = parent->canvas_layer;
- VisualServer::get_singleton()->canvas_item_set_parent(canvas_item, parent->get_canvas_item());
- VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item, get_index());
+ RenderingServer::get_singleton()->canvas_item_set_parent(canvas_item, parent->get_canvas_item());
+ RenderingServer::get_singleton()->canvas_item_set_draw_index(canvas_item, get_index());
}
pending_update = false;
@@ -554,7 +553,7 @@ void CanvasItem::_enter_canvas() {
void CanvasItem::_exit_canvas() {
notification(NOTIFICATION_EXIT_CANVAS, true); //reverse the notification
- VisualServer::get_singleton()->canvas_item_set_parent(canvas_item, RID());
+ RenderingServer::get_singleton()->canvas_item_set_parent(canvas_item, RID());
canvas_layer = NULL;
group = "";
}
@@ -608,7 +607,7 @@ void CanvasItem::_notification(int p_what) {
} else {
CanvasItem *p = get_parent_item();
ERR_FAIL_COND(!p);
- VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item, get_index());
+ RenderingServer::get_singleton()->canvas_item_set_draw_index(canvas_item, get_index());
}
} break;
@@ -674,7 +673,7 @@ void CanvasItem::set_modulate(const Color &p_modulate) {
return;
modulate = p_modulate;
- VisualServer::get_singleton()->canvas_item_set_modulate(canvas_item, modulate);
+ RenderingServer::get_singleton()->canvas_item_set_modulate(canvas_item, modulate);
}
Color CanvasItem::get_modulate() const {
@@ -715,7 +714,7 @@ void CanvasItem::set_self_modulate(const Color &p_self_modulate) {
return;
self_modulate = p_self_modulate;
- VisualServer::get_singleton()->canvas_item_set_self_modulate(canvas_item, self_modulate);
+ RenderingServer::get_singleton()->canvas_item_set_self_modulate(canvas_item, self_modulate);
}
Color CanvasItem::get_self_modulate() const {
@@ -728,7 +727,7 @@ void CanvasItem::set_light_mask(int p_light_mask) {
return;
light_mask = p_light_mask;
- VS::get_singleton()->canvas_item_set_light_mask(canvas_item, p_light_mask);
+ RS::get_singleton()->canvas_item_set_light_mask(canvas_item, p_light_mask);
}
int CanvasItem::get_light_mask() const {
@@ -747,7 +746,7 @@ void CanvasItem::draw_line(const Point2 &p_from, const Point2 &p_to, const Color
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
- VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_from, p_to, p_color, p_width);
+ RenderingServer::get_singleton()->canvas_item_add_line(canvas_item, p_from, p_to, p_color, p_width);
}
void CanvasItem::draw_polyline(const Vector<Point2> &p_points, const Color &p_color, float p_width) {
@@ -756,14 +755,14 @@ void CanvasItem::draw_polyline(const Vector<Point2> &p_points, const Color &p_co
Vector<Color> colors;
colors.push_back(p_color);
- VisualServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, colors, p_width);
+ RenderingServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, colors, p_width);
}
void CanvasItem::draw_polyline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width) {
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
- VisualServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, p_colors, p_width);
+ RenderingServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, p_colors, p_width);
}
void CanvasItem::draw_arc(const Vector2 &p_center, float p_radius, float p_start_angle, float p_end_angle, int p_point_count, const Color &p_color, float p_width) {
@@ -785,14 +784,14 @@ void CanvasItem::draw_multiline(const Vector<Point2> &p_points, const Color &p_c
Vector<Color> colors;
colors.push_back(p_color);
- VisualServer::get_singleton()->canvas_item_add_multiline(canvas_item, p_points, colors, p_width);
+ RenderingServer::get_singleton()->canvas_item_add_multiline(canvas_item, p_points, colors, p_width);
}
void CanvasItem::draw_multiline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width) {
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
- VisualServer::get_singleton()->canvas_item_add_multiline(canvas_item, p_points, p_colors, p_width);
+ RenderingServer::get_singleton()->canvas_item_add_multiline(canvas_item, p_points, p_colors, p_width);
}
void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_filled, float p_width) {
@@ -804,7 +803,7 @@ void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_fil
WARN_PRINT("The draw_rect() \"width\" argument has no effect when \"filled\" is \"true\".");
}
- VisualServer::get_singleton()->canvas_item_add_rect(canvas_item, p_rect, p_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(canvas_item, p_rect, p_color);
} else {
// Thick lines are offset depending on their width to avoid partial overlapping.
// Thin lines don't require an offset, so don't apply one in this case
@@ -815,25 +814,25 @@ void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_fil
offset = 0.0;
}
- VisualServer::get_singleton()->canvas_item_add_line(
+ RenderingServer::get_singleton()->canvas_item_add_line(
canvas_item,
p_rect.position + Size2(-offset, 0),
p_rect.position + Size2(p_rect.size.width + offset, 0),
p_color,
p_width);
- VisualServer::get_singleton()->canvas_item_add_line(
+ RenderingServer::get_singleton()->canvas_item_add_line(
canvas_item,
p_rect.position + Size2(p_rect.size.width, offset),
p_rect.position + Size2(p_rect.size.width, p_rect.size.height - offset),
p_color,
p_width);
- VisualServer::get_singleton()->canvas_item_add_line(
+ RenderingServer::get_singleton()->canvas_item_add_line(
canvas_item,
p_rect.position + Size2(p_rect.size.width + offset, p_rect.size.height),
p_rect.position + Size2(-offset, p_rect.size.height),
p_color,
p_width);
- VisualServer::get_singleton()->canvas_item_add_line(
+ RenderingServer::get_singleton()->canvas_item_add_line(
canvas_item,
p_rect.position + Size2(0, p_rect.size.height - offset),
p_rect.position + Size2(0, offset),
@@ -846,7 +845,7 @@ void CanvasItem::draw_circle(const Point2 &p_pos, float p_radius, const Color &p
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
- VisualServer::get_singleton()->canvas_item_add_circle(canvas_item, p_pos, p_radius, p_color);
+ RenderingServer::get_singleton()->canvas_item_add_circle(canvas_item, p_pos, p_radius, p_color);
}
void CanvasItem::draw_texture(const Ref<Texture2D> &p_texture, const Point2 &p_pos, const Color &p_modulate, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
@@ -855,7 +854,7 @@ void CanvasItem::draw_texture(const Ref<Texture2D> &p_texture, const Point2 &p_p
ERR_FAIL_COND(p_texture.is_null());
- p_texture->draw(canvas_item, p_pos, p_modulate, false, p_normal_map, p_specular_map, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ p_texture->draw(canvas_item, p_pos, p_modulate, false, p_normal_map, p_specular_map, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_texture_rect(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
@@ -863,13 +862,13 @@ void CanvasItem::draw_texture_rect(const Ref<Texture2D> &p_texture, const Rect2
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
ERR_FAIL_COND(p_texture.is_null());
- p_texture->draw_rect(canvas_item, p_rect, p_tile, p_modulate, p_transpose, p_normal_map, p_specular_map, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ p_texture->draw_rect(canvas_item, p_rect, p_tile, p_modulate, p_transpose, p_normal_map, p_specular_map, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_texture_rect_region(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, bool p_clip_uv, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
ERR_FAIL_COND(p_texture.is_null());
- p_texture->draw_rect_region(canvas_item, p_rect, p_src_rect, p_modulate, p_transpose, p_normal_map, p_specular_map, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat), p_clip_uv);
+ p_texture->draw_rect_region(canvas_item, p_rect, p_src_rect, p_modulate, p_transpose, p_normal_map, p_specular_map, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat), p_clip_uv);
}
void CanvasItem::draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p_rect) {
@@ -887,7 +886,7 @@ void CanvasItem::draw_primitive(const Vector<Point2> &p_points, const Vector<Col
RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID rid_specular = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_primitive(canvas_item, p_points, p_colors, p_uvs, rid, p_width, rid_normal, rid_specular, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ RenderingServer::get_singleton()->canvas_item_add_primitive(canvas_item, p_points, p_colors, p_uvs, rid, p_width, rid_normal, rid_specular, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_set_transform(const Point2 &p_offset, float p_rot, const Size2 &p_scale) {
@@ -895,14 +894,14 @@ void CanvasItem::draw_set_transform(const Point2 &p_offset, float p_rot, const S
Transform2D xform(p_rot, p_offset);
xform.scale_basis(p_scale);
- VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item, xform);
+ RenderingServer::get_singleton()->canvas_item_add_set_transform(canvas_item, xform);
}
void CanvasItem::draw_set_transform_matrix(const Transform2D &p_matrix) {
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
- VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item, p_matrix);
+ RenderingServer::get_singleton()->canvas_item_add_set_transform(canvas_item, p_matrix);
}
void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture2D> p_texture, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
@@ -913,7 +912,7 @@ void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color
RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID rid_specular = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, p_colors, p_uvs, rid, rid_normal, rid_specular, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ RenderingServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, p_colors, p_uvs, rid, rid_normal, rid_specular, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs, Ref<Texture2D> p_texture, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
@@ -926,7 +925,7 @@ void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Colo
RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID rid_specular = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, colors, p_uvs, rid, rid_normal, rid_specular, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ RenderingServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, colors, p_uvs, rid, rid_normal, rid_specular, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture2D> &p_texture, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, const Transform2D &p_transform, const Color &p_modulate, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
@@ -936,7 +935,7 @@ void CanvasItem::draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture2D> &p_text
RID normal_map_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_map_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_mesh(canvas_item, p_mesh->get_rid(), p_transform, p_modulate, texture_rid, normal_map_rid, specular_map_rid, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ RenderingServer::get_singleton()->canvas_item_add_mesh(canvas_item, p_mesh->get_rid(), p_transform, p_modulate, texture_rid, normal_map_rid, specular_map_rid, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Texture2D> &p_texture, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, TextureFilter p_texture_filter, TextureRepeat p_texture_repeat) {
@@ -945,7 +944,7 @@ void CanvasItem::draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Tex
RID normal_map_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_map_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_multimesh(canvas_item, p_multimesh->get_rid(), texture_rid, normal_map_rid, specular_map_rid, p_specular_color_shininess, VS::CanvasItemTextureFilter(p_texture_filter), VS::CanvasItemTextureRepeat(p_texture_repeat));
+ RenderingServer::get_singleton()->canvas_item_add_multimesh(canvas_item, p_multimesh->get_rid(), texture_rid, normal_map_rid, specular_map_rid, p_specular_color_shininess, RS::CanvasItemTextureFilter(p_texture_filter), RS::CanvasItemTextureRepeat(p_texture_repeat));
}
void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w) {
@@ -1067,7 +1066,7 @@ void CanvasItem::set_draw_behind_parent(bool p_enable) {
if (behind == p_enable)
return;
behind = p_enable;
- VisualServer::get_singleton()->canvas_item_set_draw_behind_parent(canvas_item, behind);
+ RenderingServer::get_singleton()->canvas_item_set_draw_behind_parent(canvas_item, behind);
}
bool CanvasItem::is_draw_behind_parent_enabled() const {
@@ -1081,14 +1080,14 @@ void CanvasItem::set_material(const Ref<Material> &p_material) {
RID rid;
if (material.is_valid())
rid = material->get_rid();
- VS::get_singleton()->canvas_item_set_material(canvas_item, rid);
+ RS::get_singleton()->canvas_item_set_material(canvas_item, rid);
_change_notify(); //properties for material exposed
}
void CanvasItem::set_use_parent_material(bool p_use_parent_material) {
use_parent_material = p_use_parent_material;
- VS::get_singleton()->canvas_item_set_use_parent_material(canvas_item, p_use_parent_material);
+ RS::get_singleton()->canvas_item_set_use_parent_material(canvas_item, p_use_parent_material);
}
bool CanvasItem::get_use_parent_material() const {
@@ -1373,18 +1372,18 @@ void CanvasItem::_update_texture_filter_changed(bool p_propagate) {
} else {
//from viewport
switch (get_viewport()->get_default_canvas_item_texture_filter()) {
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST; break;
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR; break;
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS; break;
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST: texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR: texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS; break;
default: {
}
}
}
} else {
- texture_filter_cache = VS::CanvasItemTextureFilter(texture_filter);
+ texture_filter_cache = RS::CanvasItemTextureFilter(texture_filter);
}
- VS::get_singleton()->canvas_item_set_default_texture_filter(get_canvas_item(), texture_filter_cache);
+ RS::get_singleton()->canvas_item_set_default_texture_filter(get_canvas_item(), texture_filter_cache);
update();
if (p_propagate) {
@@ -1422,17 +1421,17 @@ void CanvasItem::_update_texture_repeat_changed(bool p_propagate) {
} else {
//from viewport
switch (get_viewport()->get_default_canvas_item_texture_repeat()) {
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED: texture_repeat_cache = VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED; break;
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED: texture_repeat_cache = VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED; break;
- case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR: texture_repeat_cache = VS::CANVAS_ITEM_TEXTURE_REPEAT_MIRROR; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED: texture_repeat_cache = RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED: texture_repeat_cache = RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED; break;
+ case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR: texture_repeat_cache = RS::CANVAS_ITEM_TEXTURE_REPEAT_MIRROR; break;
default: {
}
}
}
} else {
- texture_repeat_cache = VS::CanvasItemTextureRepeat(texture_repeat);
+ texture_repeat_cache = RS::CanvasItemTextureRepeat(texture_repeat);
}
- VS::get_singleton()->canvas_item_set_default_texture_repeat(get_canvas_item(), texture_repeat_cache);
+ RS::get_singleton()->canvas_item_set_default_texture_repeat(get_canvas_item(), texture_repeat_cache);
update();
if (p_propagate) {
for (List<CanvasItem *>::Element *E = children_items.front(); E; E = E->next()) {
@@ -1460,7 +1459,7 @@ CanvasItem::CanvasItem() :
xform_change(this) {
window = nullptr;
- canvas_item = VisualServer::get_singleton()->canvas_item_create();
+ canvas_item = RenderingServer::get_singleton()->canvas_item_create();
visible = true;
pending_update = false;
modulate = Color(1, 1, 1, 1);
@@ -1479,13 +1478,13 @@ CanvasItem::CanvasItem() :
light_mask = 1;
texture_repeat = TEXTURE_REPEAT_PARENT_NODE;
texture_filter = TEXTURE_FILTER_PARENT_NODE;
- texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
- texture_repeat_cache = VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
+ texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
+ texture_repeat_cache = RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
C = NULL;
}
CanvasItem::~CanvasItem() {
- VisualServer::get_singleton()->free(canvas_item);
+ RenderingServer::get_singleton()->free(canvas_item);
}
diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h
index 3f176e5f60..dc17c5283b 100644
--- a/scene/main/canvas_item.h
+++ b/scene/main/canvas_item.h
@@ -213,8 +213,8 @@ private:
bool notify_local_transform;
bool notify_transform;
- VS::CanvasItemTextureFilter texture_filter_cache;
- VS::CanvasItemTextureRepeat texture_repeat_cache;
+ RS::CanvasItemTextureFilter texture_filter_cache;
+ RS::CanvasItemTextureRepeat texture_repeat_cache;
TextureFilter texture_filter;
TextureRepeat texture_repeat;
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 2085fa3a60..e6a665d035 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -35,7 +35,7 @@ void CanvasLayer::set_layer(int p_xform) {
layer = p_xform;
if (viewport.is_valid())
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
}
int CanvasLayer::get_layer() const {
@@ -48,7 +48,7 @@ void CanvasLayer::set_transform(const Transform2D &p_xform) {
transform = p_xform;
locrotscale_dirty = true;
if (viewport.is_valid())
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
}
Transform2D CanvasLayer::get_transform() const {
@@ -61,7 +61,7 @@ void CanvasLayer::_update_xform() {
transform.set_rotation_and_scale(rot, scale);
transform.set_origin(ofs);
if (viewport.is_valid())
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
}
void CanvasLayer::_update_locrotscale() {
@@ -150,16 +150,16 @@ void CanvasLayer::_notification(int p_what) {
vp->_canvas_layer_add(this);
viewport = vp->get_viewport_rid();
- VisualServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
_update_follow_viewport();
} break;
case NOTIFICATION_EXIT_TREE: {
vp->_canvas_layer_remove(this);
- VisualServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
viewport = RID();
_update_follow_viewport(false);
@@ -167,7 +167,7 @@ void CanvasLayer::_notification(int p_what) {
case NOTIFICATION_MOVED_IN_PARENT: {
if (is_inside_tree())
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
} break;
}
@@ -191,7 +191,7 @@ void CanvasLayer::set_custom_viewport(Node *p_viewport) {
ERR_FAIL_NULL(p_viewport);
if (is_inside_tree()) {
vp->_canvas_layer_remove(this);
- VisualServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
viewport = RID();
}
@@ -213,9 +213,9 @@ void CanvasLayer::set_custom_viewport(Node *p_viewport) {
vp->_canvas_layer_add(this);
viewport = vp->get_viewport_rid();
- VisualServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
}
}
@@ -266,9 +266,9 @@ void CanvasLayer::_update_follow_viewport(bool p_force_exit) {
return;
}
if (p_force_exit || !follow_viewport) {
- VS::get_singleton()->canvas_set_parent(canvas, RID(), 1.0);
+ RS::get_singleton()->canvas_set_parent(canvas, RID(), 1.0);
} else {
- VS::get_singleton()->canvas_set_parent(canvas, vp->get_world_2d()->get_canvas(), follow_viewport_scale);
+ RS::get_singleton()->canvas_set_parent(canvas, vp->get_world_2d()->get_canvas(), follow_viewport_scale);
}
}
@@ -325,7 +325,7 @@ CanvasLayer::CanvasLayer() {
rot = 0;
locrotscale_dirty = false;
layer = 1;
- canvas = VS::get_singleton()->canvas_create();
+ canvas = RS::get_singleton()->canvas_create();
custom_viewport = NULL;
sort_index = 0;
@@ -335,5 +335,5 @@ CanvasLayer::CanvasLayer() {
CanvasLayer::~CanvasLayer() {
- VS::get_singleton()->free(canvas);
+ RS::get_singleton()->free(canvas);
}
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index d6c0323f25..15c0a7666e 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -48,9 +48,9 @@
#include "scene/resources/packed_scene.h"
#include "scene/scene_string_names.h"
#include "servers/display_server.h"
-#include "servers/navigation_server.h"
-#include "servers/physics_2d_server.h"
-#include "servers/physics_server.h"
+#include "servers/navigation_server_3d.h"
+#include "servers/physics_server_2d.h"
+#include "servers/physics_server_3d.h"
#include "window.h"
#include <stdio.h>
@@ -435,7 +435,7 @@ bool SceneTree::idle(float p_time) {
//print_line("ram: "+itos(OS::get_singleton()->get_static_memory_usage())+" sram: "+itos(OS::get_singleton()->get_dynamic_memory_usage()));
//print_line("node count: "+itos(get_node_count()));
- //print_line("TEXTURE RAM: "+itos(VS::get_singleton()->get_render_info(VS::INFO_TEXTURE_MEM_USED)));
+ //print_line("TEXTURE RAM: "+itos(RS::get_singleton()->get_render_info(RS::INFO_TEXTURE_MEM_USED)));
root_lock++;
@@ -796,9 +796,9 @@ void SceneTree::set_pause(bool p_enabled) {
if (p_enabled == pause)
return;
pause = p_enabled;
- NavigationServer::get_singleton()->set_active(!p_enabled);
- PhysicsServer::get_singleton()->set_active(!p_enabled);
- Physics2DServer::get_singleton()->set_active(!p_enabled);
+ NavigationServer3D::get_singleton()->set_active(!p_enabled);
+ PhysicsServer3D::get_singleton()->set_active(!p_enabled);
+ PhysicsServer2D::get_singleton()->set_active(!p_enabled);
if (get_root())
get_root()->propagate_notification(p_enabled ? Node::NOTIFICATION_PAUSED : Node::NOTIFICATION_UNPAUSED);
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index d293a3cd32..b95e81a702 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -53,7 +53,7 @@
#include "scene/resources/mesh.h"
#include "scene/scene_string_names.h"
#include "servers/display_server.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
void ViewportTexture::setup_local_to_scene() {
@@ -78,11 +78,11 @@ void ViewportTexture::setup_local_to_scene() {
vp->viewport_textures.insert(this);
if (proxy_ph.is_valid()) {
- VS::get_singleton()->texture_proxy_update(proxy, vp->texture_rid);
- VS::get_singleton()->free(proxy_ph);
+ RS::get_singleton()->texture_proxy_update(proxy, vp->texture_rid);
+ RS::get_singleton()->free(proxy_ph);
} else {
ERR_FAIL_COND(proxy.is_valid()); //should be invalid
- proxy = VS::get_singleton()->texture_proxy_create(vp->texture_rid);
+ proxy = RS::get_singleton()->texture_proxy_create(vp->texture_rid);
}
}
@@ -122,8 +122,8 @@ RID ViewportTexture::get_rid() const {
//ERR_FAIL_COND_V_MSG(!vp, RID(), "Viewport Texture must be set to use it.");
if (proxy.is_null()) {
- proxy_ph = VS::get_singleton()->texture_2d_placeholder_create();
- proxy = VS::get_singleton()->texture_proxy_create(proxy_ph);
+ proxy_ph = RS::get_singleton()->texture_2d_placeholder_create();
+ proxy = RS::get_singleton()->texture_proxy_create(proxy_ph);
}
return proxy;
}
@@ -135,7 +135,7 @@ bool ViewportTexture::has_alpha() const {
Ref<Image> ViewportTexture::get_data() const {
ERR_FAIL_COND_V_MSG(!vp, Ref<Image>(), "Viewport Texture must be set to use it.");
- return VS::get_singleton()->texture_2d_get(vp->texture_rid);
+ return RS::get_singleton()->texture_2d_get(vp->texture_rid);
}
void ViewportTexture::_bind_methods() {
@@ -159,10 +159,10 @@ ViewportTexture::~ViewportTexture() {
}
if (proxy_ph.is_valid()) {
- VS::get_singleton()->free(proxy_ph);
+ RS::get_singleton()->free(proxy_ph);
}
if (proxy.is_valid()) {
- VS::get_singleton()->free(proxy);
+ RS::get_singleton()->free(proxy);
}
}
@@ -240,7 +240,7 @@ void Viewport::_collision_object_input_event(CollisionObject3D *p_object, Camera
void Viewport::_sub_window_update_order() {
for (int i = 0; i < gui.sub_windows.size(); i++) {
- VS::get_singleton()->canvas_item_set_draw_index(gui.sub_windows[i].canvas_item, i);
+ RS::get_singleton()->canvas_item_set_draw_index(gui.sub_windows[i].canvas_item, i);
}
}
@@ -252,19 +252,19 @@ void Viewport::_sub_window_register(Window *p_window) {
}
if (gui.sub_windows.size() == 0) {
- subwindow_canvas = VS::get_singleton()->canvas_create();
- VS::get_singleton()->viewport_attach_canvas(viewport, subwindow_canvas);
- VS::get_singleton()->viewport_set_canvas_stacking(viewport, subwindow_canvas, SUBWINDOW_CANVAS_LAYER, 0);
+ subwindow_canvas = RS::get_singleton()->canvas_create();
+ RS::get_singleton()->viewport_attach_canvas(viewport, subwindow_canvas);
+ RS::get_singleton()->viewport_set_canvas_stacking(viewport, subwindow_canvas, SUBWINDOW_CANVAS_LAYER, 0);
}
SubWindow sw;
- sw.canvas_item = VS::get_singleton()->canvas_item_create();
- VS::get_singleton()->canvas_item_set_parent(sw.canvas_item, subwindow_canvas);
+ sw.canvas_item = RS::get_singleton()->canvas_item_create();
+ RS::get_singleton()->canvas_item_set_parent(sw.canvas_item, subwindow_canvas);
sw.window = p_window;
gui.sub_windows.push_back(sw);
_sub_window_grab_focus(p_window);
- VisualServer::get_singleton()->viewport_set_parent_viewport(p_window->viewport, viewport);
+ RenderingServer::get_singleton()->viewport_set_parent_viewport(p_window->viewport, viewport);
}
void Viewport::_sub_window_update(Window *p_window) {
@@ -283,7 +283,7 @@ void Viewport::_sub_window_update(Window *p_window) {
Transform2D pos;
pos.set_origin(p_window->get_position());
- VS::get_singleton()->canvas_item_clear(sw.canvas_item);
+ RS::get_singleton()->canvas_item_clear(sw.canvas_item);
Rect2i r = Rect2i(p_window->get_position(), sw.window->get_size());
if (!p_window->get_flag(Window::FLAG_BORDERLESS)) {
@@ -309,7 +309,7 @@ void Viewport::_sub_window_update(Window *p_window) {
close_icon->draw(sw.canvas_item, r.position + Vector2(r.size.width - close_h_ofs, -close_v_ofs));
}
- VS::get_singleton()->canvas_item_add_texture_rect(sw.canvas_item, r, sw.window->get_texture()->get_rid());
+ RS::get_singleton()->canvas_item_add_texture_rect(sw.canvas_item, r, sw.window->get_texture()->get_rid());
}
void Viewport::_sub_window_grab_focus(Window *p_window) {
@@ -388,14 +388,14 @@ void Viewport::_sub_window_remove(Window *p_window) {
for (int i = 0; i < gui.sub_windows.size(); i++) {
if (gui.sub_windows[i].window == p_window) {
- VS::get_singleton()->free(gui.sub_windows[i].canvas_item);
+ RS::get_singleton()->free(gui.sub_windows[i].canvas_item);
gui.sub_windows.remove(i);
break;
}
}
if (gui.sub_windows.size() == 0) {
- VS::get_singleton()->free(subwindow_canvas);
+ RS::get_singleton()->free(subwindow_canvas);
subwindow_canvas = RID();
}
@@ -419,7 +419,7 @@ void Viewport::_sub_window_remove(Window *p_window) {
}
}
- VisualServer::get_singleton()->viewport_set_parent_viewport(p_window->viewport, p_window->parent ? p_window->parent->viewport : RID());
+ RenderingServer::get_singleton()->viewport_set_parent_viewport(p_window->viewport, p_window->parent ? p_window->parent->viewport : RID());
}
void Viewport::_own_world_changed() {
@@ -437,7 +437,7 @@ void Viewport::_own_world_changed() {
}
if (is_inside_tree()) {
- VisualServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
+ RenderingServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
}
_update_listener();
@@ -453,14 +453,14 @@ void Viewport::_notification(int p_what) {
if (get_parent()) {
parent = get_parent()->get_viewport();
- VisualServer::get_singleton()->viewport_set_parent_viewport(viewport, parent->get_viewport_rid());
+ RenderingServer::get_singleton()->viewport_set_parent_viewport(viewport, parent->get_viewport_rid());
} else {
parent = NULL;
}
current_canvas = find_world_2d()->get_canvas();
- VisualServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
- VisualServer::get_singleton()->viewport_attach_canvas(viewport, current_canvas);
+ RenderingServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
+ RenderingServer::get_singleton()->viewport_attach_canvas(viewport, current_canvas);
_update_listener();
_update_listener_2d();
@@ -470,19 +470,19 @@ void Viewport::_notification(int p_what) {
add_to_group("_viewports");
if (get_tree()->is_debugging_collisions_hint()) {
//2D
- Physics2DServer::get_singleton()->space_set_debug_contacts(find_world_2d()->get_space(), get_tree()->get_collision_debug_contact_count());
- contact_2d_debug = VisualServer::get_singleton()->canvas_item_create();
- VisualServer::get_singleton()->canvas_item_set_parent(contact_2d_debug, find_world_2d()->get_canvas());
+ PhysicsServer2D::get_singleton()->space_set_debug_contacts(find_world_2d()->get_space(), get_tree()->get_collision_debug_contact_count());
+ contact_2d_debug = RenderingServer::get_singleton()->canvas_item_create();
+ RenderingServer::get_singleton()->canvas_item_set_parent(contact_2d_debug, find_world_2d()->get_canvas());
//3D
- PhysicsServer::get_singleton()->space_set_debug_contacts(find_world()->get_space(), get_tree()->get_collision_debug_contact_count());
- contact_3d_debug_multimesh = VisualServer::get_singleton()->multimesh_create();
- VisualServer::get_singleton()->multimesh_allocate(contact_3d_debug_multimesh, get_tree()->get_collision_debug_contact_count(), VS::MULTIMESH_TRANSFORM_3D, true);
- VisualServer::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh, 0);
- VisualServer::get_singleton()->multimesh_set_mesh(contact_3d_debug_multimesh, get_tree()->get_debug_contact_mesh()->get_rid());
- contact_3d_debug_instance = VisualServer::get_singleton()->instance_create();
- VisualServer::get_singleton()->instance_set_base(contact_3d_debug_instance, contact_3d_debug_multimesh);
- VisualServer::get_singleton()->instance_set_scenario(contact_3d_debug_instance, find_world()->get_scenario());
- //VisualServer::get_singleton()->instance_geometry_set_flag(contact_3d_debug_instance, VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS, true);
+ PhysicsServer3D::get_singleton()->space_set_debug_contacts(find_world()->get_space(), get_tree()->get_collision_debug_contact_count());
+ contact_3d_debug_multimesh = RenderingServer::get_singleton()->multimesh_create();
+ RenderingServer::get_singleton()->multimesh_allocate(contact_3d_debug_multimesh, get_tree()->get_collision_debug_contact_count(), RS::MULTIMESH_TRANSFORM_3D, true);
+ RenderingServer::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh, 0);
+ RenderingServer::get_singleton()->multimesh_set_mesh(contact_3d_debug_multimesh, get_tree()->get_debug_contact_mesh()->get_rid());
+ contact_3d_debug_instance = RenderingServer::get_singleton()->instance_create();
+ RenderingServer::get_singleton()->instance_set_base(contact_3d_debug_instance, contact_3d_debug_multimesh);
+ RenderingServer::get_singleton()->instance_set_scenario(contact_3d_debug_instance, find_world()->get_scenario());
+ //RenderingServer::get_singleton()->instance_geometry_set_flag(contact_3d_debug_instance, RS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS, true);
}
} break;
@@ -527,24 +527,24 @@ void Viewport::_notification(int p_what) {
if (world_2d.is_valid())
world_2d->_remove_viewport(this);
- VisualServer::get_singleton()->viewport_set_scenario(viewport, RID());
- VisualServer::get_singleton()->viewport_remove_canvas(viewport, current_canvas);
+ RenderingServer::get_singleton()->viewport_set_scenario(viewport, RID());
+ RenderingServer::get_singleton()->viewport_remove_canvas(viewport, current_canvas);
if (contact_2d_debug.is_valid()) {
- VisualServer::get_singleton()->free(contact_2d_debug);
+ RenderingServer::get_singleton()->free(contact_2d_debug);
contact_2d_debug = RID();
}
if (contact_3d_debug_multimesh.is_valid()) {
- VisualServer::get_singleton()->free(contact_3d_debug_multimesh);
- VisualServer::get_singleton()->free(contact_3d_debug_instance);
+ RenderingServer::get_singleton()->free(contact_3d_debug_multimesh);
+ RenderingServer::get_singleton()->free(contact_3d_debug_instance);
contact_3d_debug_instance = RID();
contact_3d_debug_multimesh = RID();
}
remove_from_group("_viewports");
- VS::get_singleton()->viewport_set_active(viewport, false);
- VisualServer::get_singleton()->viewport_set_parent_viewport(viewport, RID());
+ RS::get_singleton()->viewport_set_active(viewport, false);
+ RenderingServer::get_singleton()->viewport_set_parent_viewport(viewport, RID());
} break;
case NOTIFICATION_INTERNAL_PROCESS: {
@@ -561,25 +561,25 @@ void Viewport::_notification(int p_what) {
if (get_tree()->is_debugging_collisions_hint() && contact_2d_debug.is_valid()) {
- VisualServer::get_singleton()->canvas_item_clear(contact_2d_debug);
- VisualServer::get_singleton()->canvas_item_set_draw_index(contact_2d_debug, 0xFFFFF); //very high index
+ RenderingServer::get_singleton()->canvas_item_clear(contact_2d_debug);
+ RenderingServer::get_singleton()->canvas_item_set_draw_index(contact_2d_debug, 0xFFFFF); //very high index
- Vector<Vector2> points = Physics2DServer::get_singleton()->space_get_contacts(find_world_2d()->get_space());
- int point_count = Physics2DServer::get_singleton()->space_get_contact_count(find_world_2d()->get_space());
+ Vector<Vector2> points = PhysicsServer2D::get_singleton()->space_get_contacts(find_world_2d()->get_space());
+ int point_count = PhysicsServer2D::get_singleton()->space_get_contact_count(find_world_2d()->get_space());
Color ccol = get_tree()->get_debug_collision_contact_color();
for (int i = 0; i < point_count; i++) {
- VisualServer::get_singleton()->canvas_item_add_rect(contact_2d_debug, Rect2(points[i] - Vector2(2, 2), Vector2(5, 5)), ccol);
+ RenderingServer::get_singleton()->canvas_item_add_rect(contact_2d_debug, Rect2(points[i] - Vector2(2, 2), Vector2(5, 5)), ccol);
}
}
if (get_tree()->is_debugging_collisions_hint() && contact_3d_debug_multimesh.is_valid()) {
- Vector<Vector3> points = PhysicsServer::get_singleton()->space_get_contacts(find_world()->get_space());
- int point_count = PhysicsServer::get_singleton()->space_get_contact_count(find_world()->get_space());
+ Vector<Vector3> points = PhysicsServer3D::get_singleton()->space_get_contacts(find_world()->get_space());
+ int point_count = PhysicsServer3D::get_singleton()->space_get_contact_count(find_world()->get_space());
- VS::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh, point_count);
+ RS::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh, point_count);
}
if (physics_object_picking && (to_screen_rect == Rect2i() || InputFilter::get_singleton()->get_mouse_mode() != InputFilter::MOUSE_MODE_CAPTURED)) {
@@ -589,8 +589,8 @@ void Viewport::_notification(int p_what) {
CollisionObject3D *last_object = NULL;
ObjectID last_id;
#endif
- PhysicsDirectSpaceState::RayResult result;
- Physics2DDirectSpaceState *ss2d = Physics2DServer::get_singleton()->space_get_direct_state(find_world_2d()->get_space());
+ PhysicsDirectSpaceState3D::RayResult result;
+ PhysicsDirectSpaceState2D *ss2d = PhysicsServer2D::get_singleton()->space_get_direct_state(find_world_2d()->get_space());
if (physics_has_last_mousepos) {
// if no mouse event exists, create a motion one. This is necessary because objects or camera may have moved.
@@ -697,7 +697,7 @@ void Viewport::_notification(int p_what) {
uint64_t frame = get_tree()->get_frame();
- Physics2DDirectSpaceState::ShapeResult res[64];
+ PhysicsDirectSpaceState2D::ShapeResult res[64];
for (Set<CanvasLayer *>::Element *E = canvas_layers.front(); E; E = E->next()) {
Transform2D canvas_transform;
ObjectID canvas_layer_id;
@@ -805,7 +805,7 @@ void Viewport::_notification(int p_what) {
Vector3 from = camera->project_ray_origin(pos);
Vector3 dir = camera->project_ray_normal(pos);
- PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
+ PhysicsDirectSpaceState3D *space = PhysicsServer3D::get_singleton()->space_get_direct_state(find_world()->get_space());
if (space) {
bool col = space->intersect_ray(from, from + dir * 10000, result, Set<RID>(), 0xFFFFFFFF, true, true, true);
@@ -890,9 +890,9 @@ void Viewport::_set_size(const Size2i &p_size, const Size2i &p_size_override, co
to_screen_rect = p_to_screen_rect;
if (p_allocated) {
- VS::get_singleton()->viewport_set_size(viewport, size.width, size.height);
+ RS::get_singleton()->viewport_set_size(viewport, size.width, size.height);
} else {
- VS::get_singleton()->viewport_set_size(viewport, 0, 0);
+ RS::get_singleton()->viewport_set_size(viewport, 0, 0);
}
_update_global_transform();
@@ -974,9 +974,9 @@ void Viewport::enable_canvas_transform_override(bool p_enable) {
override_canvas_transform = p_enable;
if (p_enable) {
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform_override);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform_override);
} else {
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
}
}
@@ -991,7 +991,7 @@ void Viewport::set_canvas_transform_override(const Transform2D &p_transform) {
canvas_transform_override = p_transform;
if (override_canvas_transform) {
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform_override);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform_override);
}
}
@@ -1004,7 +1004,7 @@ void Viewport::set_canvas_transform(const Transform2D &p_transform) {
canvas_transform = p_transform;
if (!override_canvas_transform) {
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
}
}
@@ -1017,7 +1017,7 @@ void Viewport::_update_global_transform() {
Transform2D sxform = stretch_transform * global_canvas_transform;
- VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport, sxform);
+ RenderingServer::get_singleton()->viewport_set_global_canvas_transform(viewport, sxform);
}
void Viewport::set_global_canvas_transform(const Transform2D &p_transform) {
@@ -1109,9 +1109,9 @@ void Viewport::_camera_set(Camera3D *p_camera) {
if (!camera_override) {
if (camera)
- VisualServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera());
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera());
else
- VisualServer::get_singleton()->viewport_attach_camera(viewport, RID());
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport, RID());
}
if (camera) {
@@ -1168,7 +1168,7 @@ void Viewport::_canvas_layer_remove(CanvasLayer *p_canvas_layer) {
void Viewport::set_transparent_background(bool p_enable) {
transparent_bg = p_enable;
- VS::get_singleton()->viewport_set_transparent_background(viewport, p_enable);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, p_enable);
}
bool Viewport::has_transparent_background() const {
@@ -1187,7 +1187,7 @@ void Viewport::set_world_2d(const Ref<World2D> &p_world_2d) {
if (is_inside_tree()) {
find_world_2d()->_remove_viewport(this);
- VisualServer::get_singleton()->viewport_remove_canvas(viewport, current_canvas);
+ RenderingServer::get_singleton()->viewport_remove_canvas(viewport, current_canvas);
}
if (p_world_2d.is_valid())
@@ -1201,7 +1201,7 @@ void Viewport::set_world_2d(const Ref<World2D> &p_world_2d) {
if (is_inside_tree()) {
current_canvas = find_world_2d()->get_canvas();
- VisualServer::get_singleton()->viewport_attach_canvas(viewport, current_canvas);
+ RenderingServer::get_singleton()->viewport_attach_canvas(viewport, current_canvas);
find_world_2d()->_register_viewport(this, Rect2());
}
}
@@ -1312,7 +1312,7 @@ void Viewport::set_world(const Ref<World3D> &p_world) {
_propagate_enter_world(this);
if (is_inside_tree()) {
- VisualServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
+ RenderingServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
}
_update_listener();
@@ -1357,18 +1357,18 @@ void Viewport::enable_camera_override(bool p_enable) {
}
if (p_enable) {
- camera_override.rid = VisualServer::get_singleton()->camera_create();
+ camera_override.rid = RenderingServer::get_singleton()->camera_create();
} else {
- VisualServer::get_singleton()->free(camera_override.rid);
+ RenderingServer::get_singleton()->free(camera_override.rid);
camera_override.rid = RID();
}
if (p_enable) {
- VisualServer::get_singleton()->viewport_attach_camera(viewport, camera_override.rid);
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport, camera_override.rid);
} else if (camera) {
- VisualServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera());
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera());
} else {
- VisualServer::get_singleton()->viewport_attach_camera(viewport, RID());
+ RenderingServer::get_singleton()->viewport_attach_camera(viewport, RID());
}
#endif
}
@@ -1380,7 +1380,7 @@ bool Viewport::is_camera_override_enabled() const {
void Viewport::set_camera_override_transform(const Transform &p_transform) {
if (camera_override) {
camera_override.transform = p_transform;
- VisualServer::get_singleton()->camera_set_transform(camera_override.rid, p_transform);
+ RenderingServer::get_singleton()->camera_set_transform(camera_override.rid, p_transform);
}
}
@@ -1403,7 +1403,7 @@ void Viewport::set_camera_override_perspective(float p_fovy_degrees, float p_z_n
camera_override.z_far = p_z_far;
camera_override.projection = CameraOverrideData::PROJECTION_PERSPECTIVE;
- VisualServer::get_singleton()->camera_set_perspective(camera_override.rid, camera_override.fov, camera_override.z_near, camera_override.z_far);
+ RenderingServer::get_singleton()->camera_set_perspective(camera_override.rid, camera_override.fov, camera_override.z_near, camera_override.z_far);
}
}
@@ -1418,7 +1418,7 @@ void Viewport::set_camera_override_orthogonal(float p_size, float p_z_near, floa
camera_override.z_far = p_z_far;
camera_override.projection = CameraOverrideData::PROJECTION_ORTHOGONAL;
- VisualServer::get_singleton()->camera_set_orthogonal(camera_override.rid, camera_override.size, camera_override.z_near, camera_override.z_far);
+ RenderingServer::get_singleton()->camera_set_orthogonal(camera_override.rid, camera_override.size, camera_override.z_near, camera_override.z_far);
}
}
@@ -1458,7 +1458,7 @@ void Viewport::set_shadow_atlas_size(int p_size) {
return;
shadow_atlas_size = p_size;
- VS::get_singleton()->viewport_set_shadow_atlas_size(viewport, p_size);
+ RS::get_singleton()->viewport_set_shadow_atlas_size(viewport, p_size);
}
int Viewport::get_shadow_atlas_size() const {
@@ -1477,7 +1477,7 @@ void Viewport::set_shadow_atlas_quadrant_subdiv(int p_quadrant, ShadowAtlasQuadr
shadow_atlas_quadrant_subdiv[p_quadrant] = p_subdiv;
static const int subdiv[SHADOW_ATLAS_QUADRANT_SUBDIV_MAX] = { 0, 1, 4, 16, 64, 256, 1024 };
- VS::get_singleton()->viewport_set_shadow_atlas_quadrant_subdivision(viewport, p_quadrant, subdiv[p_subdiv]);
+ RS::get_singleton()->viewport_set_shadow_atlas_quadrant_subdivision(viewport, p_quadrant, subdiv[p_subdiv]);
}
Viewport::ShadowAtlasQuadrantSubdiv Viewport::get_shadow_atlas_quadrant_subdiv(int p_quadrant) const {
@@ -3109,7 +3109,7 @@ void Viewport::set_use_own_world(bool p_world) {
_propagate_enter_world(this);
if (is_inside_tree()) {
- VisualServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
+ RenderingServer::get_singleton()->viewport_set_scenario(viewport, find_world()->get_scenario());
}
_update_listener();
@@ -3183,7 +3183,7 @@ void Viewport::set_msaa(MSAA p_msaa) {
if (msaa == p_msaa)
return;
msaa = p_msaa;
- VS::get_singleton()->viewport_set_msaa(viewport, VS::ViewportMSAA(p_msaa));
+ RS::get_singleton()->viewport_set_msaa(viewport, RS::ViewportMSAA(p_msaa));
}
Viewport::MSAA Viewport::get_msaa() const {
@@ -3194,7 +3194,7 @@ Viewport::MSAA Viewport::get_msaa() const {
void Viewport::set_debug_draw(DebugDraw p_debug_draw) {
debug_draw = p_debug_draw;
- VS::get_singleton()->viewport_set_debug_draw(viewport, VS::ViewportDebugDraw(p_debug_draw));
+ RS::get_singleton()->viewport_set_debug_draw(viewport, RS::ViewportDebugDraw(p_debug_draw));
}
Viewport::DebugDraw Viewport::get_debug_draw() const {
@@ -3204,7 +3204,7 @@ Viewport::DebugDraw Viewport::get_debug_draw() const {
int Viewport::get_render_info(RenderInfo p_info) {
- return VS::get_singleton()->viewport_get_render_info(viewport, VS::ViewportRenderInfo(p_info));
+ return RS::get_singleton()->viewport_get_render_info(viewport, RS::ViewportRenderInfo(p_info));
}
void Viewport::set_snap_controls_to_pixels(bool p_enable) {
@@ -3527,13 +3527,13 @@ Viewport::Viewport() {
world_2d = Ref<World2D>(memnew(World2D));
- viewport = VisualServer::get_singleton()->viewport_create();
- texture_rid = VisualServer::get_singleton()->viewport_get_texture(viewport);
+ viewport = RenderingServer::get_singleton()->viewport_create();
+ texture_rid = RenderingServer::get_singleton()->viewport_get_texture(viewport);
default_texture.instance();
default_texture->vp = const_cast<Viewport *>(this);
viewport_textures.insert(default_texture.ptr());
- default_texture->proxy = VS::get_singleton()->texture_proxy_create(texture_rid);
+ default_texture->proxy = RS::get_singleton()->texture_proxy_create(texture_rid);
audio_listener = false;
//internal_listener_2d = SpatialSound2DServer::get_singleton()->listener_create();
@@ -3614,7 +3614,7 @@ Viewport::~Viewport() {
for (Set<ViewportTexture *>::Element *E = viewport_textures.front(); E; E = E->next()) {
E->get()->vp = NULL;
}
- VisualServer::get_singleton()->free(viewport);
+ RenderingServer::get_singleton()->free(viewport);
}
/////////////////////////////////
@@ -3622,7 +3622,7 @@ Viewport::~Viewport() {
void SubViewport::set_use_arvr(bool p_use_arvr) {
arvr = p_use_arvr;
- VS::get_singleton()->viewport_set_use_arvr(get_viewport_rid(), arvr);
+ RS::get_singleton()->viewport_set_use_arvr(get_viewport_rid(), arvr);
}
bool SubViewport::is_using_arvr() {
@@ -3639,7 +3639,7 @@ Size2i SubViewport::get_size() const {
void SubViewport::set_update_mode(UpdateMode p_mode) {
update_mode = p_mode;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::ViewportUpdateMode(p_mode));
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::ViewportUpdateMode(p_mode));
}
SubViewport::UpdateMode SubViewport::get_update_mode() const {
@@ -3649,7 +3649,7 @@ SubViewport::UpdateMode SubViewport::get_update_mode() const {
void SubViewport::set_clear_mode(ClearMode p_mode) {
clear_mode = p_mode;
- VS::get_singleton()->viewport_set_clear_mode(get_viewport_rid(), VS::ViewportClearMode(p_mode));
+ RS::get_singleton()->viewport_set_clear_mode(get_viewport_rid(), RS::ViewportClearMode(p_mode));
}
SubViewport::ClearMode SubViewport::get_clear_mode() const {
@@ -3664,10 +3664,10 @@ DisplayServer::WindowID SubViewport::get_window_id() const {
void SubViewport::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
}
if (p_what == NOTIFICATION_EXIT_TREE) {
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), false);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), false);
}
}
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 8a56caea52..d0b22b5553 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -36,7 +36,7 @@
#include "scene/resources/texture.h"
#include "scene/resources/world_2d.h"
#include "servers/display_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class Camera3D;
class Camera2D;
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index b22b99c50c..3a8f7ebb60 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -249,7 +249,7 @@ void Window::_make_window() {
}
}
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_VISIBLE);
}
void Window::_update_from_window() {
@@ -279,7 +279,7 @@ void Window::_clear_window() {
window_id = DisplayServer::INVALID_WINDOW_ID;
_update_viewport_size();
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
void Window::_rect_changed_callback(const Rect2i &p_callback) {
@@ -387,11 +387,11 @@ void Window::set_visible(bool p_visible) {
if (visible) {
embedder = embedder_vp;
embedder->_sub_window_register(this);
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
} else {
embedder->_sub_window_remove(this);
embedder = nullptr;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
_update_window_size();
}
@@ -402,7 +402,7 @@ void Window::set_visible(bool p_visible) {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), visible);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), visible);
}
void Window::_clear_transient() {
@@ -606,14 +606,14 @@ void Window::_update_viewport_size() {
//black bars and margin
if (content_scale_aspect != CONTENT_SCALE_ASPECT_EXPAND && screen_size.x < video_mode.x) {
margin.x = Math::round((video_mode.x - screen_size.x) / 2.0);
- //VisualServer::get_singleton()->black_bars_set_margins(margin.x, 0, margin.x, 0);
+ //RenderingServer::get_singleton()->black_bars_set_margins(margin.x, 0, margin.x, 0);
offset.x = Math::round(margin.x * viewport_size.y / screen_size.y);
} else if (content_scale_aspect != CONTENT_SCALE_ASPECT_EXPAND && screen_size.y < video_mode.y) {
margin.y = Math::round((video_mode.y - screen_size.y) / 2.0);
- //VisualServer::get_singleton()->black_bars_set_margins(0, margin.y, 0, margin.y);
+ //RenderingServer::get_singleton()->black_bars_set_margins(0, margin.y, 0, margin.y);
offset.y = Math::round(margin.y * viewport_size.x / screen_size.x);
} else {
- //VisualServer::get_singleton()->black_bars_set_margins(0, 0, 0, 0);
+ //RenderingServer::get_singleton()->black_bars_set_margins(0, 0, 0, 0);
}
switch (content_scale_mode) {
@@ -646,9 +646,9 @@ void Window::_update_viewport_size() {
_set_size(final_size, final_size_override, attach_to_screen_rect, stretch_transform, allocate);
if (window_id != DisplayServer::INVALID_WINDOW_ID) {
- VisualServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), attach_to_screen_rect, window_id);
+ RenderingServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), attach_to_screen_rect, window_id);
} else {
- VisualServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), Rect2i(), DisplayServer::INVALID_WINDOW_ID);
+ RenderingServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), Rect2i(), DisplayServer::INVALID_WINDOW_ID);
}
if (window_id == DisplayServer::MAIN_WINDOW_ID) {
@@ -718,7 +718,7 @@ void Window::_notification(int p_what) {
//create as embedded
if (embedder) {
embedder->_sub_window_register(this);
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE);
_update_window_size();
}
@@ -736,7 +736,7 @@ void Window::_notification(int p_what) {
}
_update_viewport_size(); //then feed back to the viewport
_update_window_callbacks();
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_WHEN_VISIBLE);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_WHEN_VISIBLE);
} else {
//create
if (visible) {
@@ -752,7 +752,7 @@ void Window::_notification(int p_what) {
if (visible) {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
}
}
@@ -773,7 +773,7 @@ void Window::_notification(int p_what) {
if (window_id == DisplayServer::MAIN_WINDOW_ID) {
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
_update_window_callbacks();
} else {
_clear_window();
@@ -783,12 +783,12 @@ void Window::_notification(int p_what) {
if (embedder) {
embedder->_sub_window_remove(this);
embedder = nullptr;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
_update_viewport_size(); //called by clear and make, which does not happen here
}
- VS::get_singleton()->viewport_set_active(get_viewport_rid(), false);
+ RS::get_singleton()->viewport_set_active(get_viewport_rid(), false);
}
}
@@ -1400,7 +1400,7 @@ Window::Window() {
}
content_scale_mode = CONTENT_SCALE_MODE_DISABLED;
content_scale_aspect = CONTENT_SCALE_ASPECT_IGNORE;
- VS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), VS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED);
}
Window::~Window() {
}
diff --git a/scene/resources/box_shape_3d.cpp b/scene/resources/box_shape_3d.cpp
index 3ac29642d7..64c821a011 100644
--- a/scene/resources/box_shape_3d.cpp
+++ b/scene/resources/box_shape_3d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "box_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> BoxShape3D::get_debug_mesh_lines() {
@@ -54,7 +54,7 @@ real_t BoxShape3D::get_enclosing_radius() const {
void BoxShape3D::_update_shape() {
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), extents);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), extents);
Shape3D::_update_shape();
}
@@ -80,7 +80,7 @@ void BoxShape3D::_bind_methods() {
}
BoxShape3D::BoxShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_BOX)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_BOX)) {
set_extents(Vector3(1, 1, 1));
}
diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp
index 9b8083de97..ab2657c892 100644
--- a/scene/resources/capsule_shape_2d.cpp
+++ b/scene/resources/capsule_shape_2d.cpp
@@ -30,8 +30,8 @@
#include "capsule_shape_2d.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
Vector<Vector2> CapsuleShape2D::_get_points() const {
@@ -54,7 +54,7 @@ bool CapsuleShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_
void CapsuleShape2D::_update_shape() {
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), Vector2(radius, height));
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), Vector2(radius, height));
emit_changed();
}
@@ -85,7 +85,7 @@ void CapsuleShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Vector<Vector2> points = _get_points();
Vector<Color> col;
col.push_back(p_color);
- VisualServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
+ RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
}
Rect2 CapsuleShape2D::get_rect() const {
@@ -114,7 +114,7 @@ void CapsuleShape2D::_bind_methods() {
}
CapsuleShape2D::CapsuleShape2D() :
- Shape2D(Physics2DServer::get_singleton()->capsule_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->capsule_shape_create()) {
radius = 10;
height = 20;
diff --git a/scene/resources/capsule_shape_3d.cpp b/scene/resources/capsule_shape_3d.cpp
index a929caa275..da3ffcb306 100644
--- a/scene/resources/capsule_shape_3d.cpp
+++ b/scene/resources/capsule_shape_3d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "capsule_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> CapsuleShape3D::get_debug_mesh_lines() {
@@ -78,7 +78,7 @@ void CapsuleShape3D::_update_shape() {
Dictionary d;
d["radius"] = radius;
d["height"] = height;
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), d);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), d);
Shape3D::_update_shape();
}
@@ -120,7 +120,7 @@ void CapsuleShape3D::_bind_methods() {
}
CapsuleShape3D::CapsuleShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CAPSULE)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_CAPSULE)) {
radius = 1.0;
height = 1.0;
diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp
index 37874e17ef..afb7597280 100644
--- a/scene/resources/circle_shape_2d.cpp
+++ b/scene/resources/circle_shape_2d.cpp
@@ -30,8 +30,8 @@
#include "circle_shape_2d.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
bool CircleShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
@@ -40,7 +40,7 @@ bool CircleShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_t
void CircleShape2D::_update_shape() {
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), radius);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), radius);
emit_changed();
}
@@ -84,11 +84,11 @@ void CircleShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Vector<Color> col;
col.push_back(p_color);
- VisualServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
+ RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
}
CircleShape2D::CircleShape2D() :
- Shape2D(Physics2DServer::get_singleton()->circle_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->circle_shape_create()) {
radius = 10;
_update_shape();
diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp
index c3e9e19721..c8fec3b72d 100644
--- a/scene/resources/concave_polygon_shape_2d.cpp
+++ b/scene/resources/concave_polygon_shape_2d.cpp
@@ -30,8 +30,8 @@
#include "concave_polygon_shape_2d.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
bool ConcavePolygonShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
@@ -52,13 +52,13 @@ bool ConcavePolygonShape2D::_edit_is_selected_on_click(const Point2 &p_point, do
void ConcavePolygonShape2D::set_segments(const Vector<Vector2> &p_segments) {
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), p_segments);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), p_segments);
emit_changed();
}
Vector<Vector2> ConcavePolygonShape2D::get_segments() const {
- return Physics2DServer::get_singleton()->shape_get_data(get_rid());
+ return PhysicsServer2D::get_singleton()->shape_get_data(get_rid());
}
void ConcavePolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) {
@@ -70,7 +70,7 @@ void ConcavePolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) {
const Vector2 *r = s.ptr();
for (int i = 0; i < len; i += 2) {
- VisualServer::get_singleton()->canvas_item_add_line(p_to_rid, r[i], r[i + 1], p_color, 2);
+ RenderingServer::get_singleton()->canvas_item_add_line(p_to_rid, r[i], r[i + 1], p_color, 2);
}
}
@@ -113,7 +113,7 @@ void ConcavePolygonShape2D::_bind_methods() {
}
ConcavePolygonShape2D::ConcavePolygonShape2D() :
- Shape2D(Physics2DServer::get_singleton()->concave_polygon_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->concave_polygon_shape_create()) {
Vector<Vector2> empty;
set_segments(empty);
}
diff --git a/scene/resources/concave_polygon_shape_3d.cpp b/scene/resources/concave_polygon_shape_3d.cpp
index 6be4a087ad..42e06a49b6 100644
--- a/scene/resources/concave_polygon_shape_3d.cpp
+++ b/scene/resources/concave_polygon_shape_3d.cpp
@@ -30,7 +30,7 @@
#include "concave_polygon_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> ConcavePolygonShape3D::get_debug_mesh_lines() {
@@ -80,13 +80,13 @@ void ConcavePolygonShape3D::_update_shape() {
void ConcavePolygonShape3D::set_faces(const Vector<Vector3> &p_faces) {
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), p_faces);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), p_faces);
notify_change_to_owners();
}
Vector<Vector3> ConcavePolygonShape3D::get_faces() const {
- return PhysicsServer::get_singleton()->shape_get_data(get_shape());
+ return PhysicsServer3D::get_singleton()->shape_get_data(get_shape());
}
void ConcavePolygonShape3D::_bind_methods() {
@@ -97,7 +97,7 @@ void ConcavePolygonShape3D::_bind_methods() {
}
ConcavePolygonShape3D::ConcavePolygonShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_CONCAVE_POLYGON)) {
//set_planes(Vector3(1,1,1));
}
diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp
index 95967429c9..6b1ddec507 100644
--- a/scene/resources/convex_polygon_shape_2d.cpp
+++ b/scene/resources/convex_polygon_shape_2d.cpp
@@ -31,8 +31,8 @@
#include "convex_polygon_shape_2d.h"
#include "core/math/geometry.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
bool ConvexPolygonShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
@@ -45,7 +45,7 @@ void ConvexPolygonShape2D::_update_shape() {
if (Geometry::is_polygon_clockwise(final_points)) { //needs to be counter clockwise
final_points.invert();
}
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), final_points);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), final_points);
emit_changed();
}
@@ -81,7 +81,7 @@ void ConvexPolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Vector<Color> col;
col.push_back(p_color);
- VisualServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
+ RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
}
Rect2 ConvexPolygonShape2D::get_rect() const {
@@ -106,5 +106,5 @@ real_t ConvexPolygonShape2D::get_enclosing_radius() const {
}
ConvexPolygonShape2D::ConvexPolygonShape2D() :
- Shape2D(Physics2DServer::get_singleton()->convex_polygon_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->convex_polygon_shape_create()) {
}
diff --git a/scene/resources/convex_polygon_shape_3d.cpp b/scene/resources/convex_polygon_shape_3d.cpp
index e25301b2eb..ec9ab68015 100644
--- a/scene/resources/convex_polygon_shape_3d.cpp
+++ b/scene/resources/convex_polygon_shape_3d.cpp
@@ -30,7 +30,7 @@
#include "convex_polygon_shape_3d.h"
#include "core/math/quick_hull.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> ConvexPolygonShape3D::get_debug_mesh_lines() {
@@ -67,7 +67,7 @@ real_t ConvexPolygonShape3D::get_enclosing_radius() const {
void ConvexPolygonShape3D::_update_shape() {
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), points);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), points);
Shape3D::_update_shape();
}
@@ -92,5 +92,5 @@ void ConvexPolygonShape3D::_bind_methods() {
}
ConvexPolygonShape3D::ConvexPolygonShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONVEX_POLYGON)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_CONVEX_POLYGON)) {
}
diff --git a/scene/resources/cylinder_shape_3d.cpp b/scene/resources/cylinder_shape_3d.cpp
index 7636c55346..19f0542818 100644
--- a/scene/resources/cylinder_shape_3d.cpp
+++ b/scene/resources/cylinder_shape_3d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "cylinder_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> CylinderShape3D::get_debug_mesh_lines() {
@@ -71,7 +71,7 @@ void CylinderShape3D::_update_shape() {
Dictionary d;
d["radius"] = radius;
d["height"] = height;
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), d);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), d);
Shape3D::_update_shape();
}
@@ -113,7 +113,7 @@ void CylinderShape3D::_bind_methods() {
}
CylinderShape3D::CylinderShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CYLINDER)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_CYLINDER)) {
radius = 1.0;
height = 2.0;
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 410c4990a2..107f07ec7d 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -336,7 +336,7 @@ float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharT
modulate.r = modulate.g = modulate.b = 1.0;
}
RID texture = font->textures[ch->texture_idx].texture->get_rid();
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, ch->rect.size), texture, ch->rect_uv, modulate, false, RID(), RID(), Color(1, 1, 1, 1), false);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, ch->rect.size), texture, ch->rect_uv, modulate, false, RID(), RID(), Color(1, 1, 1, 1), false);
}
advance = ch->advance;
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index d407dd3722..89937238c1 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -30,7 +30,7 @@
#include "environment.h"
#include "core/project_settings.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#include "texture.h"
RID Environment::get_rid() const {
@@ -41,7 +41,7 @@ RID Environment::get_rid() const {
void Environment::set_background(BGMode p_bg) {
bg_mode = p_bg;
- VS::get_singleton()->environment_set_background(environment, VS::EnvironmentBG(p_bg));
+ RS::get_singleton()->environment_set_background(environment, RS::EnvironmentBG(p_bg));
_change_notify();
}
@@ -53,56 +53,56 @@ void Environment::set_sky(const Ref<Sky> &p_sky) {
if (bg_sky.is_valid())
sb_rid = bg_sky->get_rid();
- VS::get_singleton()->environment_set_sky(environment, sb_rid);
+ RS::get_singleton()->environment_set_sky(environment, sb_rid);
}
void Environment::set_sky_custom_fov(float p_scale) {
bg_sky_custom_fov = p_scale;
- VS::get_singleton()->environment_set_sky_custom_fov(environment, p_scale);
+ RS::get_singleton()->environment_set_sky_custom_fov(environment, p_scale);
}
void Environment::set_bg_color(const Color &p_color) {
bg_color = p_color;
- VS::get_singleton()->environment_set_bg_color(environment, p_color);
+ RS::get_singleton()->environment_set_bg_color(environment, p_color);
}
void Environment::set_bg_energy(float p_energy) {
bg_energy = p_energy;
- VS::get_singleton()->environment_set_bg_energy(environment, p_energy);
+ RS::get_singleton()->environment_set_bg_energy(environment, p_energy);
}
void Environment::set_canvas_max_layer(int p_max_layer) {
bg_canvas_max_layer = p_max_layer;
- VS::get_singleton()->environment_set_canvas_max_layer(environment, p_max_layer);
+ RS::get_singleton()->environment_set_canvas_max_layer(environment, p_max_layer);
}
void Environment::set_ambient_light_color(const Color &p_color) {
ambient_color = p_color;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, VS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, VS::EnvironmentReflectionSource(reflection_source), ao_color);
+ RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color);
}
void Environment::set_ambient_light_energy(float p_energy) {
ambient_energy = p_energy;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, VS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, VS::EnvironmentReflectionSource(reflection_source), ao_color);
+ RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color);
}
void Environment::set_ambient_light_sky_contribution(float p_energy) {
ambient_sky_contribution = p_energy;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, VS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, VS::EnvironmentReflectionSource(reflection_source), ao_color);
+ RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color);
}
void Environment::set_camera_feed_id(int p_camera_feed_id) {
camera_feed_id = p_camera_feed_id;
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
- VS::get_singleton()->environment_set_camera_feed_id(environment, camera_feed_id);
+ RS::get_singleton()->environment_set_camera_feed_id(environment, camera_feed_id);
#endif
};
void Environment::set_ambient_source(AmbientSource p_source) {
ambient_source = p_source;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, VS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, VS::EnvironmentReflectionSource(reflection_source), ao_color);
+ RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color);
}
Environment::AmbientSource Environment::get_ambient_source() const {
@@ -110,7 +110,7 @@ Environment::AmbientSource Environment::get_ambient_source() const {
}
void Environment::set_reflection_source(ReflectionSource p_source) {
reflection_source = p_source;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, VS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, VS::EnvironmentReflectionSource(reflection_source), ao_color);
+ RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color);
}
Environment::ReflectionSource Environment::get_reflection_source() const {
return reflection_source;
@@ -132,7 +132,7 @@ float Environment::get_sky_custom_fov() const {
void Environment::set_sky_rotation(const Vector3 &p_rotation) {
sky_rotation = p_rotation;
- VS::get_singleton()->environment_set_sky_orientation(environment, Basis(p_rotation));
+ RS::get_singleton()->environment_set_sky_orientation(environment, Basis(p_rotation));
}
Vector3 Environment::get_sky_rotation() const {
@@ -172,7 +172,7 @@ int Environment::get_camera_feed_id(void) const {
void Environment::set_tonemapper(ToneMapper p_tone_mapper) {
tone_mapper = p_tone_mapper;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
Environment::ToneMapper Environment::get_tonemapper() const {
@@ -183,7 +183,7 @@ Environment::ToneMapper Environment::get_tonemapper() const {
void Environment::set_tonemap_exposure(float p_exposure) {
tonemap_exposure = p_exposure;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
float Environment::get_tonemap_exposure() const {
@@ -194,7 +194,7 @@ float Environment::get_tonemap_exposure() const {
void Environment::set_tonemap_white(float p_white) {
tonemap_white = p_white;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
float Environment::get_tonemap_white() const {
@@ -204,7 +204,7 @@ float Environment::get_tonemap_white() const {
void Environment::set_tonemap_auto_exposure(bool p_enabled) {
tonemap_auto_exposure = p_enabled;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
_change_notify();
}
bool Environment::get_tonemap_auto_exposure() const {
@@ -215,7 +215,7 @@ bool Environment::get_tonemap_auto_exposure() const {
void Environment::set_tonemap_auto_exposure_max(float p_auto_exposure_max) {
tonemap_auto_exposure_max = p_auto_exposure_max;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
float Environment::get_tonemap_auto_exposure_max() const {
@@ -225,7 +225,7 @@ float Environment::get_tonemap_auto_exposure_max() const {
void Environment::set_tonemap_auto_exposure_min(float p_auto_exposure_min) {
tonemap_auto_exposure_min = p_auto_exposure_min;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
float Environment::get_tonemap_auto_exposure_min() const {
@@ -235,7 +235,7 @@ float Environment::get_tonemap_auto_exposure_min() const {
void Environment::set_tonemap_auto_exposure_speed(float p_auto_exposure_speed) {
tonemap_auto_exposure_speed = p_auto_exposure_speed;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
float Environment::get_tonemap_auto_exposure_speed() const {
@@ -245,7 +245,7 @@ float Environment::get_tonemap_auto_exposure_speed() const {
void Environment::set_tonemap_auto_exposure_grey(float p_auto_exposure_grey) {
tonemap_auto_exposure_grey = p_auto_exposure_grey;
- VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
+ RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
}
float Environment::get_tonemap_auto_exposure_grey() const {
@@ -255,7 +255,7 @@ float Environment::get_tonemap_auto_exposure_grey() const {
void Environment::set_adjustment_enable(bool p_enable) {
adjustment_enabled = p_enable;
- VS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
+ RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
_change_notify();
}
@@ -267,7 +267,7 @@ bool Environment::is_adjustment_enabled() const {
void Environment::set_adjustment_brightness(float p_brightness) {
adjustment_brightness = p_brightness;
- VS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
+ RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
}
float Environment::get_adjustment_brightness() const {
@@ -277,7 +277,7 @@ float Environment::get_adjustment_brightness() const {
void Environment::set_adjustment_contrast(float p_contrast) {
adjustment_contrast = p_contrast;
- VS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
+ RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
}
float Environment::get_adjustment_contrast() const {
@@ -287,7 +287,7 @@ float Environment::get_adjustment_contrast() const {
void Environment::set_adjustment_saturation(float p_saturation) {
adjustment_saturation = p_saturation;
- VS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
+ RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
}
float Environment::get_adjustment_saturation() const {
@@ -297,7 +297,7 @@ float Environment::get_adjustment_saturation() const {
void Environment::set_adjustment_color_correction(const Ref<Texture2D> &p_ramp) {
adjustment_color_correction = p_ramp;
- VS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
+ RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID());
}
Ref<Texture2D> Environment::get_adjustment_color_correction() const {
@@ -371,7 +371,7 @@ void Environment::_validate_property(PropertyInfo &property) const {
prefixes++;
}
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
prefixes = high_end_prefixes;
while (*prefixes) {
String prefix = String(*prefixes);
@@ -389,7 +389,7 @@ void Environment::_validate_property(PropertyInfo &property) const {
void Environment::set_ssr_enabled(bool p_enable) {
ssr_enabled = p_enable;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
_change_notify();
}
@@ -401,7 +401,7 @@ bool Environment::is_ssr_enabled() const {
void Environment::set_ssr_max_steps(int p_steps) {
ssr_max_steps = p_steps;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
int Environment::get_ssr_max_steps() const {
@@ -411,7 +411,7 @@ int Environment::get_ssr_max_steps() const {
void Environment::set_ssr_fade_in(float p_fade_in) {
ssr_fade_in = p_fade_in;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
float Environment::get_ssr_fade_in() const {
@@ -421,7 +421,7 @@ float Environment::get_ssr_fade_in() const {
void Environment::set_ssr_fade_out(float p_fade_out) {
ssr_fade_out = p_fade_out;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
float Environment::get_ssr_fade_out() const {
@@ -431,7 +431,7 @@ float Environment::get_ssr_fade_out() const {
void Environment::set_ssr_depth_tolerance(float p_depth_tolerance) {
ssr_depth_tolerance = p_depth_tolerance;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
float Environment::get_ssr_depth_tolerance() const {
@@ -441,7 +441,7 @@ float Environment::get_ssr_depth_tolerance() const {
void Environment::set_ssr_rough(bool p_enable) {
ssr_roughness = p_enable;
- VS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
}
bool Environment::is_ssr_rough() const {
@@ -451,7 +451,7 @@ bool Environment::is_ssr_rough() const {
void Environment::set_ssao_enabled(bool p_enable) {
ssao_enabled = p_enable;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
_change_notify();
}
@@ -463,7 +463,7 @@ bool Environment::is_ssao_enabled() const {
void Environment::set_ssao_radius(float p_radius) {
ssao_radius = p_radius;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
float Environment::get_ssao_radius() const {
@@ -473,7 +473,7 @@ float Environment::get_ssao_radius() const {
void Environment::set_ssao_intensity(float p_intensity) {
ssao_intensity = p_intensity;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
float Environment::get_ssao_intensity() const {
@@ -484,7 +484,7 @@ float Environment::get_ssao_intensity() const {
void Environment::set_ssao_bias(float p_bias) {
ssao_bias = p_bias;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
float Environment::get_ssao_bias() const {
@@ -494,7 +494,7 @@ float Environment::get_ssao_bias() const {
void Environment::set_ssao_direct_light_affect(float p_direct_light_affect) {
ssao_direct_light_affect = p_direct_light_affect;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
float Environment::get_ssao_direct_light_affect() const {
@@ -504,7 +504,7 @@ float Environment::get_ssao_direct_light_affect() const {
void Environment::set_ssao_ao_channel_affect(float p_ao_channel_affect) {
ssao_ao_channel_affect = p_ao_channel_affect;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
float Environment::get_ssao_ao_channel_affect() const {
@@ -514,7 +514,7 @@ float Environment::get_ssao_ao_channel_affect() const {
void Environment::set_ao_color(const Color &p_color) {
ao_color = p_color;
- VS::get_singleton()->environment_set_ambient_light(environment, ambient_color, VS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, VS::EnvironmentReflectionSource(reflection_source), ao_color);
+ RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color);
}
Color Environment::get_ao_color() const {
@@ -525,7 +525,7 @@ Color Environment::get_ao_color() const {
void Environment::set_ssao_blur(SSAOBlur p_blur) {
ssao_blur = p_blur;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
Environment::SSAOBlur Environment::get_ssao_blur() const {
@@ -535,7 +535,7 @@ Environment::SSAOBlur Environment::get_ssao_blur() const {
void Environment::set_ssao_edge_sharpness(float p_edge_sharpness) {
ssao_edge_sharpness = p_edge_sharpness;
- VS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, VS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
+ RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness);
}
float Environment::get_ssao_edge_sharpness() const {
@@ -546,7 +546,7 @@ float Environment::get_ssao_edge_sharpness() const {
void Environment::set_glow_enabled(bool p_enabled) {
glow_enabled = p_enabled;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
_change_notify();
}
@@ -557,18 +557,18 @@ bool Environment::is_glow_enabled() const {
void Environment::set_glow_level(int p_level, bool p_enabled) {
- ERR_FAIL_INDEX(p_level, VS::MAX_GLOW_LEVELS);
+ ERR_FAIL_INDEX(p_level, RS::MAX_GLOW_LEVELS);
if (p_enabled)
glow_levels |= (1 << p_level);
else
glow_levels &= ~(1 << p_level);
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
bool Environment::is_glow_level_enabled(int p_level) const {
- ERR_FAIL_INDEX_V(p_level, VS::MAX_GLOW_LEVELS, false);
+ ERR_FAIL_INDEX_V(p_level, RS::MAX_GLOW_LEVELS, false);
return glow_levels & (1 << p_level);
}
@@ -577,7 +577,7 @@ void Environment::set_glow_intensity(float p_intensity) {
glow_intensity = p_intensity;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_intensity() const {
@@ -587,7 +587,7 @@ float Environment::get_glow_intensity() const {
void Environment::set_glow_strength(float p_strength) {
glow_strength = p_strength;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_strength() const {
@@ -597,7 +597,7 @@ float Environment::get_glow_strength() const {
void Environment::set_glow_mix(float p_mix) {
glow_mix = p_mix;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_mix() const {
@@ -608,7 +608,7 @@ void Environment::set_glow_bloom(float p_threshold) {
glow_bloom = p_threshold;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_bloom() const {
@@ -619,7 +619,7 @@ void Environment::set_glow_blend_mode(GlowBlendMode p_mode) {
glow_blend_mode = p_mode;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
_change_notify();
}
Environment::GlowBlendMode Environment::get_glow_blend_mode() const {
@@ -631,7 +631,7 @@ void Environment::set_glow_hdr_bleed_threshold(float p_threshold) {
glow_hdr_bleed_threshold = p_threshold;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_hdr_bleed_threshold() const {
@@ -642,7 +642,7 @@ void Environment::set_glow_hdr_luminance_cap(float p_amount) {
glow_hdr_luminance_cap = p_amount;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_hdr_luminance_cap() const {
@@ -653,7 +653,7 @@ void Environment::set_glow_hdr_bleed_scale(float p_scale) {
glow_hdr_bleed_scale = p_scale;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
float Environment::get_glow_hdr_bleed_scale() const {
@@ -663,7 +663,7 @@ float Environment::get_glow_hdr_bleed_scale() const {
void Environment::set_glow_bicubic_upscale(bool p_enable) {
glow_bicubic_upscale = p_enable;
- VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
+ RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
}
bool Environment::is_glow_bicubic_upscale_enabled() const {
@@ -674,7 +674,7 @@ bool Environment::is_glow_bicubic_upscale_enabled() const {
void Environment::set_fog_enabled(bool p_enabled) {
fog_enabled = p_enabled;
- VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+ RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
_change_notify();
}
@@ -686,7 +686,7 @@ bool Environment::is_fog_enabled() const {
void Environment::set_fog_color(const Color &p_color) {
fog_color = p_color;
- VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+ RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
}
Color Environment::get_fog_color() const {
@@ -696,7 +696,7 @@ Color Environment::get_fog_color() const {
void Environment::set_fog_sun_color(const Color &p_color) {
fog_sun_color = p_color;
- VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+ RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
}
Color Environment::get_fog_sun_color() const {
@@ -706,7 +706,7 @@ Color Environment::get_fog_sun_color() const {
void Environment::set_fog_sun_amount(float p_amount) {
fog_sun_amount = p_amount;
- VS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
+ RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount);
}
float Environment::get_fog_sun_amount() const {
@@ -716,7 +716,7 @@ float Environment::get_fog_sun_amount() const {
void Environment::set_fog_depth_enabled(bool p_enabled) {
fog_depth_enabled = p_enabled;
- VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+ RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
}
bool Environment::is_fog_depth_enabled() const {
@@ -726,7 +726,7 @@ bool Environment::is_fog_depth_enabled() const {
void Environment::set_fog_depth_begin(float p_distance) {
fog_depth_begin = p_distance;
- VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+ RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
}
float Environment::get_fog_depth_begin() const {
@@ -736,7 +736,7 @@ float Environment::get_fog_depth_begin() const {
void Environment::set_fog_depth_end(float p_distance) {
fog_depth_end = p_distance;
- VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+ RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
}
float Environment::get_fog_depth_end() const {
@@ -747,7 +747,7 @@ float Environment::get_fog_depth_end() const {
void Environment::set_fog_depth_curve(float p_curve) {
fog_depth_curve = p_curve;
- VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+ RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
}
float Environment::get_fog_depth_curve() const {
@@ -757,7 +757,7 @@ float Environment::get_fog_depth_curve() const {
void Environment::set_fog_transmit_enabled(bool p_enabled) {
fog_transmit_enabled = p_enabled;
- VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+ RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
}
bool Environment::is_fog_transmit_enabled() const {
@@ -767,7 +767,7 @@ bool Environment::is_fog_transmit_enabled() const {
void Environment::set_fog_transmit_curve(float p_curve) {
fog_transmit_curve = p_curve;
- VS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
+ RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve);
}
float Environment::get_fog_transmit_curve() const {
@@ -777,7 +777,7 @@ float Environment::get_fog_transmit_curve() const {
void Environment::set_fog_height_enabled(bool p_enabled) {
fog_height_enabled = p_enabled;
- VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+ RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
}
bool Environment::is_fog_height_enabled() const {
@@ -787,7 +787,7 @@ bool Environment::is_fog_height_enabled() const {
void Environment::set_fog_height_min(float p_distance) {
fog_height_min = p_distance;
- VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+ RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
}
float Environment::get_fog_height_min() const {
@@ -797,7 +797,7 @@ float Environment::get_fog_height_min() const {
void Environment::set_fog_height_max(float p_distance) {
fog_height_max = p_distance;
- VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+ RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
}
float Environment::get_fog_height_max() const {
@@ -807,7 +807,7 @@ float Environment::get_fog_height_max() const {
void Environment::set_fog_height_curve(float p_distance) {
fog_height_curve = p_distance;
- VS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
+ RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve);
}
float Environment::get_fog_height_curve() const {
@@ -1152,7 +1152,7 @@ Environment::Environment() :
ssao_blur(SSAO_BLUR_3x3),
glow_blend_mode(GLOW_BLEND_MODE_ADDITIVE) {
- environment = VS::get_singleton()->environment_create();
+ environment = RS::get_singleton()->environment_create();
bg_mode = BG_CLEAR_COLOR;
bg_sky_custom_fov = 0;
@@ -1236,7 +1236,7 @@ Environment::Environment() :
Environment::~Environment() {
- VS::get_singleton()->free(environment);
+ RS::get_singleton()->free(environment);
}
//////////////////////
@@ -1244,7 +1244,7 @@ Environment::~Environment() {
void CameraEffects::set_dof_blur_far_enabled(bool p_enable) {
dof_blur_far_enabled = p_enable;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
}
bool CameraEffects::is_dof_blur_far_enabled() const {
@@ -1255,7 +1255,7 @@ bool CameraEffects::is_dof_blur_far_enabled() const {
void CameraEffects::set_dof_blur_far_distance(float p_distance) {
dof_blur_far_distance = p_distance;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
}
float CameraEffects::get_dof_blur_far_distance() const {
@@ -1265,7 +1265,7 @@ float CameraEffects::get_dof_blur_far_distance() const {
void CameraEffects::set_dof_blur_far_transition(float p_distance) {
dof_blur_far_transition = p_distance;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
}
float CameraEffects::get_dof_blur_far_transition() const {
@@ -1275,7 +1275,7 @@ float CameraEffects::get_dof_blur_far_transition() const {
void CameraEffects::set_dof_blur_near_enabled(bool p_enable) {
dof_blur_near_enabled = p_enable;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
_change_notify();
}
@@ -1287,7 +1287,7 @@ bool CameraEffects::is_dof_blur_near_enabled() const {
void CameraEffects::set_dof_blur_near_distance(float p_distance) {
dof_blur_near_distance = p_distance;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
}
float CameraEffects::get_dof_blur_near_distance() const {
@@ -1298,7 +1298,7 @@ float CameraEffects::get_dof_blur_near_distance() const {
void CameraEffects::set_dof_blur_near_transition(float p_distance) {
dof_blur_near_transition = p_distance;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
}
float CameraEffects::get_dof_blur_near_transition() const {
@@ -1309,7 +1309,7 @@ float CameraEffects::get_dof_blur_near_transition() const {
void CameraEffects::set_dof_blur_amount(float p_amount) {
dof_blur_amount = p_amount;
- VS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
+ RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount);
}
float CameraEffects::get_dof_blur_amount() const {
@@ -1318,7 +1318,7 @@ float CameraEffects::get_dof_blur_amount() const {
void CameraEffects::set_override_exposure_enabled(bool p_enabled) {
override_exposure_enabled = p_enabled;
- VS::get_singleton()->camera_effects_set_custom_exposure(camera_effects, override_exposure_enabled, override_exposure);
+ RS::get_singleton()->camera_effects_set_custom_exposure(camera_effects, override_exposure_enabled, override_exposure);
}
bool CameraEffects::is_override_exposure_enabled() const {
@@ -1327,7 +1327,7 @@ bool CameraEffects::is_override_exposure_enabled() const {
void CameraEffects::set_override_exposure(float p_exposure) {
override_exposure = p_exposure;
- VS::get_singleton()->camera_effects_set_custom_exposure(camera_effects, override_exposure_enabled, override_exposure);
+ RS::get_singleton()->camera_effects_set_custom_exposure(camera_effects, override_exposure_enabled, override_exposure);
}
float CameraEffects::get_override_exposure() const {
@@ -1382,7 +1382,7 @@ void CameraEffects::_bind_methods() {
CameraEffects::CameraEffects() {
- camera_effects = VS::get_singleton()->camera_effects_create();
+ camera_effects = RS::get_singleton()->camera_effects_create();
dof_blur_far_enabled = false;
dof_blur_far_distance = 10;
@@ -1400,5 +1400,5 @@ CameraEffects::CameraEffects() {
CameraEffects::~CameraEffects() {
- VS::get_singleton()->free(camera_effects);
+ RS::get_singleton()->free(camera_effects);
}
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index f9fe26f792..657c7190e5 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -34,7 +34,7 @@
#include "core/resource.h"
#include "scene/resources/sky.h"
#include "scene/resources/texture.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class Environment : public Resource {
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 1f5e4b647a..8914cf8097 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -556,7 +556,7 @@ float BitmapFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_c
cpos.x += c->h_align;
cpos.y -= ascent;
cpos.y += c->v_align;
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx]->get_rid(), c->rect, p_modulate, false, RID(), RID(), Color(1, 1, 1, 1), false);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx]->get_rid(), c->rect, p_modulate, false, RID(), RID(), Color(1, 1, 1, 1), false);
}
return get_char_size(p_char, p_next).width;
diff --git a/scene/resources/height_map_shape_3d.cpp b/scene/resources/height_map_shape_3d.cpp
index 85c081238d..33b6063299 100644
--- a/scene/resources/height_map_shape_3d.cpp
+++ b/scene/resources/height_map_shape_3d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "height_map_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> HeightMapShape3D::get_debug_mesh_lines() {
Vector<Vector3> points;
@@ -88,7 +88,7 @@ void HeightMapShape3D::_update_shape() {
d["heights"] = map_data;
d["min_height"] = min_height;
d["max_height"] = max_height;
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), d);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), d);
Shape3D::_update_shape();
}
@@ -192,7 +192,7 @@ void HeightMapShape3D::_bind_methods() {
}
HeightMapShape3D::HeightMapShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_HEIGHTMAP)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_HEIGHTMAP)) {
map_width = 2;
map_depth = 2;
diff --git a/scene/resources/line_shape_2d.cpp b/scene/resources/line_shape_2d.cpp
index 3b30b4528a..a1c1b2f9f4 100644
--- a/scene/resources/line_shape_2d.cpp
+++ b/scene/resources/line_shape_2d.cpp
@@ -30,8 +30,8 @@
#include "line_shape_2d.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
bool LineShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
@@ -52,7 +52,7 @@ void LineShape2D::_update_shape() {
Array arr;
arr.push_back(normal);
arr.push_back(d);
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), arr);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), arr);
emit_changed();
}
@@ -82,9 +82,9 @@ void LineShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Vector2 point = get_d() * get_normal();
Vector2 l1[2] = { point - get_normal().tangent() * 100, point + get_normal().tangent() * 100 };
- VS::get_singleton()->canvas_item_add_line(p_to_rid, l1[0], l1[1], p_color, 3);
+ RS::get_singleton()->canvas_item_add_line(p_to_rid, l1[0], l1[1], p_color, 3);
Vector2 l2[2] = { point, point + get_normal() * 30 };
- VS::get_singleton()->canvas_item_add_line(p_to_rid, l2[0], l2[1], p_color, 3);
+ RS::get_singleton()->canvas_item_add_line(p_to_rid, l2[0], l2[1], p_color, 3);
}
Rect2 LineShape2D::get_rect() const {
@@ -117,7 +117,7 @@ void LineShape2D::_bind_methods() {
}
LineShape2D::LineShape2D() :
- Shape2D(Physics2DServer::get_singleton()->line_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->line_shape_create()) {
normal = Vector2(0, 1);
d = 0;
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index d387a39dbe..f52b755ed3 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -51,7 +51,7 @@ void Material::set_next_pass(const Ref<Material> &p_pass) {
RID next_pass_rid;
if (next_pass.is_valid())
next_pass_rid = next_pass->get_rid();
- VS::get_singleton()->material_set_next_pass(material, next_pass_rid);
+ RS::get_singleton()->material_set_next_pass(material, next_pass_rid);
}
Ref<Material> Material::get_next_pass() const {
@@ -64,7 +64,7 @@ void Material::set_render_priority(int p_priority) {
ERR_FAIL_COND(p_priority < RENDER_PRIORITY_MIN);
ERR_FAIL_COND(p_priority > RENDER_PRIORITY_MAX);
render_priority = p_priority;
- VS::get_singleton()->material_set_render_priority(material, p_priority);
+ RS::get_singleton()->material_set_render_priority(material, p_priority);
}
int Material::get_render_priority() const {
@@ -100,13 +100,13 @@ void Material::_bind_methods() {
Material::Material() {
- material = VisualServer::get_singleton()->material_create();
+ material = RenderingServer::get_singleton()->material_create();
render_priority = 0;
}
Material::~Material() {
- VisualServer::get_singleton()->free(material);
+ RenderingServer::get_singleton()->free(material);
}
///////////////////////////////////
@@ -126,7 +126,7 @@ bool ShaderMaterial::_set(const StringName &p_name, const Variant &p_value) {
}
}
if (pr) {
- VisualServer::get_singleton()->material_set_param(_get_material(), pr, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), pr, p_value);
return true;
}
}
@@ -150,7 +150,7 @@ bool ShaderMaterial::_get(const StringName &p_name, Variant &r_ret) const {
}
if (pr) {
- r_ret = VisualServer::get_singleton()->material_get_param(_get_material(), pr);
+ r_ret = RenderingServer::get_singleton()->material_get_param(_get_material(), pr);
return true;
}
}
@@ -171,7 +171,7 @@ bool ShaderMaterial::property_can_revert(const String &p_name) {
StringName pr = shader->remap_param(p_name);
if (pr) {
- Variant default_value = VisualServer::get_singleton()->shader_get_param_default(shader->get_rid(), pr);
+ Variant default_value = RenderingServer::get_singleton()->shader_get_param_default(shader->get_rid(), pr);
Variant current_value;
_get(p_name, current_value);
return default_value.get_type() != Variant::NIL && default_value != current_value;
@@ -185,7 +185,7 @@ Variant ShaderMaterial::property_get_revert(const String &p_name) {
if (shader.is_valid()) {
StringName pr = shader->remap_param(p_name);
if (pr) {
- r_ret = VisualServer::get_singleton()->shader_get_param_default(shader->get_rid(), pr);
+ r_ret = RenderingServer::get_singleton()->shader_get_param_default(shader->get_rid(), pr);
}
}
return r_ret;
@@ -211,7 +211,7 @@ void ShaderMaterial::set_shader(const Ref<Shader> &p_shader) {
}
}
- VS::get_singleton()->material_set_shader(_get_material(), rid);
+ RS::get_singleton()->material_set_shader(_get_material(), rid);
_change_notify(); //properties for shader exposed
emit_changed();
}
@@ -223,12 +223,12 @@ Ref<Shader> ShaderMaterial::get_shader() const {
void ShaderMaterial::set_shader_param(const StringName &p_param, const Variant &p_value) {
- VS::get_singleton()->material_set_param(_get_material(), p_param, p_value);
+ RS::get_singleton()->material_set_param(_get_material(), p_param, p_value);
}
Variant ShaderMaterial::get_shader_param(const StringName &p_param) const {
- return VS::get_singleton()->material_get_param(_get_material(), p_param);
+ return RS::get_singleton()->material_get_param(_get_material(), p_param);
}
void ShaderMaterial::_shader_changed() {
@@ -392,7 +392,7 @@ void BaseMaterial3D::_update_shader() {
shader_map[current_key].users--;
if (shader_map[current_key].users == 0) {
//deallocate shader, as it's no longer in use
- VS::get_singleton()->free(shader_map[current_key].shader);
+ RS::get_singleton()->free(shader_map[current_key].shader);
shader_map.erase(current_key);
}
}
@@ -401,7 +401,7 @@ void BaseMaterial3D::_update_shader() {
if (shader_map.has(mk)) {
- VS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
shader_map[mk].users++;
return;
}
@@ -773,7 +773,7 @@ void BaseMaterial3D::_update_shader() {
code += "\tvec2 base_uv2 = UV2;\n";
}
- if (!VisualServer::get_singleton()->is_low_end() && features[FEATURE_HEIGHT_MAPPING] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //heightmap not supported with triplanar
+ if (!RenderingServer::get_singleton()->is_low_end() && features[FEATURE_HEIGHT_MAPPING] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //heightmap not supported with triplanar
code += "\t{\n";
code += "\t\tvec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT*heightmap_flip.x,-BINORMAL*heightmap_flip.y,NORMAL));\n"; // binormal is negative due to mikktspace, flip 'unflips' it ;-)
@@ -953,7 +953,7 @@ void BaseMaterial3D::_update_shader() {
if (distance_fade != DISTANCE_FADE_DISABLED) {
if ((distance_fade == DISTANCE_FADE_OBJECT_DITHER || distance_fade == DISTANCE_FADE_PIXEL_DITHER)) {
- if (!VisualServer::get_singleton()->is_low_end()) {
+ if (!RenderingServer::get_singleton()->is_low_end()) {
code += "\t{\n";
if (distance_fade == DISTANCE_FADE_OBJECT_DITHER) {
code += "\t\tfloat fade_distance = abs((INV_CAMERA_MATRIX * WORLD_MATRIX[3]).z);\n";
@@ -1112,14 +1112,14 @@ void BaseMaterial3D::_update_shader() {
code += "}\n";
ShaderData shader_data;
- shader_data.shader = VS::get_singleton()->shader_create();
+ shader_data.shader = RS::get_singleton()->shader_create();
shader_data.users = 1;
- VS::get_singleton()->shader_set_code(shader_data.shader, code);
+ RS::get_singleton()->shader_set_code(shader_data.shader, code);
shader_map[mk] = shader_data;
- VS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
}
void BaseMaterial3D::flush_changes() {
@@ -1151,7 +1151,7 @@ void BaseMaterial3D::set_albedo(const Color &p_albedo) {
albedo = p_albedo;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->albedo, p_albedo);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->albedo, p_albedo);
}
Color BaseMaterial3D::get_albedo() const {
@@ -1162,7 +1162,7 @@ Color BaseMaterial3D::get_albedo() const {
void BaseMaterial3D::set_specular(float p_specular) {
specular = p_specular;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->specular, p_specular);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->specular, p_specular);
}
float BaseMaterial3D::get_specular() const {
@@ -1173,7 +1173,7 @@ float BaseMaterial3D::get_specular() const {
void BaseMaterial3D::set_roughness(float p_roughness) {
roughness = p_roughness;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->roughness, p_roughness);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->roughness, p_roughness);
}
float BaseMaterial3D::get_roughness() const {
@@ -1184,7 +1184,7 @@ float BaseMaterial3D::get_roughness() const {
void BaseMaterial3D::set_metallic(float p_metallic) {
metallic = p_metallic;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->metallic, p_metallic);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->metallic, p_metallic);
}
float BaseMaterial3D::get_metallic() const {
@@ -1195,7 +1195,7 @@ float BaseMaterial3D::get_metallic() const {
void BaseMaterial3D::set_emission(const Color &p_emission) {
emission = p_emission;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->emission, p_emission);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->emission, p_emission);
}
Color BaseMaterial3D::get_emission() const {
@@ -1205,7 +1205,7 @@ Color BaseMaterial3D::get_emission() const {
void BaseMaterial3D::set_emission_energy(float p_emission_energy) {
emission_energy = p_emission_energy;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->emission_energy, p_emission_energy);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->emission_energy, p_emission_energy);
}
float BaseMaterial3D::get_emission_energy() const {
@@ -1215,7 +1215,7 @@ float BaseMaterial3D::get_emission_energy() const {
void BaseMaterial3D::set_normal_scale(float p_normal_scale) {
normal_scale = p_normal_scale;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->normal_scale, p_normal_scale);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->normal_scale, p_normal_scale);
}
float BaseMaterial3D::get_normal_scale() const {
@@ -1225,7 +1225,7 @@ float BaseMaterial3D::get_normal_scale() const {
void BaseMaterial3D::set_rim(float p_rim) {
rim = p_rim;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->rim, p_rim);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->rim, p_rim);
}
float BaseMaterial3D::get_rim() const {
@@ -1235,7 +1235,7 @@ float BaseMaterial3D::get_rim() const {
void BaseMaterial3D::set_rim_tint(float p_rim_tint) {
rim_tint = p_rim_tint;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->rim_tint, p_rim_tint);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->rim_tint, p_rim_tint);
}
float BaseMaterial3D::get_rim_tint() const {
@@ -1245,7 +1245,7 @@ float BaseMaterial3D::get_rim_tint() const {
void BaseMaterial3D::set_ao_light_affect(float p_ao_light_affect) {
ao_light_affect = p_ao_light_affect;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_light_affect, p_ao_light_affect);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->ao_light_affect, p_ao_light_affect);
}
float BaseMaterial3D::get_ao_light_affect() const {
@@ -1255,7 +1255,7 @@ float BaseMaterial3D::get_ao_light_affect() const {
void BaseMaterial3D::set_clearcoat(float p_clearcoat) {
clearcoat = p_clearcoat;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->clearcoat, p_clearcoat);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->clearcoat, p_clearcoat);
}
float BaseMaterial3D::get_clearcoat() const {
@@ -1266,7 +1266,7 @@ float BaseMaterial3D::get_clearcoat() const {
void BaseMaterial3D::set_clearcoat_gloss(float p_clearcoat_gloss) {
clearcoat_gloss = p_clearcoat_gloss;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->clearcoat_gloss, p_clearcoat_gloss);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->clearcoat_gloss, p_clearcoat_gloss);
}
float BaseMaterial3D::get_clearcoat_gloss() const {
@@ -1277,7 +1277,7 @@ float BaseMaterial3D::get_clearcoat_gloss() const {
void BaseMaterial3D::set_anisotropy(float p_anisotropy) {
anisotropy = p_anisotropy;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->anisotropy, p_anisotropy);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->anisotropy, p_anisotropy);
}
float BaseMaterial3D::get_anisotropy() const {
@@ -1287,7 +1287,7 @@ float BaseMaterial3D::get_anisotropy() const {
void BaseMaterial3D::set_heightmap_scale(float p_heightmap_scale) {
heightmap_scale = p_heightmap_scale;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_scale, p_heightmap_scale);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_scale, p_heightmap_scale);
}
float BaseMaterial3D::get_heightmap_scale() const {
@@ -1298,7 +1298,7 @@ float BaseMaterial3D::get_heightmap_scale() const {
void BaseMaterial3D::set_subsurface_scattering_strength(float p_subsurface_scattering_strength) {
subsurface_scattering_strength = p_subsurface_scattering_strength;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->subsurface_scattering_strength, subsurface_scattering_strength);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->subsurface_scattering_strength, subsurface_scattering_strength);
}
float BaseMaterial3D::get_subsurface_scattering_strength() const {
@@ -1309,7 +1309,7 @@ float BaseMaterial3D::get_subsurface_scattering_strength() const {
void BaseMaterial3D::set_transmission(const Color &p_transmission) {
transmission = p_transmission;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->transmission, transmission);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->transmission, transmission);
}
Color BaseMaterial3D::get_transmission() const {
@@ -1320,7 +1320,7 @@ Color BaseMaterial3D::get_transmission() const {
void BaseMaterial3D::set_refraction(float p_refraction) {
refraction = p_refraction;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction, refraction);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->refraction, refraction);
}
float BaseMaterial3D::get_refraction() const {
@@ -1488,7 +1488,7 @@ void BaseMaterial3D::set_texture(TextureParam p_param, const Ref<Texture2D> &p_t
ERR_FAIL_INDEX(p_param, TEXTURE_MAX);
textures[p_param] = p_texture;
RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
- VS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid);
_change_notify();
_queue_shader_change();
}
@@ -1637,7 +1637,7 @@ void BaseMaterial3D::_validate_property(PropertyInfo &property) const {
void BaseMaterial3D::set_point_size(float p_point_size) {
point_size = p_point_size;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->point_size, p_point_size);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->point_size, p_point_size);
}
float BaseMaterial3D::get_point_size() const {
@@ -1648,7 +1648,7 @@ float BaseMaterial3D::get_point_size() const {
void BaseMaterial3D::set_uv1_scale(const Vector3 &p_scale) {
uv1_scale = p_scale;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_scale, p_scale);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_scale, p_scale);
}
Vector3 BaseMaterial3D::get_uv1_scale() const {
@@ -1659,7 +1659,7 @@ Vector3 BaseMaterial3D::get_uv1_scale() const {
void BaseMaterial3D::set_uv1_offset(const Vector3 &p_offset) {
uv1_offset = p_offset;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_offset, p_offset);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_offset, p_offset);
}
Vector3 BaseMaterial3D::get_uv1_offset() const {
@@ -1669,7 +1669,7 @@ Vector3 BaseMaterial3D::get_uv1_offset() const {
void BaseMaterial3D::set_uv1_triplanar_blend_sharpness(float p_sharpness) {
uv1_triplanar_sharpness = p_sharpness;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_blend_sharpness, p_sharpness);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_blend_sharpness, p_sharpness);
}
float BaseMaterial3D::get_uv1_triplanar_blend_sharpness() const {
@@ -1680,7 +1680,7 @@ float BaseMaterial3D::get_uv1_triplanar_blend_sharpness() const {
void BaseMaterial3D::set_uv2_scale(const Vector3 &p_scale) {
uv2_scale = p_scale;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_scale, p_scale);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_scale, p_scale);
}
Vector3 BaseMaterial3D::get_uv2_scale() const {
@@ -1691,7 +1691,7 @@ Vector3 BaseMaterial3D::get_uv2_scale() const {
void BaseMaterial3D::set_uv2_offset(const Vector3 &p_offset) {
uv2_offset = p_offset;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_offset, p_offset);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_offset, p_offset);
}
Vector3 BaseMaterial3D::get_uv2_offset() const {
@@ -1702,7 +1702,7 @@ Vector3 BaseMaterial3D::get_uv2_offset() const {
void BaseMaterial3D::set_uv2_triplanar_blend_sharpness(float p_sharpness) {
uv2_triplanar_sharpness = p_sharpness;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_blend_sharpness, p_sharpness);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_blend_sharpness, p_sharpness);
}
float BaseMaterial3D::get_uv2_triplanar_blend_sharpness() const {
@@ -1725,7 +1725,7 @@ BaseMaterial3D::BillboardMode BaseMaterial3D::get_billboard_mode() const {
void BaseMaterial3D::set_particles_anim_h_frames(int p_frames) {
particles_anim_h_frames = p_frames;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_h_frames, p_frames);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_h_frames, p_frames);
}
int BaseMaterial3D::get_particles_anim_h_frames() const {
@@ -1735,7 +1735,7 @@ int BaseMaterial3D::get_particles_anim_h_frames() const {
void BaseMaterial3D::set_particles_anim_v_frames(int p_frames) {
particles_anim_v_frames = p_frames;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_v_frames, p_frames);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_v_frames, p_frames);
}
int BaseMaterial3D::get_particles_anim_v_frames() const {
@@ -1746,7 +1746,7 @@ int BaseMaterial3D::get_particles_anim_v_frames() const {
void BaseMaterial3D::set_particles_anim_loop(bool p_loop) {
particles_anim_loop = p_loop;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, particles_anim_loop);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, particles_anim_loop);
}
bool BaseMaterial3D::get_particles_anim_loop() const {
@@ -1769,7 +1769,7 @@ bool BaseMaterial3D::is_heightmap_deep_parallax_enabled() const {
void BaseMaterial3D::set_heightmap_deep_parallax_min_layers(int p_layer) {
deep_parallax_min_layers = p_layer;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_min_layers, p_layer);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_min_layers, p_layer);
}
int BaseMaterial3D::get_heightmap_deep_parallax_min_layers() const {
@@ -1779,7 +1779,7 @@ int BaseMaterial3D::get_heightmap_deep_parallax_min_layers() const {
void BaseMaterial3D::set_heightmap_deep_parallax_max_layers(int p_layer) {
deep_parallax_max_layers = p_layer;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_max_layers, p_layer);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_max_layers, p_layer);
}
int BaseMaterial3D::get_heightmap_deep_parallax_max_layers() const {
@@ -1789,7 +1789,7 @@ int BaseMaterial3D::get_heightmap_deep_parallax_max_layers() const {
void BaseMaterial3D::set_heightmap_deep_parallax_flip_tangent(bool p_flip) {
heightmap_parallax_flip_tangent = p_flip;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_flip, Vector2(heightmap_parallax_flip_tangent ? -1 : 1, heightmap_parallax_flip_binormal ? -1 : 1));
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_flip, Vector2(heightmap_parallax_flip_tangent ? -1 : 1, heightmap_parallax_flip_binormal ? -1 : 1));
}
bool BaseMaterial3D::get_heightmap_deep_parallax_flip_tangent() const {
@@ -1800,7 +1800,7 @@ bool BaseMaterial3D::get_heightmap_deep_parallax_flip_tangent() const {
void BaseMaterial3D::set_heightmap_deep_parallax_flip_binormal(bool p_flip) {
heightmap_parallax_flip_binormal = p_flip;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_flip, Vector2(heightmap_parallax_flip_tangent ? -1 : 1, heightmap_parallax_flip_binormal ? -1 : 1));
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_flip, Vector2(heightmap_parallax_flip_tangent ? -1 : 1, heightmap_parallax_flip_binormal ? -1 : 1));
}
bool BaseMaterial3D::get_heightmap_deep_parallax_flip_binormal() const {
@@ -1820,7 +1820,7 @@ bool BaseMaterial3D::is_grow_enabled() const {
void BaseMaterial3D::set_alpha_scissor_threshold(float p_threshold) {
alpha_scissor_threshold = p_threshold;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->alpha_scissor_threshold, p_threshold);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->alpha_scissor_threshold, p_threshold);
}
float BaseMaterial3D::get_alpha_scissor_threshold() const {
@@ -1830,7 +1830,7 @@ float BaseMaterial3D::get_alpha_scissor_threshold() const {
void BaseMaterial3D::set_grow(float p_grow) {
grow = p_grow;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->grow, p_grow);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->grow, p_grow);
}
float BaseMaterial3D::get_grow() const {
@@ -1853,7 +1853,7 @@ static Plane _get_texture_mask(BaseMaterial3D::TextureChannel p_channel) {
void BaseMaterial3D::set_metallic_texture_channel(TextureChannel p_channel) {
ERR_FAIL_INDEX(p_channel, 5);
metallic_texture_channel = p_channel;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->metallic_texture_channel, _get_texture_mask(p_channel));
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->metallic_texture_channel, _get_texture_mask(p_channel));
}
BaseMaterial3D::TextureChannel BaseMaterial3D::get_metallic_texture_channel() const {
@@ -1875,7 +1875,7 @@ void BaseMaterial3D::set_ao_texture_channel(TextureChannel p_channel) {
ERR_FAIL_INDEX(p_channel, 5);
ao_texture_channel = p_channel;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_texture_channel, _get_texture_mask(p_channel));
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->ao_texture_channel, _get_texture_mask(p_channel));
}
BaseMaterial3D::TextureChannel BaseMaterial3D::get_ao_texture_channel() const {
@@ -1886,7 +1886,7 @@ void BaseMaterial3D::set_refraction_texture_channel(TextureChannel p_channel) {
ERR_FAIL_INDEX(p_channel, 5);
refraction_texture_channel = p_channel;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_texture_channel, _get_texture_mask(p_channel));
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_texture_channel, _get_texture_mask(p_channel));
}
BaseMaterial3D::TextureChannel BaseMaterial3D::get_refraction_texture_channel() const {
@@ -1954,7 +1954,7 @@ bool BaseMaterial3D::is_proximity_fade_enabled() const {
void BaseMaterial3D::set_proximity_fade_distance(float p_distance) {
proximity_fade_distance = p_distance;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->proximity_fade_distance, p_distance);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->proximity_fade_distance, p_distance);
}
float BaseMaterial3D::get_proximity_fade_distance() const {
@@ -1975,7 +1975,7 @@ BaseMaterial3D::DistanceFadeMode BaseMaterial3D::get_distance_fade() const {
void BaseMaterial3D::set_distance_fade_max_distance(float p_distance) {
distance_fade_max_distance = p_distance;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->distance_fade_max, distance_fade_max_distance);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->distance_fade_max, distance_fade_max_distance);
}
float BaseMaterial3D::get_distance_fade_max_distance() const {
@@ -1985,7 +1985,7 @@ float BaseMaterial3D::get_distance_fade_max_distance() const {
void BaseMaterial3D::set_distance_fade_min_distance(float p_distance) {
distance_fade_min_distance = p_distance;
- VS::get_singleton()->material_set_param(_get_material(), shader_names->distance_fade_min, distance_fade_min_distance);
+ RS::get_singleton()->material_set_param(_get_material(), shader_names->distance_fade_min, distance_fade_min_distance);
}
float BaseMaterial3D::get_distance_fade_min_distance() const {
@@ -2561,11 +2561,11 @@ BaseMaterial3D::~BaseMaterial3D() {
shader_map[current_key].users--;
if (shader_map[current_key].users == 0) {
//deallocate shader, as it's no longer in use
- VS::get_singleton()->free(shader_map[current_key].shader);
+ RS::get_singleton()->free(shader_map[current_key].shader);
shader_map.erase(current_key);
}
- VS::get_singleton()->material_set_shader(_get_material(), RID());
+ RS::get_singleton()->material_set_shader(_get_material(), RID());
}
}
diff --git a/scene/resources/material.h b/scene/resources/material.h
index fc77226fb9..0c9352baf4 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -35,8 +35,8 @@
#include "core/self_list.h"
#include "scene/resources/shader.h"
#include "scene/resources/texture.h"
-#include "servers/visual/shader_language.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/shader_language.h"
+#include "servers/rendering_server.h"
class Material : public Resource {
@@ -57,8 +57,8 @@ protected:
public:
enum {
- RENDER_PRIORITY_MAX = VS::MATERIAL_RENDER_PRIORITY_MAX,
- RENDER_PRIORITY_MIN = VS::MATERIAL_RENDER_PRIORITY_MIN,
+ RENDER_PRIORITY_MAX = RS::MATERIAL_RENDER_PRIORITY_MAX,
+ RENDER_PRIORITY_MIN = RS::MATERIAL_RENDER_PRIORITY_MIN,
};
void set_next_pass(const Ref<Material> &p_pass);
Ref<Material> get_next_pass() const;
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index 0d32fdb0fa..b37b7f9751 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -169,20 +169,20 @@ Vector<Face3> Mesh::get_faces() const {
/*
for (int i=0;i<surfaces.size();i++) {
- if (VisualServer::get_singleton()->mesh_surface_get_primitive_type( mesh, i ) != VisualServer::PRIMITIVE_TRIANGLES )
+ if (RenderingServer::get_singleton()->mesh_surface_get_primitive_type( mesh, i ) != RenderingServer::PRIMITIVE_TRIANGLES )
continue;
Vector<int> indices;
Vector<Vector3> vertices;
- vertices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_VERTEX);
+ vertices=RenderingServer::get_singleton()->mesh_surface_get_array(mesh, i,RenderingServer::ARRAY_VERTEX);
- int len=VisualServer::get_singleton()->mesh_surface_get_array_index_len(mesh, i);
+ int len=RenderingServer::get_singleton()->mesh_surface_get_array_index_len(mesh, i);
bool has_indices;
if (len>0) {
- indices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_INDEX);
+ indices=RenderingServer::get_singleton()->mesh_surface_get_array(mesh, i,RenderingServer::ARRAY_INDEX);
has_indices=true;
} else {
@@ -846,7 +846,7 @@ Array ArrayMesh::_get_surfaces() const {
Array ret;
for (int i = 0; i < surfaces.size(); i++) {
- VisualServer::SurfaceData surface = VS::get_singleton()->mesh_get_surface(mesh, i);
+ RenderingServer::SurfaceData surface = RS::get_singleton()->mesh_get_surface(mesh, i);
Dictionary data;
data["format"] = surface.format;
data["primitive"] = surface.primitive;
@@ -902,20 +902,20 @@ Array ArrayMesh::_get_surfaces() const {
void ArrayMesh::_create_if_empty() const {
if (!mesh.is_valid()) {
- mesh = VS::get_singleton()->mesh_create();
- VS::get_singleton()->mesh_set_blend_shape_mode(mesh, (VS::BlendShapeMode)blend_shape_mode);
+ mesh = RS::get_singleton()->mesh_create();
+ RS::get_singleton()->mesh_set_blend_shape_mode(mesh, (RS::BlendShapeMode)blend_shape_mode);
}
}
void ArrayMesh::_set_surfaces(const Array &p_surfaces) {
- Vector<VS::SurfaceData> surface_data;
+ Vector<RS::SurfaceData> surface_data;
Vector<Ref<Material>> surface_materials;
Vector<String> surface_names;
Vector<bool> surface_2d;
for (int i = 0; i < p_surfaces.size(); i++) {
- VS::SurfaceData surface;
+ RS::SurfaceData surface;
Dictionary d = p_surfaces[i];
ERR_FAIL_COND(!d.has("format"));
ERR_FAIL_COND(!d.has("primitive"));
@@ -923,7 +923,7 @@ void ArrayMesh::_set_surfaces(const Array &p_surfaces) {
ERR_FAIL_COND(!d.has("vertex_count"));
ERR_FAIL_COND(!d.has("aabb"));
surface.format = d["format"];
- surface.primitive = VS::PrimitiveType(int(d["primitive"]));
+ surface.primitive = RS::PrimitiveType(int(d["primitive"]));
surface.vertex_data = d["vertex_data"];
surface.vertex_count = d["vertex_count"];
surface.aabb = d["aabb"];
@@ -938,7 +938,7 @@ void ArrayMesh::_set_surfaces(const Array &p_surfaces) {
Array lods = d["lods"];
ERR_FAIL_COND(lods.size() & 1); //must be even
for (int j = 0; j < lods.size(); j += 2) {
- VS::SurfaceData::LOD lod;
+ RS::SurfaceData::LOD lod;
lod.edge_length = lods[j + 0];
lod.index_data = lods[j + 1];
surface.lods.push_back(lod);
@@ -993,15 +993,15 @@ void ArrayMesh::_set_surfaces(const Array &p_surfaces) {
if (mesh.is_valid()) {
//if mesh exists, it needs to be updated
- VS::get_singleton()->mesh_clear(mesh);
+ RS::get_singleton()->mesh_clear(mesh);
for (int i = 0; i < surface_data.size(); i++) {
- VS::get_singleton()->mesh_add_surface(mesh, surface_data[i]);
+ RS::get_singleton()->mesh_add_surface(mesh, surface_data[i]);
}
} else {
// if mesh does not exist (first time this is loaded, most likely),
// we can create it with a single call, which is a lot more efficient and thread friendly
- mesh = VS::get_singleton()->mesh_create_from_surfaces(surface_data);
- VS::get_singleton()->mesh_set_blend_shape_mode(mesh, (VS::BlendShapeMode)blend_shape_mode);
+ mesh = RS::get_singleton()->mesh_create_from_surfaces(surface_data);
+ RS::get_singleton()->mesh_set_blend_shape_mode(mesh, (RS::BlendShapeMode)blend_shape_mode);
}
surfaces.clear();
@@ -1102,7 +1102,7 @@ void ArrayMesh::_recompute_aabb() {
#ifndef _MSC_VER
#warning need to add binding to add_surface using future MeshSurfaceData object
#endif
-void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes, const Vector<AABB> &p_bone_aabb, const Vector<VS::SurfaceData::LOD> &p_lods) {
+void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes, const Vector<AABB> &p_bone_aabb, const Vector<RS::SurfaceData::LOD> &p_lods) {
_create_if_empty();
@@ -1117,9 +1117,9 @@ void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const
surfaces.push_back(s);
_recompute_aabb();
- VS::SurfaceData sd;
+ RS::SurfaceData sd;
sd.format = p_format;
- sd.primitive = VS::PrimitiveType(p_primitive);
+ sd.primitive = RS::PrimitiveType(p_primitive);
sd.aabb = p_aabb;
sd.vertex_count = p_vertex_count;
sd.vertex_data = p_array;
@@ -1129,7 +1129,7 @@ void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const
sd.bone_aabbs = p_bone_aabb;
sd.lods = p_lods;
- VisualServer::get_singleton()->mesh_add_surface(mesh, sd);
+ RenderingServer::get_singleton()->mesh_add_surface(mesh, sd);
clear_cache();
_change_notify();
@@ -1140,9 +1140,9 @@ void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &
ERR_FAIL_COND(p_arrays.size() != ARRAY_MAX);
- VS::SurfaceData surface;
+ RS::SurfaceData surface;
- Error err = VS::get_singleton()->mesh_create_surface_data_from_arrays(&surface, (VisualServer::PrimitiveType)p_primitive, p_arrays, p_blend_shapes, p_lods, p_flags);
+ Error err = RS::get_singleton()->mesh_create_surface_data_from_arrays(&surface, (RenderingServer::PrimitiveType)p_primitive, p_arrays, p_blend_shapes, p_lods, p_flags);
ERR_FAIL_COND(err != OK);
/* print_line("format: " + itos(surface.format));
@@ -1159,16 +1159,16 @@ void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &
Array ArrayMesh::surface_get_arrays(int p_surface) const {
ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array());
- return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh, p_surface);
+ return RenderingServer::get_singleton()->mesh_surface_get_arrays(mesh, p_surface);
}
Array ArrayMesh::surface_get_blend_shape_arrays(int p_surface) const {
ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array());
- return VisualServer::get_singleton()->mesh_surface_get_blend_shape_arrays(mesh, p_surface);
+ return RenderingServer::get_singleton()->mesh_surface_get_blend_shape_arrays(mesh, p_surface);
}
Dictionary ArrayMesh::surface_get_lods(int p_surface) const {
ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Dictionary());
- return VisualServer::get_singleton()->mesh_surface_get_lods(mesh, p_surface);
+ return RenderingServer::get_singleton()->mesh_surface_get_lods(mesh, p_surface);
}
int ArrayMesh::get_surface_count() const {
@@ -1193,7 +1193,7 @@ void ArrayMesh::add_blend_shape(const StringName &p_name) {
}
blend_shapes.push_back(name);
- //VS::get_singleton()->mesh_set_blend_shape_count(mesh, blend_shapes.size());
+ //RS::get_singleton()->mesh_set_blend_shape_count(mesh, blend_shapes.size());
}
int ArrayMesh::get_blend_shape_count() const {
@@ -1215,7 +1215,7 @@ void ArrayMesh::set_blend_shape_mode(BlendShapeMode p_mode) {
blend_shape_mode = p_mode;
if (mesh.is_valid()) {
- VS::get_singleton()->mesh_set_blend_shape_mode(mesh, (VS::BlendShapeMode)p_mode);
+ RS::get_singleton()->mesh_set_blend_shape_mode(mesh, (RS::BlendShapeMode)p_mode);
}
}
@@ -1254,7 +1254,7 @@ void ArrayMesh::surface_set_material(int p_idx, const Ref<Material> &p_material)
if (surfaces[p_idx].material == p_material)
return;
surfaces.write[p_idx].material = p_material;
- VisualServer::get_singleton()->mesh_surface_set_material(mesh, p_idx, p_material.is_null() ? RID() : p_material->get_rid());
+ RenderingServer::get_singleton()->mesh_surface_set_material(mesh, p_idx, p_material.is_null() ? RID() : p_material->get_rid());
_change_notify("material");
emit_changed();
@@ -1286,7 +1286,7 @@ String ArrayMesh::surface_get_name(int p_idx) const {
void ArrayMesh::surface_update_region(int p_surface, int p_offset, const Vector<uint8_t> &p_data) {
ERR_FAIL_INDEX(p_surface, surfaces.size());
- VS::get_singleton()->mesh_surface_update_region(mesh, p_surface, p_offset, p_data);
+ RS::get_singleton()->mesh_surface_update_region(mesh, p_surface, p_offset, p_data);
emit_changed();
}
@@ -1318,7 +1318,7 @@ void ArrayMesh::clear_surfaces() {
if (!mesh.is_valid()) {
return;
}
- VS::get_singleton()->mesh_clear(mesh);
+ RS::get_singleton()->mesh_clear(mesh);
surfaces.clear();
aabb = AABB();
}
@@ -1327,7 +1327,7 @@ void ArrayMesh::set_custom_aabb(const AABB &p_custom) {
_create_if_empty();
custom_aabb = p_custom;
- VS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
+ RS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
emit_changed();
}
@@ -1609,7 +1609,7 @@ void ArrayMesh::_bind_methods() {
}
void ArrayMesh::reload_from_file() {
- VisualServer::get_singleton()->mesh_clear(mesh);
+ RenderingServer::get_singleton()->mesh_clear(mesh);
surfaces.clear();
clear_blend_shapes();
clear_cache();
@@ -1622,13 +1622,13 @@ void ArrayMesh::reload_from_file() {
ArrayMesh::ArrayMesh() {
//mesh is now created on demand
- //mesh = VisualServer::get_singleton()->mesh_create();
+ //mesh = RenderingServer::get_singleton()->mesh_create();
blend_shape_mode = BLEND_SHAPE_MODE_RELATIVE;
}
ArrayMesh::~ArrayMesh() {
if (mesh.is_valid()) {
- VisualServer::get_singleton()->free(mesh);
+ RenderingServer::get_singleton()->free(mesh);
}
}
diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h
index e5f87dbbe5..25a9722046 100644
--- a/scene/resources/mesh.h
+++ b/scene/resources/mesh.h
@@ -36,7 +36,7 @@
#include "core/resource.h"
#include "scene/resources/material.h"
#include "scene/resources/shape_3d.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class Mesh : public Resource {
GDCLASS(Mesh, Resource);
@@ -51,22 +51,22 @@ protected:
public:
enum {
- NO_INDEX_ARRAY = VisualServer::NO_INDEX_ARRAY,
- ARRAY_WEIGHTS_SIZE = VisualServer::ARRAY_WEIGHTS_SIZE
+ NO_INDEX_ARRAY = RenderingServer::NO_INDEX_ARRAY,
+ ARRAY_WEIGHTS_SIZE = RenderingServer::ARRAY_WEIGHTS_SIZE
};
enum ArrayType {
- ARRAY_VERTEX = VisualServer::ARRAY_VERTEX,
- ARRAY_NORMAL = VisualServer::ARRAY_NORMAL,
- ARRAY_TANGENT = VisualServer::ARRAY_TANGENT,
- ARRAY_COLOR = VisualServer::ARRAY_COLOR,
- ARRAY_TEX_UV = VisualServer::ARRAY_TEX_UV,
- ARRAY_TEX_UV2 = VisualServer::ARRAY_TEX_UV2,
- ARRAY_BONES = VisualServer::ARRAY_BONES,
- ARRAY_WEIGHTS = VisualServer::ARRAY_WEIGHTS,
- ARRAY_INDEX = VisualServer::ARRAY_INDEX,
- ARRAY_MAX = VisualServer::ARRAY_MAX
+ ARRAY_VERTEX = RenderingServer::ARRAY_VERTEX,
+ ARRAY_NORMAL = RenderingServer::ARRAY_NORMAL,
+ ARRAY_TANGENT = RenderingServer::ARRAY_TANGENT,
+ ARRAY_COLOR = RenderingServer::ARRAY_COLOR,
+ ARRAY_TEX_UV = RenderingServer::ARRAY_TEX_UV,
+ ARRAY_TEX_UV2 = RenderingServer::ARRAY_TEX_UV2,
+ ARRAY_BONES = RenderingServer::ARRAY_BONES,
+ ARRAY_WEIGHTS = RenderingServer::ARRAY_WEIGHTS,
+ ARRAY_INDEX = RenderingServer::ARRAY_INDEX,
+ ARRAY_MAX = RenderingServer::ARRAY_MAX
};
@@ -98,18 +98,18 @@ public:
};
enum PrimitiveType {
- PRIMITIVE_POINTS = VisualServer::PRIMITIVE_POINTS,
- PRIMITIVE_LINES = VisualServer::PRIMITIVE_LINES,
- PRIMITIVE_LINE_STRIP = VisualServer::PRIMITIVE_LINE_STRIP,
- PRIMITIVE_TRIANGLES = VisualServer::PRIMITIVE_TRIANGLES,
- PRIMITIVE_TRIANGLE_STRIP = VisualServer::PRIMITIVE_TRIANGLE_STRIP,
- PRIMITIVE_MAX = VisualServer::PRIMITIVE_MAX,
+ PRIMITIVE_POINTS = RenderingServer::PRIMITIVE_POINTS,
+ PRIMITIVE_LINES = RenderingServer::PRIMITIVE_LINES,
+ PRIMITIVE_LINE_STRIP = RenderingServer::PRIMITIVE_LINE_STRIP,
+ PRIMITIVE_TRIANGLES = RenderingServer::PRIMITIVE_TRIANGLES,
+ PRIMITIVE_TRIANGLE_STRIP = RenderingServer::PRIMITIVE_TRIANGLE_STRIP,
+ PRIMITIVE_MAX = RenderingServer::PRIMITIVE_MAX,
};
enum BlendShapeMode {
- BLEND_SHAPE_MODE_NORMALIZED = VS::BLEND_SHAPE_MODE_NORMALIZED,
- BLEND_SHAPE_MODE_RELATIVE = VS::BLEND_SHAPE_MODE_RELATIVE,
+ BLEND_SHAPE_MODE_NORMALIZED = RS::BLEND_SHAPE_MODE_NORMALIZED,
+ BLEND_SHAPE_MODE_RELATIVE = RS::BLEND_SHAPE_MODE_RELATIVE,
};
virtual int get_surface_count() const = 0;
@@ -193,7 +193,7 @@ protected:
public:
void add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes = Array(), const Dictionary &p_lods = Dictionary(), uint32_t p_flags = ARRAY_COMPRESS_DEFAULT);
- void add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes = Vector<Vector<uint8_t>>(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>(), const Vector<VS::SurfaceData::LOD> &p_lods = Vector<VS::SurfaceData::LOD>());
+ void add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t>> &p_blend_shapes = Vector<Vector<uint8_t>>(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>(), const Vector<RS::SurfaceData::LOD> &p_lods = Vector<RS::SurfaceData::LOD>());
Array surface_get_arrays(int p_surface) const;
Array surface_get_blend_shape_arrays(int p_surface) const;
diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp
index aa8be326f5..ce561bfaaf 100644
--- a/scene/resources/multimesh.cpp
+++ b/scene/resources/multimesh.cpp
@@ -30,7 +30,7 @@
#include "multimesh.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#ifndef DISABLE_DEPRECATED
// Kept for compatibility from 3.x to 4.0.
@@ -198,20 +198,20 @@ Vector<Color> MultiMesh::_get_custom_data_array() const {
#endif // DISABLE_DEPRECATED
void MultiMesh::set_buffer(const Vector<float> &p_buffer) {
- VS::get_singleton()->multimesh_set_buffer(multimesh, p_buffer);
+ RS::get_singleton()->multimesh_set_buffer(multimesh, p_buffer);
}
Vector<float> MultiMesh::get_buffer() const {
- return VS::get_singleton()->multimesh_get_buffer(multimesh);
+ return RS::get_singleton()->multimesh_get_buffer(multimesh);
}
void MultiMesh::set_mesh(const Ref<Mesh> &p_mesh) {
mesh = p_mesh;
if (!mesh.is_null())
- VisualServer::get_singleton()->multimesh_set_mesh(multimesh, mesh->get_rid());
+ RenderingServer::get_singleton()->multimesh_set_mesh(multimesh, mesh->get_rid());
else
- VisualServer::get_singleton()->multimesh_set_mesh(multimesh, RID());
+ RenderingServer::get_singleton()->multimesh_set_mesh(multimesh, RID());
}
Ref<Mesh> MultiMesh::get_mesh() const {
@@ -221,7 +221,7 @@ Ref<Mesh> MultiMesh::get_mesh() const {
void MultiMesh::set_instance_count(int p_count) {
ERR_FAIL_COND(p_count < 0);
- VisualServer::get_singleton()->multimesh_allocate(multimesh, p_count, VS::MultimeshTransformFormat(transform_format), use_colors, use_custom_data);
+ RenderingServer::get_singleton()->multimesh_allocate(multimesh, p_count, RS::MultimeshTransformFormat(transform_format), use_colors, use_custom_data);
instance_count = p_count;
}
int MultiMesh::get_instance_count() const {
@@ -232,7 +232,7 @@ int MultiMesh::get_instance_count() const {
void MultiMesh::set_visible_instance_count(int p_count) {
ERR_FAIL_COND(p_count < -1);
ERR_FAIL_COND(p_count > instance_count);
- VisualServer::get_singleton()->multimesh_set_visible_instances(multimesh, p_count);
+ RenderingServer::get_singleton()->multimesh_set_visible_instances(multimesh, p_count);
visible_instance_count = p_count;
}
int MultiMesh::get_visible_instance_count() const {
@@ -242,45 +242,45 @@ int MultiMesh::get_visible_instance_count() const {
void MultiMesh::set_instance_transform(int p_instance, const Transform &p_transform) {
- VisualServer::get_singleton()->multimesh_instance_set_transform(multimesh, p_instance, p_transform);
+ RenderingServer::get_singleton()->multimesh_instance_set_transform(multimesh, p_instance, p_transform);
}
void MultiMesh::set_instance_transform_2d(int p_instance, const Transform2D &p_transform) {
- VisualServer::get_singleton()->multimesh_instance_set_transform_2d(multimesh, p_instance, p_transform);
+ RenderingServer::get_singleton()->multimesh_instance_set_transform_2d(multimesh, p_instance, p_transform);
}
Transform MultiMesh::get_instance_transform(int p_instance) const {
- return VisualServer::get_singleton()->multimesh_instance_get_transform(multimesh, p_instance);
+ return RenderingServer::get_singleton()->multimesh_instance_get_transform(multimesh, p_instance);
}
Transform2D MultiMesh::get_instance_transform_2d(int p_instance) const {
- return VisualServer::get_singleton()->multimesh_instance_get_transform_2d(multimesh, p_instance);
+ return RenderingServer::get_singleton()->multimesh_instance_get_transform_2d(multimesh, p_instance);
}
void MultiMesh::set_instance_color(int p_instance, const Color &p_color) {
- VisualServer::get_singleton()->multimesh_instance_set_color(multimesh, p_instance, p_color);
+ RenderingServer::get_singleton()->multimesh_instance_set_color(multimesh, p_instance, p_color);
}
Color MultiMesh::get_instance_color(int p_instance) const {
- return VisualServer::get_singleton()->multimesh_instance_get_color(multimesh, p_instance);
+ return RenderingServer::get_singleton()->multimesh_instance_get_color(multimesh, p_instance);
}
void MultiMesh::set_instance_custom_data(int p_instance, const Color &p_custom_data) {
- VisualServer::get_singleton()->multimesh_instance_set_custom_data(multimesh, p_instance, p_custom_data);
+ RenderingServer::get_singleton()->multimesh_instance_set_custom_data(multimesh, p_instance, p_custom_data);
}
Color MultiMesh::get_instance_custom_data(int p_instance) const {
- return VisualServer::get_singleton()->multimesh_instance_get_custom_data(multimesh, p_instance);
+ return RenderingServer::get_singleton()->multimesh_instance_get_custom_data(multimesh, p_instance);
}
AABB MultiMesh::get_aabb() const {
- return VisualServer::get_singleton()->multimesh_get_aabb(multimesh);
+ return RenderingServer::get_singleton()->multimesh_get_aabb(multimesh);
}
RID MultiMesh::get_rid() const {
@@ -375,7 +375,7 @@ void MultiMesh::_bind_methods() {
MultiMesh::MultiMesh() {
- multimesh = VisualServer::get_singleton()->multimesh_create();
+ multimesh = RenderingServer::get_singleton()->multimesh_create();
use_colors = false;
use_custom_data = false;
transform_format = TRANSFORM_2D;
@@ -385,5 +385,5 @@ MultiMesh::MultiMesh() {
MultiMesh::~MultiMesh() {
- VisualServer::get_singleton()->free(multimesh);
+ RenderingServer::get_singleton()->free(multimesh);
}
diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h
index 8ca30a5b88..c1e52bc981 100644
--- a/scene/resources/multimesh.h
+++ b/scene/resources/multimesh.h
@@ -32,7 +32,7 @@
#define MULTIMESH_H
#include "scene/resources/mesh.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class MultiMesh : public Resource {
@@ -41,8 +41,8 @@ class MultiMesh : public Resource {
public:
enum TransformFormat {
- TRANSFORM_2D = VS::MULTIMESH_TRANSFORM_2D,
- TRANSFORM_3D = VS::MULTIMESH_TRANSFORM_3D
+ TRANSFORM_2D = RS::MULTIMESH_TRANSFORM_2D,
+ TRANSFORM_3D = RS::MULTIMESH_TRANSFORM_3D
};
private:
diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp
index f18e8956f1..63766c1756 100644
--- a/scene/resources/particles_material.cpp
+++ b/scene/resources/particles_material.cpp
@@ -121,7 +121,7 @@ void ParticlesMaterial::_update_shader() {
shader_map[current_key].users--;
if (shader_map[current_key].users == 0) {
//deallocate shader, as it's no longer in use
- VS::get_singleton()->free(shader_map[current_key].shader);
+ RS::get_singleton()->free(shader_map[current_key].shader);
shader_map.erase(current_key);
}
}
@@ -130,7 +130,7 @@ void ParticlesMaterial::_update_shader() {
if (shader_map.has(mk)) {
- VS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader_map[mk].shader);
shader_map[mk].users++;
return;
}
@@ -592,14 +592,14 @@ void ParticlesMaterial::_update_shader() {
code += "\n";
ShaderData shader_data;
- shader_data.shader = VS::get_singleton()->shader_create();
+ shader_data.shader = RS::get_singleton()->shader_create();
shader_data.users = 1;
- VS::get_singleton()->shader_set_code(shader_data.shader, code);
+ RS::get_singleton()->shader_set_code(shader_data.shader, code);
shader_map[mk] = shader_data;
- VS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
}
void ParticlesMaterial::flush_changes() {
@@ -631,7 +631,7 @@ bool ParticlesMaterial::_is_shader_dirty() const {
void ParticlesMaterial::set_direction(Vector3 p_direction) {
direction = p_direction;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->direction, direction);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->direction, direction);
}
Vector3 ParticlesMaterial::get_direction() const {
@@ -642,7 +642,7 @@ Vector3 ParticlesMaterial::get_direction() const {
void ParticlesMaterial::set_spread(float p_spread) {
spread = p_spread;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->spread, p_spread);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->spread, p_spread);
}
float ParticlesMaterial::get_spread() const {
@@ -653,7 +653,7 @@ float ParticlesMaterial::get_spread() const {
void ParticlesMaterial::set_flatness(float p_flatness) {
flatness = p_flatness;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->flatness, p_flatness);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->flatness, p_flatness);
}
float ParticlesMaterial::get_flatness() const {
@@ -668,40 +668,40 @@ void ParticlesMaterial::set_param(Parameter p_param, float p_value) {
switch (p_param) {
case PARAM_INITIAL_LINEAR_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_linear_velocity, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_linear_velocity, p_value);
} break;
case PARAM_ANGULAR_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity, p_value);
} break;
case PARAM_ORBIT_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity, p_value);
} break;
case PARAM_LINEAR_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel, p_value);
} break;
case PARAM_RADIAL_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel, p_value);
} break;
case PARAM_TANGENTIAL_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel, p_value);
} break;
case PARAM_DAMPING: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->damping, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->damping, p_value);
} break;
case PARAM_ANGLE: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_angle, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_angle, p_value);
} break;
case PARAM_SCALE: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->scale, p_value);
} break;
case PARAM_HUE_VARIATION: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation, p_value);
} break;
case PARAM_ANIM_SPEED: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed, p_value);
} break;
case PARAM_ANIM_OFFSET: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset, p_value);
} break;
case PARAM_MAX: break; // Can't happen, but silences warning
}
@@ -721,40 +721,40 @@ void ParticlesMaterial::set_param_randomness(Parameter p_param, float p_value) {
switch (p_param) {
case PARAM_INITIAL_LINEAR_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_linear_velocity_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_linear_velocity_random, p_value);
} break;
case PARAM_ANGULAR_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_random, p_value);
} break;
case PARAM_ORBIT_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_random, p_value);
} break;
case PARAM_LINEAR_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel_random, p_value);
} break;
case PARAM_RADIAL_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel_random, p_value);
} break;
case PARAM_TANGENTIAL_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel_random, p_value);
} break;
case PARAM_DAMPING: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->damping_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->damping_random, p_value);
} break;
case PARAM_ANGLE: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_angle_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->initial_angle_random, p_value);
} break;
case PARAM_SCALE: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_random, p_value);
} break;
case PARAM_HUE_VARIATION: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation_random, p_value);
} break;
case PARAM_ANIM_SPEED: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed_random, p_value);
} break;
case PARAM_ANIM_OFFSET: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset_random, p_value);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset_random, p_value);
} break;
case PARAM_MAX: break; // Can't happen, but silences warning
}
@@ -786,47 +786,47 @@ void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture2D
//do none for this one
} break;
case PARAM_ANGULAR_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_texture, p_texture);
_adjust_curve_range(p_texture, -360, 360);
} break;
case PARAM_ORBIT_VELOCITY: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_texture, p_texture);
_adjust_curve_range(p_texture, -500, 500);
} break;
case PARAM_LINEAR_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->linear_accel_texture, p_texture);
_adjust_curve_range(p_texture, -200, 200);
} break;
case PARAM_RADIAL_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->radial_accel_texture, p_texture);
_adjust_curve_range(p_texture, -200, 200);
} break;
case PARAM_TANGENTIAL_ACCEL: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->tangent_accel_texture, p_texture);
_adjust_curve_range(p_texture, -200, 200);
} break;
case PARAM_DAMPING: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->damping_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->damping_texture, p_texture);
_adjust_curve_range(p_texture, 0, 100);
} break;
case PARAM_ANGLE: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->angle_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->angle_texture, p_texture);
_adjust_curve_range(p_texture, -360, 360);
} break;
case PARAM_SCALE: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_texture, p_texture);
_adjust_curve_range(p_texture, 0, 1);
} break;
case PARAM_HUE_VARIATION: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->hue_variation_texture, p_texture);
_adjust_curve_range(p_texture, -1, 1);
} break;
case PARAM_ANIM_SPEED: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_speed_texture, p_texture);
_adjust_curve_range(p_texture, 0, 200);
} break;
case PARAM_ANIM_OFFSET: {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset_texture, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->anim_offset_texture, p_texture);
} break;
case PARAM_MAX: break; // Can't happen, but silences warning
}
@@ -842,7 +842,7 @@ Ref<Texture2D> ParticlesMaterial::get_param_texture(Parameter p_param) const {
void ParticlesMaterial::set_color(const Color &p_color) {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->color, p_color);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color, p_color);
color = p_color;
}
@@ -854,7 +854,7 @@ Color ParticlesMaterial::get_color() const {
void ParticlesMaterial::set_color_ramp(const Ref<Texture2D> &p_texture) {
color_ramp = p_texture;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->color_ramp, p_texture);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_ramp, p_texture);
_queue_shader_change();
_change_notify();
}
@@ -888,38 +888,38 @@ void ParticlesMaterial::set_emission_shape(EmissionShape p_shape) {
void ParticlesMaterial::set_emission_sphere_radius(float p_radius) {
emission_sphere_radius = p_radius;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_sphere_radius, p_radius);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_sphere_radius, p_radius);
}
void ParticlesMaterial::set_emission_box_extents(Vector3 p_extents) {
emission_box_extents = p_extents;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_box_extents, p_extents);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_box_extents, p_extents);
}
void ParticlesMaterial::set_emission_point_texture(const Ref<Texture2D> &p_points) {
emission_point_texture = p_points;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, p_points);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, p_points);
}
void ParticlesMaterial::set_emission_normal_texture(const Ref<Texture2D> &p_normals) {
emission_normal_texture = p_normals;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, p_normals);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, p_normals);
}
void ParticlesMaterial::set_emission_color_texture(const Ref<Texture2D> &p_colors) {
emission_color_texture = p_colors;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, p_colors);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, p_colors);
_queue_shader_change();
}
void ParticlesMaterial::set_emission_point_count(int p_count) {
emission_point_count = p_count;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_point_count, p_count);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_point_count, p_count);
}
ParticlesMaterial::EmissionShape ParticlesMaterial::get_emission_shape() const {
@@ -957,7 +957,7 @@ int ParticlesMaterial::get_emission_point_count() const {
void ParticlesMaterial::set_trail_divisor(int p_divisor) {
trail_divisor = p_divisor;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor);
}
int ParticlesMaterial::get_trail_divisor() const {
@@ -974,7 +974,7 @@ void ParticlesMaterial::set_trail_size_modifier(const Ref<CurveTexture> &p_trail
curve->ensure_default_setup();
}
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_size_modifier, curve);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_size_modifier, curve);
_queue_shader_change();
}
@@ -986,7 +986,7 @@ Ref<CurveTexture> ParticlesMaterial::get_trail_size_modifier() const {
void ParticlesMaterial::set_trail_color_modifier(const Ref<GradientTexture> &p_trail_color_modifier) {
trail_color_modifier = p_trail_color_modifier;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_color_modifier, p_trail_color_modifier);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_color_modifier, p_trail_color_modifier);
_queue_shader_change();
}
@@ -1002,7 +1002,7 @@ void ParticlesMaterial::set_gravity(const Vector3 &p_gravity) {
if (gset == Vector3()) {
gset = Vector3(0, -0.000001, 0); //as gravity is used as upvector in some calculations
}
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->gravity, gset);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->gravity, gset);
}
Vector3 ParticlesMaterial::get_gravity() const {
@@ -1013,7 +1013,7 @@ Vector3 ParticlesMaterial::get_gravity() const {
void ParticlesMaterial::set_lifetime_randomness(float p_lifetime) {
lifetime_randomness = p_lifetime;
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->lifetime_randomness, lifetime_randomness);
+ RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->lifetime_randomness, lifetime_randomness);
}
float ParticlesMaterial::get_lifetime_randomness() const {
@@ -1280,10 +1280,10 @@ ParticlesMaterial::~ParticlesMaterial() {
shader_map[current_key].users--;
if (shader_map[current_key].users == 0) {
//deallocate shader, as it's no longer in use
- VS::get_singleton()->free(shader_map[current_key].shader);
+ RS::get_singleton()->free(shader_map[current_key].shader);
shader_map.erase(current_key);
}
- VS::get_singleton()->material_set_shader(_get_material(), RID());
+ RS::get_singleton()->material_set_shader(_get_material(), RID());
}
}
diff --git a/scene/resources/physics_material.h b/scene/resources/physics_material.h
index 2f7f4424b2..f4a77d9854 100644
--- a/scene/resources/physics_material.h
+++ b/scene/resources/physics_material.h
@@ -32,7 +32,7 @@
#define physics_material_override_H
#include "core/resource.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
class PhysicsMaterial : public Resource {
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index 959ee214a2..0792af2143 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "primitive_meshes.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
/**
PrimitiveMesh
@@ -37,10 +37,10 @@
void PrimitiveMesh::_update() const {
Array arr;
- arr.resize(VS::ARRAY_MAX);
+ arr.resize(RS::ARRAY_MAX);
_create_mesh_array(arr);
- Vector<Vector3> points = arr[VS::ARRAY_VERTEX];
+ Vector<Vector3> points = arr[RS::ARRAY_VERTEX];
aabb = AABB();
@@ -57,10 +57,10 @@ void PrimitiveMesh::_update() const {
}
}
- Vector<int> indices = arr[VS::ARRAY_INDEX];
+ Vector<int> indices = arr[RS::ARRAY_INDEX];
if (flip_faces) {
- Vector<Vector3> normals = arr[VS::ARRAY_NORMAL];
+ Vector<Vector3> normals = arr[RS::ARRAY_NORMAL];
if (normals.size() && indices.size()) {
@@ -79,17 +79,17 @@ void PrimitiveMesh::_update() const {
SWAP(w[i + 0], w[i + 1]);
}
}
- arr[VS::ARRAY_NORMAL] = normals;
- arr[VS::ARRAY_INDEX] = indices;
+ arr[RS::ARRAY_NORMAL] = normals;
+ arr[RS::ARRAY_INDEX] = indices;
}
}
array_len = pc;
index_array_len = indices.size();
// in with the new
- VisualServer::get_singleton()->mesh_clear(mesh);
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(mesh, (VisualServer::PrimitiveType)primitive_type, arr);
- VisualServer::get_singleton()->mesh_surface_set_material(mesh, 0, material.is_null() ? RID() : material->get_rid());
+ RenderingServer::get_singleton()->mesh_clear(mesh);
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(mesh, (RenderingServer::PrimitiveType)primitive_type, arr);
+ RenderingServer::get_singleton()->mesh_surface_set_material(mesh, 0, material.is_null() ? RID() : material->get_rid());
pending_request = false;
@@ -136,7 +136,7 @@ Array PrimitiveMesh::surface_get_arrays(int p_surface) const {
_update();
}
- return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh, 0);
+ return RenderingServer::get_singleton()->mesh_surface_get_arrays(mesh, 0);
}
Dictionary PrimitiveMesh::surface_get_lods(int p_surface) const {
@@ -150,7 +150,7 @@ Array PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) const {
uint32_t PrimitiveMesh::surface_get_format(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, 1, 0);
- return VS::ARRAY_FORMAT_VERTEX | VS::ARRAY_FORMAT_NORMAL | VS::ARRAY_FORMAT_TANGENT | VS::ARRAY_FORMAT_TEX_UV | VS::ARRAY_FORMAT_INDEX | VS::ARRAY_COMPRESS_DEFAULT;
+ return RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_NORMAL | RS::ARRAY_FORMAT_TANGENT | RS::ARRAY_FORMAT_TEX_UV | RS::ARRAY_FORMAT_INDEX | RS::ARRAY_COMPRESS_DEFAULT;
}
Mesh::PrimitiveType PrimitiveMesh::surface_get_primitive_type(int p_idx) const {
@@ -215,7 +215,7 @@ void PrimitiveMesh::set_material(const Ref<Material> &p_material) {
material = p_material;
if (!pending_request) {
// just apply it, else it'll happen when _update is called.
- VisualServer::get_singleton()->mesh_surface_set_material(mesh, 0, material.is_null() ? RID() : material->get_rid());
+ RenderingServer::get_singleton()->mesh_surface_set_material(mesh, 0, material.is_null() ? RID() : material->get_rid());
_change_notify();
emit_changed();
};
@@ -232,7 +232,7 @@ Array PrimitiveMesh::get_mesh_arrays() const {
void PrimitiveMesh::set_custom_aabb(const AABB &p_custom) {
custom_aabb = p_custom;
- VS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
+ RS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
emit_changed();
}
@@ -254,7 +254,7 @@ PrimitiveMesh::PrimitiveMesh() {
flip_faces = false;
// defaults
- mesh = VisualServer::get_singleton()->mesh_create();
+ mesh = RenderingServer::get_singleton()->mesh_create();
// assume primitive triangles as the type, correct for all but one and it will change this :)
primitive_type = Mesh::PRIMITIVE_TRIANGLES;
@@ -267,7 +267,7 @@ PrimitiveMesh::PrimitiveMesh() {
}
PrimitiveMesh::~PrimitiveMesh() {
- VisualServer::get_singleton()->free(mesh);
+ RenderingServer::get_singleton()->free(mesh);
}
/**
@@ -413,11 +413,11 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const {
thisrow = point;
};
- p_arr[VS::ARRAY_VERTEX] = points;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
- p_arr[VS::ARRAY_INDEX] = indices;
+ p_arr[RS::ARRAY_VERTEX] = points;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_INDEX] = indices;
}
void CapsuleMesh::_bind_methods() {
@@ -670,11 +670,11 @@ void CubeMesh::_create_mesh_array(Array &p_arr) const {
thisrow = point;
};
- p_arr[VS::ARRAY_VERTEX] = points;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
- p_arr[VS::ARRAY_INDEX] = indices;
+ p_arr[RS::ARRAY_VERTEX] = points;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_INDEX] = indices;
}
void CubeMesh::_bind_methods() {
@@ -871,11 +871,11 @@ void CylinderMesh::_create_mesh_array(Array &p_arr) const {
};
};
- p_arr[VS::ARRAY_VERTEX] = points;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
- p_arr[VS::ARRAY_INDEX] = indices;
+ p_arr[RS::ARRAY_VERTEX] = points;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_INDEX] = indices;
}
void CylinderMesh::_bind_methods() {
@@ -1010,11 +1010,11 @@ void PlaneMesh::_create_mesh_array(Array &p_arr) const {
thisrow = point;
};
- p_arr[VS::ARRAY_VERTEX] = points;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
- p_arr[VS::ARRAY_INDEX] = indices;
+ p_arr[RS::ARRAY_VERTEX] = points;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_INDEX] = indices;
}
void PlaneMesh::_bind_methods() {
@@ -1270,11 +1270,11 @@ void PrismMesh::_create_mesh_array(Array &p_arr) const {
thisrow = point;
};
- p_arr[VS::ARRAY_VERTEX] = points;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
- p_arr[VS::ARRAY_INDEX] = indices;
+ p_arr[RS::ARRAY_VERTEX] = points;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_INDEX] = indices;
}
void PrismMesh::_bind_methods() {
@@ -1401,10 +1401,10 @@ void QuadMesh::_create_mesh_array(Array &p_arr) const {
uvs.set(i, quad_uv[j]);
}
- p_arr[VS::ARRAY_VERTEX] = faces;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_VERTEX] = faces;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
}
void QuadMesh::_bind_methods() {
@@ -1494,11 +1494,11 @@ void SphereMesh::_create_mesh_array(Array &p_arr) const {
thisrow = point;
};
- p_arr[VS::ARRAY_VERTEX] = points;
- p_arr[VS::ARRAY_NORMAL] = normals;
- p_arr[VS::ARRAY_TANGENT] = tangents;
- p_arr[VS::ARRAY_TEX_UV] = uvs;
- p_arr[VS::ARRAY_INDEX] = indices;
+ p_arr[RS::ARRAY_VERTEX] = points;
+ p_arr[RS::ARRAY_NORMAL] = normals;
+ p_arr[RS::ARRAY_TANGENT] = tangents;
+ p_arr[RS::ARRAY_TEX_UV] = uvs;
+ p_arr[RS::ARRAY_INDEX] = indices;
}
void SphereMesh::_bind_methods() {
@@ -1585,7 +1585,7 @@ void PointMesh::_create_mesh_array(Array &p_arr) const {
faces.resize(1);
faces.set(0, Vector3(0.0, 0.0, 0.0));
- p_arr[VS::ARRAY_VERTEX] = faces;
+ p_arr[RS::ARRAY_VERTEX] = faces;
}
PointMesh::PointMesh() {
diff --git a/scene/resources/ray_shape_3d.cpp b/scene/resources/ray_shape_3d.cpp
index ad927afd58..0211c55f46 100644
--- a/scene/resources/ray_shape_3d.cpp
+++ b/scene/resources/ray_shape_3d.cpp
@@ -30,7 +30,7 @@
#include "ray_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> RayShape3D::get_debug_mesh_lines() {
@@ -50,7 +50,7 @@ void RayShape3D::_update_shape() {
Dictionary d;
d["length"] = length;
d["slips_on_slope"] = slips_on_slope;
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), d);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), d);
Shape3D::_update_shape();
}
@@ -92,7 +92,7 @@ void RayShape3D::_bind_methods() {
}
RayShape3D::RayShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_RAY)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_RAY)) {
length = 1.0;
slips_on_slope = false;
diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp
index f8c8ffb289..19e72a65b0 100644
--- a/scene/resources/rectangle_shape_2d.cpp
+++ b/scene/resources/rectangle_shape_2d.cpp
@@ -30,11 +30,11 @@
#include "rectangle_shape_2d.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
void RectangleShape2D::_update_shape() {
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), extents);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), extents);
emit_changed();
}
@@ -51,7 +51,7 @@ Vector2 RectangleShape2D::get_extents() const {
void RectangleShape2D::draw(const RID &p_to_rid, const Color &p_color) {
- VisualServer::get_singleton()->canvas_item_add_rect(p_to_rid, Rect2(-extents, extents * 2.0), p_color);
+ RenderingServer::get_singleton()->canvas_item_add_rect(p_to_rid, Rect2(-extents, extents * 2.0), p_color);
}
Rect2 RectangleShape2D::get_rect() const {
@@ -72,7 +72,7 @@ void RectangleShape2D::_bind_methods() {
}
RectangleShape2D::RectangleShape2D() :
- Shape2D(Physics2DServer::get_singleton()->rectangle_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->rectangle_shape_create()) {
extents = Vector2(10, 10);
_update_shape();
diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp
index 2e78a4fccf..814c349784 100644
--- a/scene/resources/segment_shape_2d.cpp
+++ b/scene/resources/segment_shape_2d.cpp
@@ -30,8 +30,8 @@
#include "segment_shape_2d.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
bool SegmentShape2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
@@ -45,7 +45,7 @@ void SegmentShape2D::_update_shape() {
Rect2 r;
r.position = a;
r.size = b;
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), r);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), r);
emit_changed();
}
@@ -71,7 +71,7 @@ Vector2 SegmentShape2D::get_b() const {
void SegmentShape2D::draw(const RID &p_to_rid, const Color &p_color) {
- VisualServer::get_singleton()->canvas_item_add_line(p_to_rid, a, b, p_color, 3);
+ RenderingServer::get_singleton()->canvas_item_add_line(p_to_rid, a, b, p_color, 3);
}
Rect2 SegmentShape2D::get_rect() const {
@@ -99,7 +99,7 @@ void SegmentShape2D::_bind_methods() {
}
SegmentShape2D::SegmentShape2D() :
- Shape2D(Physics2DServer::get_singleton()->segment_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->segment_shape_create()) {
a = Vector2();
b = Vector2(0, 10);
@@ -113,14 +113,14 @@ void RayShape2D::_update_shape() {
Dictionary d;
d["length"] = length;
d["slips_on_slope"] = slips_on_slope;
- Physics2DServer::get_singleton()->shape_set_data(get_rid(), d);
+ PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), d);
emit_changed();
}
void RayShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Vector2 tip = Vector2(0, get_length());
- VS::get_singleton()->canvas_item_add_line(p_to_rid, Vector2(), tip, p_color, 3);
+ RS::get_singleton()->canvas_item_add_line(p_to_rid, Vector2(), tip, p_color, 3);
Vector<Vector2> pts;
float tsize = 4;
pts.push_back(tip + Vector2(0, tsize));
@@ -130,7 +130,7 @@ void RayShape2D::draw(const RID &p_to_rid, const Color &p_color) {
for (int i = 0; i < 3; i++)
cols.push_back(p_color);
- VS::get_singleton()->canvas_item_add_primitive(p_to_rid, pts, cols, Vector<Point2>(), RID());
+ RS::get_singleton()->canvas_item_add_primitive(p_to_rid, pts, cols, Vector<Point2>(), RID());
}
Rect2 RayShape2D::get_rect() const {
@@ -179,7 +179,7 @@ bool RayShape2D::get_slips_on_slope() const {
}
RayShape2D::RayShape2D() :
- Shape2D(Physics2DServer::get_singleton()->ray_shape_create()) {
+ Shape2D(PhysicsServer2D::get_singleton()->ray_shape_create()) {
length = 20;
slips_on_slope = false;
diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp
index 47f6d673ae..a62e7ded16 100644
--- a/scene/resources/shader.cpp
+++ b/scene/resources/shader.cpp
@@ -31,8 +31,8 @@
#include "shader.h"
#include "core/os/file_access.h"
#include "scene/scene_string_names.h"
-#include "servers/visual/shader_language.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/shader_language.h"
+#include "servers/rendering_server.h"
#include "texture.h"
Shader::Mode Shader::get_mode() const {
@@ -54,7 +54,7 @@ void Shader::set_code(const String &p_code) {
mode = MODE_SPATIAL;
}
- VisualServer::get_singleton()->shader_set_code(shader, p_code);
+ RenderingServer::get_singleton()->shader_set_code(shader, p_code);
params_cache_dirty = true;
emit_changed();
@@ -63,7 +63,7 @@ void Shader::set_code(const String &p_code) {
String Shader::get_code() const {
_update_shader();
- return VisualServer::get_singleton()->shader_get_code(shader);
+ return RenderingServer::get_singleton()->shader_get_code(shader);
}
void Shader::get_param_list(List<PropertyInfo> *p_params) const {
@@ -71,7 +71,7 @@ void Shader::get_param_list(List<PropertyInfo> *p_params) const {
_update_shader();
List<PropertyInfo> local;
- VisualServer::get_singleton()->shader_get_param_list(shader, &local);
+ RenderingServer::get_singleton()->shader_get_param_list(shader, &local);
params_cache.clear();
params_cache_dirty = false;
@@ -104,10 +104,10 @@ void Shader::set_default_texture_param(const StringName &p_param, const Ref<Text
if (p_texture.is_valid()) {
default_textures[p_param] = p_texture;
- VS::get_singleton()->shader_set_default_texture_param(shader, p_param, p_texture->get_rid());
+ RS::get_singleton()->shader_set_default_texture_param(shader, p_param, p_texture->get_rid());
} else {
default_textures.erase(p_param);
- VS::get_singleton()->shader_set_default_texture_param(shader, p_param, RID());
+ RS::get_singleton()->shader_set_default_texture_param(shader, p_param, RID());
}
emit_changed();
@@ -166,13 +166,13 @@ void Shader::_bind_methods() {
Shader::Shader() {
mode = MODE_SPATIAL;
- shader = VisualServer::get_singleton()->shader_create();
+ shader = RenderingServer::get_singleton()->shader_create();
params_cache_dirty = true;
}
Shader::~Shader() {
- VisualServer::get_singleton()->free(shader);
+ RenderingServer::get_singleton()->free(shader);
}
////////////
diff --git a/scene/resources/shader.h b/scene/resources/shader.h
index 5804fe8fef..e65457ed76 100644
--- a/scene/resources/shader.h
+++ b/scene/resources/shader.h
@@ -56,7 +56,7 @@ private:
Mode mode;
// hack the name of performance
- // shaders keep a list of ShaderMaterial -> VisualServer name translations, to make
+ // shaders keep a list of ShaderMaterial -> RenderingServer name translations, to make
// conversion fast and save memory.
mutable bool params_cache_dirty;
mutable Map<StringName, StringName> params_cache; //map a shader param to a material param..
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp
index 64930c3117..7984dadbc5 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/shape_2d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "shape_2d.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
RID Shape2D::get_rid() const {
return shape;
@@ -38,7 +38,7 @@ RID Shape2D::get_rid() const {
void Shape2D::set_custom_solver_bias(real_t p_bias) {
custom_bias = p_bias;
- Physics2DServer::get_singleton()->shape_set_custom_solver_bias(shape, custom_bias);
+ PhysicsServer2D::get_singleton()->shape_set_custom_solver_bias(shape, custom_bias);
}
real_t Shape2D::get_custom_solver_bias() const {
@@ -50,13 +50,13 @@ bool Shape2D::collide_with_motion(const Transform2D &p_local_xform, const Vector
ERR_FAIL_COND_V(p_shape.is_null(), false);
int r;
- return Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, NULL, 0, r);
+ return PhysicsServer2D::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, NULL, 0, r);
}
bool Shape2D::collide(const Transform2D &p_local_xform, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform) {
ERR_FAIL_COND_V(p_shape.is_null(), false);
int r;
- return Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, Vector2(), p_shape->get_rid(), p_shape_xform, Vector2(), NULL, 0, r);
+ return PhysicsServer2D::get_singleton()->shape_collide(get_rid(), p_local_xform, Vector2(), p_shape->get_rid(), p_shape_xform, Vector2(), NULL, 0, r);
}
Array Shape2D::collide_with_motion_and_get_contacts(const Transform2D &p_local_xform, const Vector2 &p_local_motion, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform, const Vector2 &p_shape_motion) {
@@ -66,7 +66,7 @@ Array Shape2D::collide_with_motion_and_get_contacts(const Transform2D &p_local_x
Vector2 result[max_contacts * 2];
int contacts = 0;
- if (!Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, result, max_contacts, contacts))
+ if (!PhysicsServer2D::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, result, max_contacts, contacts))
return Array();
Array results;
@@ -84,7 +84,7 @@ Array Shape2D::collide_and_get_contacts(const Transform2D &p_local_xform, const
Vector2 result[max_contacts * 2];
int contacts = 0;
- if (!Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, Vector2(), p_shape->get_rid(), p_shape_xform, Vector2(), result, max_contacts, contacts))
+ if (!PhysicsServer2D::get_singleton()->shape_collide(get_rid(), p_local_xform, Vector2(), p_shape->get_rid(), p_shape_xform, Vector2(), result, max_contacts, contacts))
return Array();
Array results;
@@ -115,5 +115,5 @@ Shape2D::Shape2D(const RID &p_rid) {
Shape2D::~Shape2D() {
- Physics2DServer::get_singleton()->free(shape);
+ PhysicsServer2D::get_singleton()->free(shape);
}
diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp
index c3aeba857a..f4a5d91e52 100644
--- a/scene/resources/shape_3d.cpp
+++ b/scene/resources/shape_3d.cpp
@@ -33,7 +33,7 @@
#include "core/os/os.h"
#include "scene/main/scene_tree.h"
#include "scene/resources/mesh.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
void Shape3D::add_vertices_to_array(Vector<Vector3> &array, const Transform &p_xform) {
@@ -56,7 +56,7 @@ real_t Shape3D::get_margin() const {
void Shape3D::set_margin(real_t p_margin) {
margin = p_margin;
- PhysicsServer::get_singleton()->shape_set_margin(shape, margin);
+ PhysicsServer3D::get_singleton()->shape_set_margin(shape, margin);
}
Ref<ArrayMesh> Shape3D::get_debug_mesh() {
@@ -123,5 +123,5 @@ Shape3D::Shape3D(RID p_shape) :
Shape3D::~Shape3D() {
- PhysicsServer::get_singleton()->free(shape);
+ PhysicsServer3D::get_singleton()->free(shape);
}
diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp
index 1185b693b7..cbe86b16b2 100644
--- a/scene/resources/sky.cpp
+++ b/scene/resources/sky.cpp
@@ -39,7 +39,7 @@ void Sky::set_radiance_size(RadianceSize p_size) {
static const int size[RADIANCE_SIZE_MAX] = {
32, 64, 128, 256, 512, 1024, 2048
};
- VS::get_singleton()->sky_set_radiance_size(sky, size[radiance_size]);
+ RS::get_singleton()->sky_set_radiance_size(sky, size[radiance_size]);
}
Sky::RadianceSize Sky::get_radiance_size() const {
@@ -49,7 +49,7 @@ Sky::RadianceSize Sky::get_radiance_size() const {
void Sky::set_process_mode(ProcessMode p_mode) {
mode = p_mode;
- VS::get_singleton()->sky_set_mode(sky, VS::SkyMode(mode));
+ RS::get_singleton()->sky_set_mode(sky, RS::SkyMode(mode));
}
Sky::ProcessMode Sky::get_process_mode() const {
@@ -61,7 +61,7 @@ void Sky::set_material(const Ref<Material> &p_material) {
RID material_rid;
if (sky_material.is_valid())
material_rid = sky_material->get_rid();
- VS::get_singleton()->sky_set_material(sky, material_rid);
+ RS::get_singleton()->sky_set_material(sky, material_rid);
}
Ref<Material> Sky::get_material() const {
@@ -104,10 +104,10 @@ void Sky::_bind_methods() {
Sky::Sky() {
mode = PROCESS_MODE_QUALITY;
radiance_size = RADIANCE_SIZE_256;
- sky = VS::get_singleton()->sky_create();
+ sky = RS::get_singleton()->sky_create();
}
Sky::~Sky() {
- VS::get_singleton()->free(sky);
+ RS::get_singleton()->free(sky);
} \ No newline at end of file
diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp
index c3e51460c6..cf11da784d 100644
--- a/scene/resources/sky_material.cpp
+++ b/scene/resources/sky_material.cpp
@@ -33,7 +33,7 @@
void ProceduralSkyMaterial::set_sky_top_color(const Color &p_sky_top) {
sky_top_color = p_sky_top;
- VS::get_singleton()->material_set_param(_get_material(), "sky_top_color", sky_top_color.to_linear());
+ RS::get_singleton()->material_set_param(_get_material(), "sky_top_color", sky_top_color.to_linear());
}
Color ProceduralSkyMaterial::get_sky_top_color() const {
@@ -44,7 +44,7 @@ Color ProceduralSkyMaterial::get_sky_top_color() const {
void ProceduralSkyMaterial::set_sky_horizon_color(const Color &p_sky_horizon) {
sky_horizon_color = p_sky_horizon;
- VS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color.to_linear());
+ RS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color.to_linear());
}
Color ProceduralSkyMaterial::get_sky_horizon_color() const {
@@ -54,7 +54,7 @@ Color ProceduralSkyMaterial::get_sky_horizon_color() const {
void ProceduralSkyMaterial::set_sky_curve(float p_curve) {
sky_curve = p_curve;
- VS::get_singleton()->material_set_param(_get_material(), "sky_curve", sky_curve);
+ RS::get_singleton()->material_set_param(_get_material(), "sky_curve", sky_curve);
}
float ProceduralSkyMaterial::get_sky_curve() const {
@@ -64,7 +64,7 @@ float ProceduralSkyMaterial::get_sky_curve() const {
void ProceduralSkyMaterial::set_sky_energy(float p_energy) {
sky_energy = p_energy;
- VS::get_singleton()->material_set_param(_get_material(), "sky_energy", sky_energy);
+ RS::get_singleton()->material_set_param(_get_material(), "sky_energy", sky_energy);
}
float ProceduralSkyMaterial::get_sky_energy() const {
@@ -74,7 +74,7 @@ float ProceduralSkyMaterial::get_sky_energy() const {
void ProceduralSkyMaterial::set_ground_bottom_color(const Color &p_ground_bottom) {
ground_bottom_color = p_ground_bottom;
- VS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color.to_linear());
+ RS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color.to_linear());
}
Color ProceduralSkyMaterial::get_ground_bottom_color() const {
@@ -84,7 +84,7 @@ Color ProceduralSkyMaterial::get_ground_bottom_color() const {
void ProceduralSkyMaterial::set_ground_horizon_color(const Color &p_ground_horizon) {
ground_horizon_color = p_ground_horizon;
- VS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color.to_linear());
+ RS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color.to_linear());
}
Color ProceduralSkyMaterial::get_ground_horizon_color() const {
@@ -94,7 +94,7 @@ Color ProceduralSkyMaterial::get_ground_horizon_color() const {
void ProceduralSkyMaterial::set_ground_curve(float p_curve) {
ground_curve = p_curve;
- VS::get_singleton()->material_set_param(_get_material(), "ground_curve", ground_curve);
+ RS::get_singleton()->material_set_param(_get_material(), "ground_curve", ground_curve);
}
float ProceduralSkyMaterial::get_ground_curve() const {
@@ -104,7 +104,7 @@ float ProceduralSkyMaterial::get_ground_curve() const {
void ProceduralSkyMaterial::set_ground_energy(float p_energy) {
ground_energy = p_energy;
- VS::get_singleton()->material_set_param(_get_material(), "ground_energy", ground_energy);
+ RS::get_singleton()->material_set_param(_get_material(), "ground_energy", ground_energy);
}
float ProceduralSkyMaterial::get_ground_energy() const {
@@ -114,7 +114,7 @@ float ProceduralSkyMaterial::get_ground_energy() const {
void ProceduralSkyMaterial::set_sun_angle_min(float p_angle) {
sun_angle_min = p_angle;
- VS::get_singleton()->material_set_param(_get_material(), "sun_angle_min", Math::deg2rad(sun_angle_min));
+ RS::get_singleton()->material_set_param(_get_material(), "sun_angle_min", Math::deg2rad(sun_angle_min));
}
float ProceduralSkyMaterial::get_sun_angle_min() const {
@@ -124,7 +124,7 @@ float ProceduralSkyMaterial::get_sun_angle_min() const {
void ProceduralSkyMaterial::set_sun_angle_max(float p_angle) {
sun_angle_max = p_angle;
- VS::get_singleton()->material_set_param(_get_material(), "sun_angle_max", Math::deg2rad(sun_angle_max));
+ RS::get_singleton()->material_set_param(_get_material(), "sun_angle_max", Math::deg2rad(sun_angle_max));
}
float ProceduralSkyMaterial::get_sun_angle_max() const {
@@ -134,7 +134,7 @@ float ProceduralSkyMaterial::get_sun_angle_max() const {
void ProceduralSkyMaterial::set_sun_curve(float p_curve) {
sun_curve = p_curve;
- VS::get_singleton()->material_set_param(_get_material(), "sun_curve", sun_curve);
+ RS::get_singleton()->material_set_param(_get_material(), "sun_curve", sun_curve);
}
float ProceduralSkyMaterial::get_sun_curve() const {
@@ -271,11 +271,11 @@ ProceduralSkyMaterial::ProceduralSkyMaterial() {
code += "\tCOLOR = mix(ground, sky, step(0.0, EYEDIR.y));\n";
code += "}\n";
- shader = VS::get_singleton()->shader_create();
+ shader = RS::get_singleton()->shader_create();
- VS::get_singleton()->shader_set_code(shader, code);
+ RS::get_singleton()->shader_set_code(shader, code);
- VS::get_singleton()->material_set_shader(_get_material(), shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader);
set_sky_top_color(Color(0.35, 0.46, 0.71));
set_sky_horizon_color(Color(0.55, 0.69, 0.81));
@@ -293,8 +293,8 @@ ProceduralSkyMaterial::ProceduralSkyMaterial() {
}
ProceduralSkyMaterial::~ProceduralSkyMaterial() {
- VS::get_singleton()->free(shader);
- VS::get_singleton()->material_set_shader(_get_material(), RID());
+ RS::get_singleton()->free(shader);
+ RS::get_singleton()->material_set_shader(_get_material(), RID());
}
/////////////////////////////////////////
@@ -303,7 +303,7 @@ ProceduralSkyMaterial::~ProceduralSkyMaterial() {
void PanoramaSkyMaterial::set_panorama(const Ref<Texture2D> &p_panorama) {
panorama = p_panorama;
- VS::get_singleton()->material_set_param(_get_material(), "source_panorama", panorama);
+ RS::get_singleton()->material_set_param(_get_material(), "source_panorama", panorama);
}
Ref<Texture2D> PanoramaSkyMaterial::get_panorama() const {
@@ -341,16 +341,16 @@ PanoramaSkyMaterial::PanoramaSkyMaterial() {
code += "\tCOLOR = texture(source_panorama, SKY_COORDS).rgb;\n";
code += "}";
- shader = VS::get_singleton()->shader_create();
+ shader = RS::get_singleton()->shader_create();
- VS::get_singleton()->shader_set_code(shader, code);
+ RS::get_singleton()->shader_set_code(shader, code);
- VS::get_singleton()->material_set_shader(_get_material(), shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader);
}
PanoramaSkyMaterial::~PanoramaSkyMaterial() {
- VS::get_singleton()->free(shader);
- VS::get_singleton()->material_set_shader(_get_material(), RID());
+ RS::get_singleton()->free(shader);
+ RS::get_singleton()->material_set_shader(_get_material(), RID());
}
//////////////////////////////////
/* PhysicalSkyMaterial */
@@ -358,7 +358,7 @@ PanoramaSkyMaterial::~PanoramaSkyMaterial() {
void PhysicalSkyMaterial::set_rayleigh_coefficient(float p_rayleigh) {
rayleigh = p_rayleigh;
- VS::get_singleton()->material_set_param(_get_material(), "rayleigh", rayleigh);
+ RS::get_singleton()->material_set_param(_get_material(), "rayleigh", rayleigh);
}
float PhysicalSkyMaterial::get_rayleigh_coefficient() const {
@@ -368,7 +368,7 @@ float PhysicalSkyMaterial::get_rayleigh_coefficient() const {
void PhysicalSkyMaterial::set_rayleigh_color(Color p_rayleigh_color) {
rayleigh_color = p_rayleigh_color;
- VS::get_singleton()->material_set_param(_get_material(), "rayleigh_color", rayleigh_color);
+ RS::get_singleton()->material_set_param(_get_material(), "rayleigh_color", rayleigh_color);
}
Color PhysicalSkyMaterial::get_rayleigh_color() const {
@@ -378,7 +378,7 @@ Color PhysicalSkyMaterial::get_rayleigh_color() const {
void PhysicalSkyMaterial::set_mie_coefficient(float p_mie) {
mie = p_mie;
- VS::get_singleton()->material_set_param(_get_material(), "mie", mie);
+ RS::get_singleton()->material_set_param(_get_material(), "mie", mie);
}
float PhysicalSkyMaterial::get_mie_coefficient() const {
@@ -388,7 +388,7 @@ float PhysicalSkyMaterial::get_mie_coefficient() const {
void PhysicalSkyMaterial::set_mie_eccentricity(float p_eccentricity) {
mie_eccentricity = p_eccentricity;
- VS::get_singleton()->material_set_param(_get_material(), "mie_eccentricity", mie_eccentricity);
+ RS::get_singleton()->material_set_param(_get_material(), "mie_eccentricity", mie_eccentricity);
}
float PhysicalSkyMaterial::get_mie_eccentricity() const {
@@ -398,7 +398,7 @@ float PhysicalSkyMaterial::get_mie_eccentricity() const {
void PhysicalSkyMaterial::set_mie_color(Color p_mie_color) {
mie_color = p_mie_color;
- VS::get_singleton()->material_set_param(_get_material(), "mie_color", mie_color);
+ RS::get_singleton()->material_set_param(_get_material(), "mie_color", mie_color);
}
Color PhysicalSkyMaterial::get_mie_color() const {
return mie_color;
@@ -407,7 +407,7 @@ Color PhysicalSkyMaterial::get_mie_color() const {
void PhysicalSkyMaterial::set_turbidity(float p_turbidity) {
turbidity = p_turbidity;
- VS::get_singleton()->material_set_param(_get_material(), "turbidity", turbidity);
+ RS::get_singleton()->material_set_param(_get_material(), "turbidity", turbidity);
}
float PhysicalSkyMaterial::get_turbidity() const {
@@ -417,7 +417,7 @@ float PhysicalSkyMaterial::get_turbidity() const {
void PhysicalSkyMaterial::set_sun_disk_scale(float p_sun_disk_scale) {
sun_disk_scale = p_sun_disk_scale;
- VS::get_singleton()->material_set_param(_get_material(), "sun_disk_scale", sun_disk_scale);
+ RS::get_singleton()->material_set_param(_get_material(), "sun_disk_scale", sun_disk_scale);
}
float PhysicalSkyMaterial::get_sun_disk_scale() const {
@@ -427,7 +427,7 @@ float PhysicalSkyMaterial::get_sun_disk_scale() const {
void PhysicalSkyMaterial::set_ground_color(Color p_ground_color) {
ground_color = p_ground_color;
- VS::get_singleton()->material_set_param(_get_material(), "ground_color", ground_color);
+ RS::get_singleton()->material_set_param(_get_material(), "ground_color", ground_color);
}
Color PhysicalSkyMaterial::get_ground_color() const {
@@ -437,7 +437,7 @@ Color PhysicalSkyMaterial::get_ground_color() const {
void PhysicalSkyMaterial::set_exposure(float p_exposure) {
exposure = p_exposure;
- VS::get_singleton()->material_set_param(_get_material(), "exposure", exposure);
+ RS::get_singleton()->material_set_param(_get_material(), "exposure", exposure);
}
float PhysicalSkyMaterial::get_exposure() const {
@@ -447,7 +447,7 @@ float PhysicalSkyMaterial::get_exposure() const {
void PhysicalSkyMaterial::set_dither_strength(float p_dither_strength) {
dither_strength = p_dither_strength;
- VS::get_singleton()->material_set_param(_get_material(), "dither_strength", dither_strength);
+ RS::get_singleton()->material_set_param(_get_material(), "dither_strength", dither_strength);
}
float PhysicalSkyMaterial::get_dither_strength() const {
@@ -604,11 +604,11 @@ PhysicalSkyMaterial::PhysicalSkyMaterial() {
code += "\tCOLOR += (hash(EYEDIR * 1741.9782) * 0.08 - 0.04) * 0.008 * dither_strength;\n";
code += "}\n";
- shader = VS::get_singleton()->shader_create();
+ shader = RS::get_singleton()->shader_create();
- VS::get_singleton()->shader_set_code(shader, code);
+ RS::get_singleton()->shader_set_code(shader, code);
- VS::get_singleton()->material_set_shader(_get_material(), shader);
+ RS::get_singleton()->material_set_shader(_get_material(), shader);
set_rayleigh_coefficient(2.0);
set_rayleigh_color(Color(0.056, 0.14, 0.3));
@@ -623,6 +623,6 @@ PhysicalSkyMaterial::PhysicalSkyMaterial() {
}
PhysicalSkyMaterial::~PhysicalSkyMaterial() {
- VS::get_singleton()->free(shader);
- VS::get_singleton()->material_set_shader(_get_material(), RID());
+ RS::get_singleton()->free(shader);
+ RS::get_singleton()->material_set_shader(_get_material(), RID());
}
diff --git a/scene/resources/sphere_shape_3d.cpp b/scene/resources/sphere_shape_3d.cpp
index 46f7c96ce1..153db4c291 100644
--- a/scene/resources/sphere_shape_3d.cpp
+++ b/scene/resources/sphere_shape_3d.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "sphere_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> SphereShape3D::get_debug_mesh_lines() {
@@ -61,7 +61,7 @@ real_t SphereShape3D::get_enclosing_radius() const {
void SphereShape3D::_update_shape() {
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), radius);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), radius);
Shape3D::_update_shape();
}
@@ -87,7 +87,7 @@ void SphereShape3D::_bind_methods() {
}
SphereShape3D::SphereShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_SPHERE)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_SPHERE)) {
set_radius(1.0);
}
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index 0cd2bed71d..56fb5d441f 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -202,7 +202,7 @@ void StyleBoxTexture::draw(RID p_canvas_item, const Rect2 &p_rect) const {
if (normal_map.is_valid())
normal_rid = normal_map->get_rid();
- VisualServer::get_singleton()->canvas_item_add_nine_patch(p_canvas_item, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NinePatchAxisMode(axis_h), VS::NinePatchAxisMode(axis_v), draw_center, modulate, normal_rid);
+ RenderingServer::get_singleton()->canvas_item_add_nine_patch(p_canvas_item, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), RS::NinePatchAxisMode(axis_h), RS::NinePatchAxisMode(axis_v), draw_center, modulate, normal_rid);
}
void StyleBoxTexture::set_draw_center(bool p_enabled) {
@@ -853,7 +853,7 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const {
}
//DRAWING
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
vs->canvas_item_add_triangle_array(p_canvas_item, indices, verts, colors, uvs);
}
@@ -1050,7 +1050,7 @@ Size2 StyleBoxLine::get_center_size() const {
}
void StyleBoxLine::draw(RID p_canvas_item, const Rect2 &p_rect) const {
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
Rect2i r = p_rect;
if (vertical) {
diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h
index 1aa1a00c55..f19b93d00d 100644
--- a/scene/resources/style_box.h
+++ b/scene/resources/style_box.h
@@ -33,7 +33,7 @@
#include "core/resource.h"
#include "scene/resources/texture.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class CanvasItem;
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index fa177d03fb..fee6bd1b54 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -519,7 +519,7 @@ void SurfaceTool::deindex() {
void SurfaceTool::_create_list(const Ref<Mesh> &p_existing, int p_surface, List<Vertex> *r_vertex, List<int> *r_index, int &lformat) {
Array arr = p_existing->surface_get_arrays(p_surface);
- ERR_FAIL_COND(arr.size() != VS::ARRAY_MAX);
+ ERR_FAIL_COND(arr.size() != RS::ARRAY_MAX);
_create_list_from_arrays(arr, r_vertex, r_index, lformat);
}
@@ -527,14 +527,14 @@ Vector<SurfaceTool::Vertex> SurfaceTool::create_vertex_array_from_triangle_array
Vector<SurfaceTool::Vertex> ret;
- Vector<Vector3> varr = p_arrays[VS::ARRAY_VERTEX];
- Vector<Vector3> narr = p_arrays[VS::ARRAY_NORMAL];
- Vector<float> tarr = p_arrays[VS::ARRAY_TANGENT];
- Vector<Color> carr = p_arrays[VS::ARRAY_COLOR];
- Vector<Vector2> uvarr = p_arrays[VS::ARRAY_TEX_UV];
- Vector<Vector2> uv2arr = p_arrays[VS::ARRAY_TEX_UV2];
- Vector<int> barr = p_arrays[VS::ARRAY_BONES];
- Vector<float> warr = p_arrays[VS::ARRAY_WEIGHTS];
+ Vector<Vector3> varr = p_arrays[RS::ARRAY_VERTEX];
+ Vector<Vector3> narr = p_arrays[RS::ARRAY_NORMAL];
+ Vector<float> tarr = p_arrays[RS::ARRAY_TANGENT];
+ Vector<Color> carr = p_arrays[RS::ARRAY_COLOR];
+ Vector<Vector2> uvarr = p_arrays[RS::ARRAY_TEX_UV];
+ Vector<Vector2> uv2arr = p_arrays[RS::ARRAY_TEX_UV2];
+ Vector<int> barr = p_arrays[RS::ARRAY_BONES];
+ Vector<float> warr = p_arrays[RS::ARRAY_WEIGHTS];
int vc = varr.size();
if (vc == 0)
@@ -542,48 +542,48 @@ Vector<SurfaceTool::Vertex> SurfaceTool::create_vertex_array_from_triangle_array
int lformat = 0;
if (varr.size()) {
- lformat |= VS::ARRAY_FORMAT_VERTEX;
+ lformat |= RS::ARRAY_FORMAT_VERTEX;
}
if (narr.size()) {
- lformat |= VS::ARRAY_FORMAT_NORMAL;
+ lformat |= RS::ARRAY_FORMAT_NORMAL;
}
if (tarr.size()) {
- lformat |= VS::ARRAY_FORMAT_TANGENT;
+ lformat |= RS::ARRAY_FORMAT_TANGENT;
}
if (carr.size()) {
- lformat |= VS::ARRAY_FORMAT_COLOR;
+ lformat |= RS::ARRAY_FORMAT_COLOR;
}
if (uvarr.size()) {
- lformat |= VS::ARRAY_FORMAT_TEX_UV;
+ lformat |= RS::ARRAY_FORMAT_TEX_UV;
}
if (uv2arr.size()) {
- lformat |= VS::ARRAY_FORMAT_TEX_UV2;
+ lformat |= RS::ARRAY_FORMAT_TEX_UV2;
}
if (barr.size()) {
- lformat |= VS::ARRAY_FORMAT_BONES;
+ lformat |= RS::ARRAY_FORMAT_BONES;
}
if (warr.size()) {
- lformat |= VS::ARRAY_FORMAT_WEIGHTS;
+ lformat |= RS::ARRAY_FORMAT_WEIGHTS;
}
for (int i = 0; i < vc; i++) {
Vertex v;
- if (lformat & VS::ARRAY_FORMAT_VERTEX)
+ if (lformat & RS::ARRAY_FORMAT_VERTEX)
v.vertex = varr[i];
- if (lformat & VS::ARRAY_FORMAT_NORMAL)
+ if (lformat & RS::ARRAY_FORMAT_NORMAL)
v.normal = narr[i];
- if (lformat & VS::ARRAY_FORMAT_TANGENT) {
+ if (lformat & RS::ARRAY_FORMAT_TANGENT) {
Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]);
v.tangent = p.normal;
v.binormal = p.normal.cross(v.tangent).normalized() * p.d;
}
- if (lformat & VS::ARRAY_FORMAT_COLOR)
+ if (lformat & RS::ARRAY_FORMAT_COLOR)
v.color = carr[i];
- if (lformat & VS::ARRAY_FORMAT_TEX_UV)
+ if (lformat & RS::ARRAY_FORMAT_TEX_UV)
v.uv = uvarr[i];
- if (lformat & VS::ARRAY_FORMAT_TEX_UV2)
+ if (lformat & RS::ARRAY_FORMAT_TEX_UV2)
v.uv2 = uv2arr[i];
- if (lformat & VS::ARRAY_FORMAT_BONES) {
+ if (lformat & RS::ARRAY_FORMAT_BONES) {
Vector<int> b;
b.resize(4);
b.write[0] = barr[i * 4 + 0];
@@ -592,7 +592,7 @@ Vector<SurfaceTool::Vertex> SurfaceTool::create_vertex_array_from_triangle_array
b.write[3] = barr[i * 4 + 3];
v.bones = b;
}
- if (lformat & VS::ARRAY_FORMAT_WEIGHTS) {
+ if (lformat & RS::ARRAY_FORMAT_WEIGHTS) {
Vector<float> w;
w.resize(4);
w.write[0] = warr[i * 4 + 0];
@@ -610,14 +610,14 @@ Vector<SurfaceTool::Vertex> SurfaceTool::create_vertex_array_from_triangle_array
void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, List<int> *r_index, int &lformat) {
- Vector<Vector3> varr = arr[VS::ARRAY_VERTEX];
- Vector<Vector3> narr = arr[VS::ARRAY_NORMAL];
- Vector<float> tarr = arr[VS::ARRAY_TANGENT];
- Vector<Color> carr = arr[VS::ARRAY_COLOR];
- Vector<Vector2> uvarr = arr[VS::ARRAY_TEX_UV];
- Vector<Vector2> uv2arr = arr[VS::ARRAY_TEX_UV2];
- Vector<int> barr = arr[VS::ARRAY_BONES];
- Vector<float> warr = arr[VS::ARRAY_WEIGHTS];
+ Vector<Vector3> varr = arr[RS::ARRAY_VERTEX];
+ Vector<Vector3> narr = arr[RS::ARRAY_NORMAL];
+ Vector<float> tarr = arr[RS::ARRAY_TANGENT];
+ Vector<Color> carr = arr[RS::ARRAY_COLOR];
+ Vector<Vector2> uvarr = arr[RS::ARRAY_TEX_UV];
+ Vector<Vector2> uv2arr = arr[RS::ARRAY_TEX_UV2];
+ Vector<int> barr = arr[RS::ARRAY_BONES];
+ Vector<float> warr = arr[RS::ARRAY_WEIGHTS];
int vc = varr.size();
if (vc == 0)
@@ -625,48 +625,48 @@ void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, Li
lformat = 0;
if (varr.size()) {
- lformat |= VS::ARRAY_FORMAT_VERTEX;
+ lformat |= RS::ARRAY_FORMAT_VERTEX;
}
if (narr.size()) {
- lformat |= VS::ARRAY_FORMAT_NORMAL;
+ lformat |= RS::ARRAY_FORMAT_NORMAL;
}
if (tarr.size()) {
- lformat |= VS::ARRAY_FORMAT_TANGENT;
+ lformat |= RS::ARRAY_FORMAT_TANGENT;
}
if (carr.size()) {
- lformat |= VS::ARRAY_FORMAT_COLOR;
+ lformat |= RS::ARRAY_FORMAT_COLOR;
}
if (uvarr.size()) {
- lformat |= VS::ARRAY_FORMAT_TEX_UV;
+ lformat |= RS::ARRAY_FORMAT_TEX_UV;
}
if (uv2arr.size()) {
- lformat |= VS::ARRAY_FORMAT_TEX_UV2;
+ lformat |= RS::ARRAY_FORMAT_TEX_UV2;
}
if (barr.size()) {
- lformat |= VS::ARRAY_FORMAT_BONES;
+ lformat |= RS::ARRAY_FORMAT_BONES;
}
if (warr.size()) {
- lformat |= VS::ARRAY_FORMAT_WEIGHTS;
+ lformat |= RS::ARRAY_FORMAT_WEIGHTS;
}
for (int i = 0; i < vc; i++) {
Vertex v;
- if (lformat & VS::ARRAY_FORMAT_VERTEX)
+ if (lformat & RS::ARRAY_FORMAT_VERTEX)
v.vertex = varr[i];
- if (lformat & VS::ARRAY_FORMAT_NORMAL)
+ if (lformat & RS::ARRAY_FORMAT_NORMAL)
v.normal = narr[i];
- if (lformat & VS::ARRAY_FORMAT_TANGENT) {
+ if (lformat & RS::ARRAY_FORMAT_TANGENT) {
Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]);
v.tangent = p.normal;
v.binormal = p.normal.cross(v.tangent).normalized() * p.d;
}
- if (lformat & VS::ARRAY_FORMAT_COLOR)
+ if (lformat & RS::ARRAY_FORMAT_COLOR)
v.color = carr[i];
- if (lformat & VS::ARRAY_FORMAT_TEX_UV)
+ if (lformat & RS::ARRAY_FORMAT_TEX_UV)
v.uv = uvarr[i];
- if (lformat & VS::ARRAY_FORMAT_TEX_UV2)
+ if (lformat & RS::ARRAY_FORMAT_TEX_UV2)
v.uv2 = uv2arr[i];
- if (lformat & VS::ARRAY_FORMAT_BONES) {
+ if (lformat & RS::ARRAY_FORMAT_BONES) {
Vector<int> b;
b.resize(4);
b.write[0] = barr[i * 4 + 0];
@@ -675,7 +675,7 @@ void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, Li
b.write[3] = barr[i * 4 + 3];
v.bones = b;
}
- if (lformat & VS::ARRAY_FORMAT_WEIGHTS) {
+ if (lformat & RS::ARRAY_FORMAT_WEIGHTS) {
Vector<float> w;
w.resize(4);
w.write[0] = warr[i * 4 + 0];
@@ -690,11 +690,11 @@ void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, Li
//indices
- Vector<int> idx = arr[VS::ARRAY_INDEX];
+ Vector<int> idx = arr[RS::ARRAY_INDEX];
int is = idx.size();
if (is) {
- lformat |= VS::ARRAY_FORMAT_INDEX;
+ lformat |= RS::ARRAY_FORMAT_INDEX;
const int *iarr = idx.ptr();
for (int i = 0; i < is; i++) {
r_index->push_back(iarr[i]);
@@ -733,7 +733,7 @@ void SurfaceTool::create_from_blend_shape(const Ref<Mesh> &p_existing, int p_sur
ERR_FAIL_COND(shape_idx == -1);
ERR_FAIL_COND(shape_idx >= arr.size());
Array mesh = arr[shape_idx];
- ERR_FAIL_COND(mesh.size() != VS::ARRAY_MAX);
+ ERR_FAIL_COND(mesh.size() != RS::ARRAY_MAX);
_create_list_from_arrays(arr[shape_idx], &vertex_array, &index_array, format);
}
@@ -755,10 +755,10 @@ void SurfaceTool::append_from(const Ref<Mesh> &p_existing, int p_surface, const
Vertex v = E->get();
v.vertex = p_xform.xform(v.vertex);
- if (nformat & VS::ARRAY_FORMAT_NORMAL) {
+ if (nformat & RS::ARRAY_FORMAT_NORMAL) {
v.normal = p_xform.basis.xform(v.normal);
}
- if (nformat & VS::ARRAY_FORMAT_TANGENT) {
+ if (nformat & RS::ARRAY_FORMAT_TANGENT) {
v.tangent = p_xform.basis.xform(v.tangent);
v.binormal = p_xform.basis.xform(v.binormal);
}
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 1c5b2abad2..74b6a16d41 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -47,25 +47,25 @@ bool Texture2D::is_pixel_opaque(int p_x, int p_y) const {
return true;
}
-void Texture2D::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void Texture2D::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, get_size()), get_rid(), false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, get_size()), get_rid(), false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void Texture2D::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void Texture2D::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, get_rid(), p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, get_rid(), p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void Texture2D::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
+void Texture2D::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, get_rid(), p_src_rect, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_clip_uv, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, get_rid(), p_src_rect, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_clip_uv, p_texture_filter, p_texture_repeat);
}
bool Texture2D::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const {
@@ -82,9 +82,9 @@ void Texture2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_height"), &Texture2D::get_height);
ClassDB::bind_method(D_METHOD("get_size"), &Texture2D::get_size);
ClassDB::bind_method(D_METHOD("has_alpha"), &Texture2D::has_alpha);
- ClassDB::bind_method(D_METHOD("draw", "canvas_item", "position", "modulate", "transpose", "normal_map", "specular_map", "specular_color_shininess", "texture_filter", "texture_repeat"), &Texture2D::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT), DEFVAL(VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT));
- ClassDB::bind_method(D_METHOD("draw_rect", "canvas_item", "rect", "tile", "modulate", "transpose", "normal_map", "specular_map", "specular_color_shininess", "texture_filter", "texture_repeat"), &Texture2D::draw_rect, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT), DEFVAL(VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT));
- ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "specular_map", "specular_color_shininess", "texture_filter", "texture_repeat", "clip_uv"), &Texture2D::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT), DEFVAL(VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("draw", "canvas_item", "position", "modulate", "transpose", "normal_map", "specular_map", "specular_color_shininess", "texture_filter", "texture_repeat"), &Texture2D::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT), DEFVAL(RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT));
+ ClassDB::bind_method(D_METHOD("draw_rect", "canvas_item", "rect", "tile", "modulate", "transpose", "normal_map", "specular_map", "specular_color_shininess", "texture_filter", "texture_repeat"), &Texture2D::draw_rect, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT), DEFVAL(RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT));
+ ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "specular_map", "specular_color_shininess", "texture_filter", "texture_repeat", "clip_uv"), &Texture2D::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT), DEFVAL(RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT), DEFVAL(true));
ClassDB::bind_method(D_METHOD("get_data"), &Texture2D::get_data);
ADD_GROUP("", "");
@@ -121,7 +121,7 @@ bool ImageTexture::_set(const StringName &p_name, const Variant &p_value) {
Size2 s = p_value;
w = s.width;
h = s.height;
- VisualServer::get_singleton()->texture_set_size_override(texture, w, h);
+ RenderingServer::get_singleton()->texture_set_size_override(texture, w, h);
} else
return false;
@@ -158,8 +158,8 @@ void ImageTexture::_reload_hook(const RID &p_hook) {
ERR_FAIL_COND_MSG(err != OK, "Cannot load image from path '" + path + "'.");
- RID new_texture = VisualServer::get_singleton()->texture_2d_create(img);
- VisualServer::get_singleton()->texture_replace(texture, new_texture);
+ RID new_texture = RenderingServer::get_singleton()->texture_2d_create(img);
+ RenderingServer::get_singleton()->texture_replace(texture, new_texture);
_change_notify();
emit_changed();
@@ -174,10 +174,10 @@ void ImageTexture::create_from_image(const Ref<Image> &p_image) {
mipmaps = p_image->has_mipmaps();
if (texture.is_null()) {
- texture = VisualServer::get_singleton()->texture_2d_create(p_image);
+ texture = RenderingServer::get_singleton()->texture_2d_create(p_image);
} else {
- RID new_texture = VisualServer::get_singleton()->texture_2d_create(p_image);
- VisualServer::get_singleton()->texture_replace(texture, new_texture);
+ RID new_texture = RenderingServer::get_singleton()->texture_2d_create(p_image);
+ RenderingServer::get_singleton()->texture_replace(texture, new_texture);
}
_change_notify();
emit_changed();
@@ -199,9 +199,9 @@ void ImageTexture::update(const Ref<Image> &p_image, bool p_immediate) {
ERR_FAIL_COND(mipmaps != p_image->has_mipmaps());
if (p_immediate) {
- VisualServer::get_singleton()->texture_2d_update_immediate(texture, p_image);
+ RenderingServer::get_singleton()->texture_2d_update_immediate(texture, p_image);
} else {
- VisualServer::get_singleton()->texture_2d_update(texture, p_image);
+ RenderingServer::get_singleton()->texture_2d_update(texture, p_image);
}
_change_notify();
@@ -219,7 +219,7 @@ void ImageTexture::_resource_path_changed() {
Ref<Image> ImageTexture::get_data() const {
if (image_stored) {
- return VisualServer::get_singleton()->texture_2d_get(texture);
+ return RenderingServer::get_singleton()->texture_2d_get(texture);
} else {
return Ref<Image>();
}
@@ -239,7 +239,7 @@ RID ImageTexture::get_rid() const {
if (texture.is_null()) {
//we are in trouble, create something temporary
- texture = VisualServer::get_singleton()->texture_2d_placeholder_create();
+ texture = RenderingServer::get_singleton()->texture_2d_placeholder_create();
}
return texture;
}
@@ -249,29 +249,29 @@ bool ImageTexture::has_alpha() const {
return (format == Image::FORMAT_LA8 || format == Image::FORMAT_RGBA8);
}
-void ImageTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void ImageTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if ((w | h) == 0)
return;
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void ImageTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void ImageTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if ((w | h) == 0)
return;
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void ImageTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
+void ImageTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
if ((w | h) == 0)
return;
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_clip_uv, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_clip_uv, p_texture_filter, p_texture_repeat);
}
bool ImageTexture::is_pixel_opaque(int p_x, int p_y) const {
@@ -316,13 +316,13 @@ void ImageTexture::set_size_override(const Size2 &p_size) {
w = s.x;
if (s.y != 0)
h = s.y;
- VisualServer::get_singleton()->texture_set_size_override(texture, w, h);
+ RenderingServer::get_singleton()->texture_set_size_override(texture, w, h);
}
void ImageTexture::set_path(const String &p_path, bool p_take_over) {
if (texture.is_valid()) {
- VisualServer::get_singleton()->texture_set_path(texture, p_path);
+ RenderingServer::get_singleton()->texture_set_path(texture, p_path);
}
Resource::set_path(p_path, p_take_over);
@@ -349,7 +349,7 @@ ImageTexture::ImageTexture() {
ImageTexture::~ImageTexture() {
if (texture.is_valid()) {
- VisualServer::get_singleton()->free(texture);
+ RenderingServer::get_singleton()->free(texture);
}
}
@@ -495,7 +495,7 @@ Ref<Image> StreamTexture::load_image_from_file(FileAccess *f, int p_size_limit)
void StreamTexture::set_path(const String &p_path, bool p_take_over) {
if (texture.is_valid()) {
- VisualServer::get_singleton()->texture_set_path(texture, p_path);
+ RenderingServer::get_singleton()->texture_set_path(texture, p_path);
}
Resource::set_path(p_path, p_take_over);
@@ -509,7 +509,7 @@ void StreamTexture::_requested_3d(void *p_ud) {
request_3d_callback(stex);
}
-void StreamTexture::_requested_roughness(void *p_ud, const String &p_normal_path, VS::TextureDetectRoughnessChannel p_roughness_channel) {
+void StreamTexture::_requested_roughness(void *p_ud, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_roughness_channel) {
StreamTexture *st = (StreamTexture *)p_ud;
Ref<StreamTexture> stex(st);
@@ -611,13 +611,13 @@ Error StreamTexture::load(const String &p_path) {
return err;
if (texture.is_valid()) {
- RID new_texture = VS::get_singleton()->texture_2d_create(image);
- VS::get_singleton()->texture_replace(texture, new_texture);
+ RID new_texture = RS::get_singleton()->texture_2d_create(image);
+ RS::get_singleton()->texture_replace(texture, new_texture);
} else {
- texture = VS::get_singleton()->texture_2d_create(image);
+ texture = RS::get_singleton()->texture_2d_create(image);
}
if (lwc || lhc) {
- VS::get_singleton()->texture_set_size_override(texture, lwc, lhc);
+ RS::get_singleton()->texture_set_size_override(texture, lwc, lhc);
}
w = lwc ? lwc : lw;
@@ -627,33 +627,33 @@ Error StreamTexture::load(const String &p_path) {
if (get_path() == String()) {
//temporarily set path if no path set for resource, helps find errors
- VisualServer::get_singleton()->texture_set_path(texture, p_path);
+ RenderingServer::get_singleton()->texture_set_path(texture, p_path);
}
#ifdef TOOLS_ENABLED
if (request_3d) {
//print_line("request detect 3D at " + p_path);
- VS::get_singleton()->texture_set_detect_3d_callback(texture, _requested_3d, this);
+ RS::get_singleton()->texture_set_detect_3d_callback(texture, _requested_3d, this);
} else {
//print_line("not requesting detect 3D at " + p_path);
- VS::get_singleton()->texture_set_detect_3d_callback(texture, NULL, NULL);
+ RS::get_singleton()->texture_set_detect_3d_callback(texture, NULL, NULL);
}
if (request_roughness) {
//print_line("request detect srgb at " + p_path);
- VS::get_singleton()->texture_set_detect_roughness_callback(texture, _requested_roughness, this);
+ RS::get_singleton()->texture_set_detect_roughness_callback(texture, _requested_roughness, this);
} else {
//print_line("not requesting detect srgb at " + p_path);
- VS::get_singleton()->texture_set_detect_roughness_callback(texture, NULL, NULL);
+ RS::get_singleton()->texture_set_detect_roughness_callback(texture, NULL, NULL);
}
if (request_normal) {
//print_line("request detect srgb at " + p_path);
- VS::get_singleton()->texture_set_detect_normal_callback(texture, _requested_normal, this);
+ RS::get_singleton()->texture_set_detect_normal_callback(texture, _requested_normal, this);
} else {
//print_line("not requesting detect normal at " + p_path);
- VS::get_singleton()->texture_set_detect_normal_callback(texture, NULL, NULL);
+ RS::get_singleton()->texture_set_detect_normal_callback(texture, NULL, NULL);
}
#endif
@@ -677,34 +677,34 @@ int StreamTexture::get_height() const {
RID StreamTexture::get_rid() const {
if (!texture.is_valid()) {
- texture = VS::get_singleton()->texture_2d_placeholder_create();
+ texture = RS::get_singleton()->texture_2d_placeholder_create();
}
return texture;
}
-void StreamTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void StreamTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if ((w | h) == 0)
return;
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void StreamTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void StreamTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if ((w | h) == 0)
return;
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void StreamTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
+void StreamTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
if ((w | h) == 0)
return;
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_clip_uv, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, p_rect, texture, p_src_rect, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_clip_uv, p_texture_filter, p_texture_repeat);
}
bool StreamTexture::has_alpha() const {
@@ -715,7 +715,7 @@ bool StreamTexture::has_alpha() const {
Ref<Image> StreamTexture::get_data() const {
if (texture.is_valid()) {
- return VS::get_singleton()->texture_2d_get(texture);
+ return RS::get_singleton()->texture_2d_get(texture);
} else {
return Ref<Image>();
}
@@ -792,7 +792,7 @@ StreamTexture::StreamTexture() {
StreamTexture::~StreamTexture() {
if (texture.is_valid()) {
- VS::get_singleton()->free(texture);
+ RS::get_singleton()->free(texture);
}
}
@@ -935,7 +935,7 @@ void AtlasTexture::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "filter_clip"), "set_filter_clip", "has_filter_clip");
}
-void AtlasTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void AtlasTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if (!atlas.is_valid())
return;
@@ -952,10 +952,10 @@ void AtlasTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_m
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(p_pos + margin.position, rc.size), atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat);
+ RS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(p_pos + margin.position, rc.size), atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat);
}
-void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if (!atlas.is_valid())
return;
@@ -975,9 +975,9 @@ void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat);
+ RS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat);
}
-void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
+void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
//this might not necessarily work well if using a rect, needs to be fixed properly
if (!atlas.is_valid())
@@ -989,7 +989,7 @@ void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, cons
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), src_c, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat);
+ RS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), src_c, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat);
}
bool AtlasTexture::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const {
@@ -1087,7 +1087,7 @@ Ref<Texture2D> MeshTexture::get_base_texture() const {
return base_texture;
}
-void MeshTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void MeshTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if (mesh.is_null() || base_texture.is_null()) {
return;
@@ -1100,9 +1100,9 @@ void MeshTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_mo
}
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void MeshTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void MeshTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
if (mesh.is_null() || base_texture.is_null()) {
return;
}
@@ -1123,9 +1123,9 @@ void MeshTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile,
}
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
-void MeshTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
+void MeshTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
if (mesh.is_null() || base_texture.is_null()) {
return;
@@ -1147,7 +1147,7 @@ void MeshTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const
}
RID normal_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID();
- VisualServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
+ RenderingServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
bool MeshTexture::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const {
r_rect = p_rect;
@@ -1300,7 +1300,7 @@ void LargeTexture::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_data", "_get_data");
}
-void LargeTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void LargeTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
for (int i = 0; i < pieces.size(); i++) {
@@ -1309,7 +1309,7 @@ void LargeTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_m
}
}
-void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat) const {
+void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const {
//tiling not supported for this
if (size.x == 0 || size.y == 0)
@@ -1323,7 +1323,7 @@ void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile
pieces[i].texture->draw_rect(p_canvas_item, Rect2(pieces[i].offset * scale + p_rect.position, pieces[i].texture->get_size() * scale), false, p_modulate, p_transpose, p_normal_map, p_specular_map, p_specular_color_shininess, p_texture_filter, p_texture_repeat);
}
}
-void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, VS::CanvasItemTextureFilter p_texture_filter, VS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
+void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const {
//tiling not supported for this
if (p_src_rect.size.x == 0 || p_src_rect.size.y == 0)
@@ -1445,10 +1445,10 @@ void CurveTexture::_update() {
Ref<Image> image = memnew(Image(_width, 1, false, Image::FORMAT_RF, data));
if (_texture.is_valid()) {
- RID new_texture = VS::get_singleton()->texture_2d_create(image);
- VS::get_singleton()->texture_replace(_texture, new_texture);
+ RID new_texture = RS::get_singleton()->texture_2d_create(image);
+ RS::get_singleton()->texture_replace(_texture, new_texture);
} else {
- _texture = VS::get_singleton()->texture_2d_create(image);
+ _texture = RS::get_singleton()->texture_2d_create(image);
}
emit_changed();
@@ -1462,7 +1462,7 @@ Ref<Curve> CurveTexture::get_curve() const {
RID CurveTexture::get_rid() const {
if (!_texture.is_valid()) {
- _texture = VS::get_singleton()->texture_2d_placeholder_create();
+ _texture = RS::get_singleton()->texture_2d_placeholder_create();
}
return _texture;
}
@@ -1472,7 +1472,7 @@ CurveTexture::CurveTexture() {
}
CurveTexture::~CurveTexture() {
if (_texture.is_valid()) {
- VS::get_singleton()->free(_texture);
+ RS::get_singleton()->free(_texture);
}
}
//////////////////
@@ -1492,7 +1492,7 @@ GradientTexture::GradientTexture() {
GradientTexture::~GradientTexture() {
if (texture.is_valid()) {
- VS::get_singleton()->free(texture);
+ RS::get_singleton()->free(texture);
}
}
@@ -1564,10 +1564,10 @@ void GradientTexture::_update() {
Ref<Image> image = memnew(Image(width, 1, false, Image::FORMAT_RGBA8, data));
if (texture.is_valid()) {
- RID new_texture = VS::get_singleton()->texture_2d_create(image);
- VS::get_singleton()->texture_replace(texture, new_texture);
+ RID new_texture = RS::get_singleton()->texture_2d_create(image);
+ RS::get_singleton()->texture_replace(texture, new_texture);
} else {
- texture = VS::get_singleton()->texture_2d_create(image);
+ texture = RS::get_singleton()->texture_2d_create(image);
}
emit_changed();
@@ -1587,7 +1587,7 @@ Ref<Image> GradientTexture::get_data() const {
if (!texture.is_valid()) {
return Ref<Image>();
}
- return VisualServer::get_singleton()->texture_2d_get(texture);
+ return RenderingServer::get_singleton()->texture_2d_get(texture);
}
//////////////////////////////////////
@@ -1607,13 +1607,13 @@ void ProxyTexture::set_base(const Ref<Texture2D> &p_texture) {
base = p_texture;
if (base.is_valid()) {
if (proxy_ph.is_valid()) {
- VS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
- VS::get_singleton()->free(proxy_ph);
+ RS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
+ RS::get_singleton()->free(proxy_ph);
proxy_ph = RID();
} else if (proxy.is_valid()) {
- VS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
+ RS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
} else {
- proxy = VS::get_singleton()->texture_proxy_create(base->get_rid());
+ proxy = RS::get_singleton()->texture_proxy_create(base->get_rid());
}
}
}
@@ -1638,8 +1638,8 @@ int ProxyTexture::get_height() const {
RID ProxyTexture::get_rid() const {
if (proxy.is_null()) {
- proxy_ph = VS::get_singleton()->texture_2d_placeholder_create();
- proxy = VS::get_singleton()->texture_proxy_create(proxy_ph);
+ proxy_ph = RS::get_singleton()->texture_2d_placeholder_create();
+ proxy = RS::get_singleton()->texture_proxy_create(proxy_ph);
}
return proxy;
}
@@ -1653,16 +1653,16 @@ bool ProxyTexture::has_alpha() const {
ProxyTexture::ProxyTexture() {
- //proxy = VS::get_singleton()->texture_create();
+ //proxy = RS::get_singleton()->texture_create();
}
ProxyTexture::~ProxyTexture() {
if (proxy_ph.is_valid()) {
- VS::get_singleton()->free(proxy_ph);
+ RS::get_singleton()->free(proxy_ph);
}
if (proxy.is_valid()) {
- VS::get_singleton()->free(proxy);
+ RS::get_singleton()->free(proxy);
}
}
//////////////////////////////////////////////
@@ -1708,7 +1708,7 @@ void AnimatedTexture::_update_proxy() {
}
if (frames[current_frame].texture.is_valid()) {
- VisualServer::get_singleton()->texture_proxy_update(proxy, frames[current_frame].texture->get_rid());
+ RenderingServer::get_singleton()->texture_proxy_update(proxy, frames[current_frame].texture->get_rid());
}
}
@@ -1854,17 +1854,17 @@ void AnimatedTexture::_bind_methods() {
}
AnimatedTexture::AnimatedTexture() {
- //proxy = VS::get_singleton()->texture_create();
- proxy_ph = VS::get_singleton()->texture_2d_placeholder_create();
- proxy = VS::get_singleton()->texture_proxy_create(proxy_ph);
+ //proxy = RS::get_singleton()->texture_create();
+ proxy_ph = RS::get_singleton()->texture_2d_placeholder_create();
+ proxy = RS::get_singleton()->texture_proxy_create(proxy_ph);
- VisualServer::get_singleton()->texture_set_force_redraw_if_visible(proxy, true);
+ RenderingServer::get_singleton()->texture_set_force_redraw_if_visible(proxy, true);
time = 0;
frame_count = 1;
fps = 4;
prev_ticks = 0;
current_frame = 0;
- VisualServer::get_singleton()->connect("frame_pre_draw", callable_mp(this, &AnimatedTexture::_update_proxy));
+ RenderingServer::get_singleton()->connect("frame_pre_draw", callable_mp(this, &AnimatedTexture::_update_proxy));
#ifndef NO_THREADS
rw_lock = RWLock::create();
@@ -1874,8 +1874,8 @@ AnimatedTexture::AnimatedTexture() {
}
AnimatedTexture::~AnimatedTexture() {
- VS::get_singleton()->free(proxy);
- VS::get_singleton()->free(proxy_ph);
+ RS::get_singleton()->free(proxy);
+ RS::get_singleton()->free(proxy_ph);
if (rw_lock) {
memdelete(rw_lock);
}
@@ -1921,10 +1921,10 @@ Error TextureLayered::create_from_images(Vector<Ref<Image>> p_images) {
int new_layers = p_images.size();
ERR_FAIL_COND_V(new_layers == 0, ERR_INVALID_PARAMETER);
- if (layered_type == VS::TEXTURE_LAYERED_CUBEMAP) {
+ if (layered_type == RS::TEXTURE_LAYERED_CUBEMAP) {
ERR_FAIL_COND_V_MSG(new_layers != 6, ERR_INVALID_PARAMETER,
"Cubemaps require exactly 6 layers");
- } else if (layered_type == VS::TEXTURE_LAYERED_CUBEMAP_ARRAY) {
+ } else if (layered_type == RS::TEXTURE_LAYERED_CUBEMAP_ARRAY) {
ERR_FAIL_COND_V_MSG((new_layers % 6) != 0, ERR_INVALID_PARAMETER,
"Cubemap array layers must be a multiple of 6");
}
@@ -1946,11 +1946,11 @@ Error TextureLayered::create_from_images(Vector<Ref<Image>> p_images) {
}
if (texture.is_valid()) {
- RID new_texture = VS::get_singleton()->texture_2d_layered_create(p_images, layered_type);
+ RID new_texture = RS::get_singleton()->texture_2d_layered_create(p_images, layered_type);
ERR_FAIL_COND_V(!new_texture.is_valid(), ERR_CANT_CREATE);
- VS::get_singleton()->texture_replace(texture, new_texture);
+ RS::get_singleton()->texture_replace(texture, new_texture);
} else {
- texture = VS::get_singleton()->texture_2d_layered_create(p_images, layered_type);
+ texture = RS::get_singleton()->texture_2d_layered_create(p_images, layered_type);
ERR_FAIL_COND_V(!texture.is_valid(), ERR_CANT_CREATE);
}
@@ -1969,24 +1969,24 @@ void TextureLayered::update_layer(const Ref<Image> &p_image, int p_layer) {
ERR_FAIL_COND(p_image->get_width() != width || p_image->get_height() != height);
ERR_FAIL_INDEX(p_layer, layers);
ERR_FAIL_COND(p_image->has_mipmaps() != mipmaps);
- VS::get_singleton()->texture_2d_update(texture, p_image, p_layer);
+ RS::get_singleton()->texture_2d_update(texture, p_image, p_layer);
}
Ref<Image> TextureLayered::get_layer_data(int p_layer) const {
ERR_FAIL_INDEX_V(p_layer, layers, Ref<Image>());
- return VS::get_singleton()->texture_2d_layer_get(texture, p_layer);
+ return RS::get_singleton()->texture_2d_layer_get(texture, p_layer);
}
RID TextureLayered::get_rid() const {
if (texture.is_null()) {
- texture = VS::get_singleton()->texture_2d_layered_placeholder_create();
+ texture = RS::get_singleton()->texture_2d_layered_placeholder_create();
}
return texture;
}
void TextureLayered::set_path(const String &p_path, bool p_take_over) {
if (texture.is_valid()) {
- VS::get_singleton()->texture_set_path(texture, p_path);
+ RS::get_singleton()->texture_set_path(texture, p_path);
}
Resource::set_path(p_path, p_take_over);
@@ -2009,7 +2009,7 @@ void TextureLayered::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "_images", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_INTERNAL), "create_from_images", "_get_images");
}
-TextureLayered::TextureLayered(VisualServer::TextureLayeredType p_layered_type) {
+TextureLayered::TextureLayered(RenderingServer::TextureLayeredType p_layered_type) {
layered_type = p_layered_type;
format = Image::FORMAT_MAX;
@@ -2020,7 +2020,7 @@ TextureLayered::TextureLayered(VisualServer::TextureLayeredType p_layered_type)
TextureLayered::~TextureLayered() {
if (texture.is_valid()) {
- VS::get_singleton()->free(texture);
+ RS::get_singleton()->free(texture);
}
}
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 1fb8742cec..c3bbbd5ee6 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -41,7 +41,7 @@
#include "scene/resources/curve.h"
#include "scene/resources/gradient.h"
#include "servers/camera_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class Texture : public Resource {
GDCLASS(Texture, Resource);
@@ -68,9 +68,9 @@ public:
virtual bool has_alpha() const = 0;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
virtual bool get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const;
virtual Ref<Image> get_data() const { return Ref<Image>(); }
@@ -118,9 +118,9 @@ public:
virtual RID get_rid() const;
bool has_alpha() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
bool is_pixel_opaque(int p_x, int p_y) const;
@@ -171,7 +171,7 @@ private:
virtual void reload_from_file();
static void _requested_3d(void *p_ud);
- static void _requested_roughness(void *p_ud, const String &p_normal_path, VS::TextureDetectRoughnessChannel p_roughness_channel);
+ static void _requested_roughness(void *p_ud, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_roughness_channel);
static void _requested_normal(void *p_ud);
protected:
@@ -182,7 +182,7 @@ public:
static Ref<Image> load_image_from_file(FileAccess *p_file, int p_size_limit);
typedef void (*TextureFormatRequestCallback)(const Ref<StreamTexture> &);
- typedef void (*TextureFormatRoughnessRequestCallback)(const Ref<StreamTexture> &, const String &p_normal_path, VS::TextureDetectRoughnessChannel p_roughness_channel);
+ typedef void (*TextureFormatRoughnessRequestCallback)(const Ref<StreamTexture> &, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_roughness_channel);
static TextureFormatRequestCallback request_3d_callback;
static TextureFormatRoughnessRequestCallback request_roughness_callback;
@@ -198,9 +198,9 @@ public:
virtual void set_path(const String &p_path, bool p_take_over);
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
virtual bool has_alpha() const;
bool is_pixel_opaque(int p_x, int p_y) const;
@@ -251,9 +251,9 @@ public:
void set_filter_clip(const bool p_enable);
bool has_filter_clip() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
virtual bool get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const;
bool is_pixel_opaque(int p_x, int p_y) const;
@@ -291,9 +291,9 @@ public:
void set_base_texture(const Ref<Texture2D> &p_texture);
Ref<Texture2D> get_base_texture() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
virtual bool get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const;
bool is_pixel_opaque(int p_x, int p_y) const;
@@ -339,9 +339,9 @@ public:
Ref<Texture2D> get_piece_texture(int p_idx) const;
Ref<Image> to_image() const;
- virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
- virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), VS::CanvasItemTextureFilter p_texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) const;
+ virtual void draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture2D> &p_normal_map = Ref<Texture2D>(), const Ref<Texture2D> &p_specular_map = Ref<Texture2D>(), const Color &p_specular_color_shininess = Color(1, 1, 1, 1), RS::CanvasItemTextureFilter p_texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, bool p_clip_uv = true) const;
bool is_pixel_opaque(int p_x, int p_y) const;
@@ -352,7 +352,7 @@ class TextureLayered : public Texture {
GDCLASS(TextureLayered, Texture);
- VS::TextureLayeredType layered_type;
+ RS::TextureLayeredType layered_type;
mutable RID texture;
Image::Format format;
@@ -383,7 +383,7 @@ public:
virtual RID get_rid() const;
virtual void set_path(const String &p_path, bool p_take_over = false);
- TextureLayered(VS::TextureLayeredType p_layered_type);
+ TextureLayered(RS::TextureLayeredType p_layered_type);
~TextureLayered();
};
@@ -392,7 +392,7 @@ class Texture2DArray : public TextureLayered {
GDCLASS(Texture2DArray, TextureLayered)
public:
Texture2DArray() :
- TextureLayered(VS::TEXTURE_LAYERED_2D_ARRAY) {}
+ TextureLayered(RS::TEXTURE_LAYERED_2D_ARRAY) {}
};
class Cubemap : public TextureLayered {
@@ -401,7 +401,7 @@ class Cubemap : public TextureLayered {
public:
Cubemap() :
- TextureLayered(VS::TEXTURE_LAYERED_CUBEMAP) {}
+ TextureLayered(RS::TEXTURE_LAYERED_CUBEMAP) {}
};
class CubemapArray : public TextureLayered {
@@ -410,7 +410,7 @@ class CubemapArray : public TextureLayered {
public:
CubemapArray() :
- TextureLayered(VS::TEXTURE_LAYERED_CUBEMAP_ARRAY) {}
+ TextureLayered(RS::TEXTURE_LAYERED_CUBEMAP_ARRAY) {}
};
class ResourceFormatLoaderTextureLayered : public ResourceFormatLoader {
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index b312aa054c..27305cfff1 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -362,7 +362,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::BOOL, pre + "shape_one_way", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
p_list->push_back(PropertyInfo(Variant::FLOAT, pre + "shape_one_way_margin", PROPERTY_HINT_RANGE, "0,128,0.01", PROPERTY_USAGE_NOEDITOR));
p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "shapes", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
- p_list->push_back(PropertyInfo(Variant::INT, pre + "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1", PROPERTY_USAGE_NOEDITOR));
+ p_list->push_back(PropertyInfo(Variant::INT, pre + "z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1", PROPERTY_USAGE_NOEDITOR));
}
}
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index c4a019c728..c47e80c807 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -31,7 +31,7 @@
#include "visual_shader.h"
#include "core/vmap.h"
-#include "servers/visual/shader_types.h"
+#include "servers/rendering/shader_types.h"
#include "visual_shader_nodes.h"
bool VisualShaderNode::is_simple_decl() const {
@@ -1040,8 +1040,8 @@ void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const {
Map<String, String> blend_mode_enums;
Set<String> toggles;
- for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode)).size(); i++) {
- String mode = ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode))[i];
+ for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode)).size(); i++) {
+ String mode = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode))[i];
int idx = 0;
bool in_enum = false;
while (render_mode_enums[idx].string) {
@@ -1317,8 +1317,8 @@ void VisualShader::_update_shader() const {
int which = modes[render_mode_enums[idx].string];
int count = 0;
- for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode)).size(); i++) {
- String mode = ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode))[i];
+ for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode)).size(); i++) {
+ String mode = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode))[i];
if (mode.begins_with(render_mode_enums[idx].string)) {
if (count == which) {
if (render_mode != String()) {
@@ -1336,9 +1336,9 @@ void VisualShader::_update_shader() const {
}
//fill render mode flags
- for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode)).size(); i++) {
+ for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode)).size(); i++) {
- String mode = ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode))[i];
+ String mode = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode))[i];
if (flags.has(mode)) {
if (render_mode != String()) {
render_mode += ", ";
@@ -1358,7 +1358,7 @@ void VisualShader::_update_shader() const {
String global_expressions;
for (int i = 0, index = 0; i < TYPE_MAX; i++) {
- if (!ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader_mode)).has(func_name[i])) {
+ if (!ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader_mode)).has(func_name[i])) {
continue;
}
@@ -1378,7 +1378,7 @@ void VisualShader::_update_shader() const {
for (int i = 0; i < TYPE_MAX; i++) {
- if (!ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader_mode)).has(func_name[i])) {
+ if (!ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader_mode)).has(func_name[i])) {
continue;
}
@@ -1417,7 +1417,7 @@ void VisualShader::_update_shader() const {
final_code += global_expressions;
String tcode = code;
for (int i = 0; i < TYPE_MAX; i++) {
- if (!ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader_mode)).has(func_name[i])) {
+ if (!ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader_mode)).has(func_name[i])) {
continue;
}
tcode = tcode.insert(insertion_pos[i], global_code_per_func[Type(i)]);
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index 75bdeeac07..ef8067497f 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -34,8 +34,8 @@
#include "scene/2d/camera_2d.h"
#include "scene/2d/visibility_notifier_2d.h"
#include "scene/main/window.h"
-#include "servers/physics_2d_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_2d.h"
+#include "servers/rendering_server.h"
struct SpatialIndexer2D {
@@ -379,30 +379,30 @@ void World2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "Physics2DDirectSpaceState", 0), "", "get_direct_space_state");
}
-Physics2DDirectSpaceState *World2D::get_direct_space_state() {
+PhysicsDirectSpaceState2D *World2D::get_direct_space_state() {
- return Physics2DServer::get_singleton()->space_get_direct_state(space);
+ return PhysicsServer2D::get_singleton()->space_get_direct_state(space);
}
World2D::World2D() {
- canvas = VisualServer::get_singleton()->canvas_create();
- space = Physics2DServer::get_singleton()->space_create();
+ canvas = RenderingServer::get_singleton()->canvas_create();
+ space = PhysicsServer2D::get_singleton()->space_create();
//set space2D to be more friendly with pixels than meters, by adjusting some constants
- Physics2DServer::get_singleton()->space_set_active(space, true);
- Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_GRAVITY, GLOBAL_DEF("physics/2d/default_gravity", 98));
- Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_GRAVITY_VECTOR, GLOBAL_DEF("physics/2d/default_gravity_vector", Vector2(0, 1)));
- Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_LINEAR_DAMP, GLOBAL_DEF("physics/2d/default_linear_damp", 0.1));
+ PhysicsServer2D::get_singleton()->space_set_active(space, true);
+ PhysicsServer2D::get_singleton()->area_set_param(space, PhysicsServer2D::AREA_PARAM_GRAVITY, GLOBAL_DEF("physics/2d/default_gravity", 98));
+ PhysicsServer2D::get_singleton()->area_set_param(space, PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR, GLOBAL_DEF("physics/2d/default_gravity_vector", Vector2(0, 1)));
+ PhysicsServer2D::get_singleton()->area_set_param(space, PhysicsServer2D::AREA_PARAM_LINEAR_DAMP, GLOBAL_DEF("physics/2d/default_linear_damp", 0.1));
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/default_linear_damp", PropertyInfo(Variant::FLOAT, "physics/2d/default_linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"));
- Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_ANGULAR_DAMP, GLOBAL_DEF("physics/2d/default_angular_damp", 1.0));
+ PhysicsServer2D::get_singleton()->area_set_param(space, PhysicsServer2D::AREA_PARAM_ANGULAR_DAMP, GLOBAL_DEF("physics/2d/default_angular_damp", 1.0));
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/default_angular_damp", PropertyInfo(Variant::FLOAT, "physics/2d/default_angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"));
indexer = memnew(SpatialIndexer2D);
}
World2D::~World2D() {
- VisualServer::get_singleton()->free(canvas);
- Physics2DServer::get_singleton()->free(space);
+ RenderingServer::get_singleton()->free(canvas);
+ PhysicsServer2D::get_singleton()->free(space);
memdelete(indexer);
}
diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h
index d837ef58c2..88b4c2594c 100644
--- a/scene/resources/world_2d.h
+++ b/scene/resources/world_2d.h
@@ -33,7 +33,7 @@
#include "core/project_settings.h"
#include "core/resource.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
class VisibilityNotifier2D;
class Viewport;
@@ -67,7 +67,7 @@ public:
RID get_canvas();
RID get_space();
- Physics2DDirectSpaceState *get_direct_space_state();
+ PhysicsDirectSpaceState2D *get_direct_space_state();
void get_viewport_list(List<Viewport *> *r_viewports);
diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp
index 0a687af803..8e45b22cbf 100644
--- a/scene/resources/world_3d.cpp
+++ b/scene/resources/world_3d.cpp
@@ -275,9 +275,9 @@ void World3D::set_environment(const Ref<Environment> &p_environment) {
environment = p_environment;
if (environment.is_valid())
- VS::get_singleton()->scenario_set_environment(scenario, environment->get_rid());
+ RS::get_singleton()->scenario_set_environment(scenario, environment->get_rid());
else
- VS::get_singleton()->scenario_set_environment(scenario, RID());
+ RS::get_singleton()->scenario_set_environment(scenario, RID());
emit_changed();
}
@@ -294,9 +294,9 @@ void World3D::set_fallback_environment(const Ref<Environment> &p_environment) {
fallback_environment = p_environment;
if (fallback_environment.is_valid())
- VS::get_singleton()->scenario_set_fallback_environment(scenario, p_environment->get_rid());
+ RS::get_singleton()->scenario_set_fallback_environment(scenario, p_environment->get_rid());
else
- VS::get_singleton()->scenario_set_fallback_environment(scenario, RID());
+ RS::get_singleton()->scenario_set_fallback_environment(scenario, RID());
emit_changed();
}
@@ -310,9 +310,9 @@ void World3D::set_camera_effects(const Ref<CameraEffects> &p_camera_effects) {
camera_effects = p_camera_effects;
if (camera_effects.is_valid())
- VS::get_singleton()->scenario_set_camera_effects(scenario, camera_effects->get_rid());
+ RS::get_singleton()->scenario_set_camera_effects(scenario, camera_effects->get_rid());
else
- VS::get_singleton()->scenario_set_camera_effects(scenario, RID());
+ RS::get_singleton()->scenario_set_camera_effects(scenario, RID());
}
Ref<CameraEffects> World3D::get_camera_effects() const {
@@ -320,9 +320,9 @@ Ref<CameraEffects> World3D::get_camera_effects() const {
return camera_effects;
}
-PhysicsDirectSpaceState *World3D::get_direct_space_state() {
+PhysicsDirectSpaceState3D *World3D::get_direct_space_state() {
- return PhysicsServer::get_singleton()->space_get_direct_state(space);
+ return PhysicsServer3D::get_singleton()->space_get_direct_state(space);
}
void World3D::get_camera_list(List<Camera3D *> *r_cameras) {
@@ -353,15 +353,15 @@ void World3D::_bind_methods() {
World3D::World3D() {
- space = PhysicsServer::get_singleton()->space_create();
- scenario = VisualServer::get_singleton()->scenario_create();
+ space = PhysicsServer3D::get_singleton()->space_create();
+ scenario = RenderingServer::get_singleton()->scenario_create();
- PhysicsServer::get_singleton()->space_set_active(space, true);
- PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_GRAVITY, GLOBAL_DEF("physics/3d/default_gravity", 9.8));
- PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_GRAVITY_VECTOR, GLOBAL_DEF("physics/3d/default_gravity_vector", Vector3(0, -1, 0)));
- PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_LINEAR_DAMP, GLOBAL_DEF("physics/3d/default_linear_damp", 0.1));
+ PhysicsServer3D::get_singleton()->space_set_active(space, true);
+ PhysicsServer3D::get_singleton()->area_set_param(space, PhysicsServer3D::AREA_PARAM_GRAVITY, GLOBAL_DEF("physics/3d/default_gravity", 9.8));
+ PhysicsServer3D::get_singleton()->area_set_param(space, PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR, GLOBAL_DEF("physics/3d/default_gravity_vector", Vector3(0, -1, 0)));
+ PhysicsServer3D::get_singleton()->area_set_param(space, PhysicsServer3D::AREA_PARAM_LINEAR_DAMP, GLOBAL_DEF("physics/3d/default_linear_damp", 0.1));
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/default_linear_damp", PropertyInfo(Variant::FLOAT, "physics/3d/default_linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"));
- PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_ANGULAR_DAMP, GLOBAL_DEF("physics/3d/default_angular_damp", 0.1));
+ PhysicsServer3D::get_singleton()->area_set_param(space, PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP, GLOBAL_DEF("physics/3d/default_angular_damp", 0.1));
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/default_angular_damp", PropertyInfo(Variant::FLOAT, "physics/3d/default_angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"));
#ifdef _3D_DISABLED
@@ -373,8 +373,8 @@ World3D::World3D() {
World3D::~World3D() {
- PhysicsServer::get_singleton()->free(space);
- VisualServer::get_singleton()->free(scenario);
+ PhysicsServer3D::get_singleton()->free(space);
+ RenderingServer::get_singleton()->free(scenario);
#ifndef _3D_DISABLED
memdelete(indexer);
diff --git a/scene/resources/world_3d.h b/scene/resources/world_3d.h
index 4c18ba9cea..81a27a7349 100644
--- a/scene/resources/world_3d.h
+++ b/scene/resources/world_3d.h
@@ -33,8 +33,8 @@
#include "core/resource.h"
#include "scene/resources/environment.h"
-#include "servers/physics_server.h"
-#include "servers/visual_server.h"
+#include "servers/physics_server_3d.h"
+#include "servers/rendering_server.h"
class Camera3D;
class VisibilityNotifier3D;
@@ -82,7 +82,7 @@ public:
void get_camera_list(List<Camera3D *> *r_cameras);
- PhysicsDirectSpaceState *get_direct_space_state();
+ PhysicsDirectSpaceState3D *get_direct_space_state();
World3D();
~World3D();
diff --git a/scene/resources/world_margin_shape_3d.cpp b/scene/resources/world_margin_shape_3d.cpp
index 3bea3111ef..aa96f8aa68 100644
--- a/scene/resources/world_margin_shape_3d.cpp
+++ b/scene/resources/world_margin_shape_3d.cpp
@@ -30,7 +30,7 @@
#include "world_margin_shape_3d.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
Vector<Vector3> WorldMarginShape3D::get_debug_mesh_lines() {
@@ -63,7 +63,7 @@ Vector<Vector3> WorldMarginShape3D::get_debug_mesh_lines() {
void WorldMarginShape3D::_update_shape() {
- PhysicsServer::get_singleton()->shape_set_data(get_shape(), plane);
+ PhysicsServer3D::get_singleton()->shape_set_data(get_shape(), plane);
Shape3D::_update_shape();
}
@@ -89,7 +89,7 @@ void WorldMarginShape3D::_bind_methods() {
}
WorldMarginShape3D::WorldMarginShape3D() :
- Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_PLANE)) {
+ Shape3D(PhysicsServer3D::get_singleton()->shape_create(PhysicsServer3D::SHAPE_PLANE)) {
set_plane(Plane(0, 1, 0, 0));
}
diff --git a/servers/SCsub b/servers/SCsub
index 34ba70b8cb..7706b99d87 100644
--- a/servers/SCsub
+++ b/servers/SCsub
@@ -7,9 +7,9 @@ env.add_source_files(env.servers_sources, "*.cpp")
SConscript('arvr/SCsub')
SConscript('camera/SCsub')
-SConscript('physics/SCsub')
+SConscript('physics_3d/SCsub')
SConscript('physics_2d/SCsub')
-SConscript('visual/SCsub')
+SConscript('rendering/SCsub')
SConscript('audio/SCsub')
lib = env.add_library("servers", env.servers_sources)
diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp
index 4b3417db6c..724414ae96 100644
--- a/servers/arvr_server.cpp
+++ b/servers/arvr_server.cpp
@@ -343,7 +343,7 @@ uint64_t ARVRServer::get_last_frame_usec() {
};
void ARVRServer::_process() {
- /* called from visual_server_viewport.draw_viewports right before we start drawing our viewports */
+ /* called from rendering_server_viewport.draw_viewports right before we start drawing our viewports */
/* mark for our frame timing */
last_process_usec = OS::get_singleton()->get_ticks_usec();
diff --git a/servers/camera/camera_feed.cpp b/servers/camera/camera_feed.cpp
index e8537950ec..41f44abae8 100644
--- a/servers/camera/camera_feed.cpp
+++ b/servers/camera/camera_feed.cpp
@@ -30,7 +30,7 @@
#include "camera_feed.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void CameraFeed::_bind_methods() {
// FIXME: Disabled during Vulkan refactoring, should be ported.
@@ -148,7 +148,7 @@ CameraFeed::CameraFeed() {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
// create a texture object
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
texture[CameraServer::FEED_Y_IMAGE] = vs->texture_create(); // also used for RGBA
texture[CameraServer::FEED_CBCR_IMAGE] = vs->texture_create();
#endif
@@ -168,7 +168,7 @@ CameraFeed::CameraFeed(String p_name, FeedPosition p_position) {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
// create a texture object
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
texture[CameraServer::FEED_Y_IMAGE] = vs->texture_create(); // also used for RGBA
texture[CameraServer::FEED_CBCR_IMAGE] = vs->texture_create();
#endif
@@ -178,7 +178,7 @@ CameraFeed::~CameraFeed() {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
// Free our textures
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
vs->free(texture[CameraServer::FEED_Y_IMAGE]);
vs->free(texture[CameraServer::FEED_CBCR_IMAGE]);
#endif
@@ -188,7 +188,7 @@ void CameraFeed::set_RGB_img(Ref<Image> p_rgb_img) {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
if (active) {
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
int new_width = p_rgb_img->get_width();
int new_height = p_rgb_img->get_height();
@@ -198,7 +198,7 @@ void CameraFeed::set_RGB_img(Ref<Image> p_rgb_img) {
base_width = new_width;
base_height = new_height;
- vs->texture_allocate(texture[CameraServer::FEED_RGBA_IMAGE], new_width, new_height, 0, Image::FORMAT_RGB8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAGS_DEFAULT);
+ vs->texture_allocate(texture[CameraServer::FEED_RGBA_IMAGE], new_width, new_height, 0, Image::FORMAT_RGB8, RS::TEXTURE_TYPE_2D, RS::TEXTURE_FLAGS_DEFAULT);
}
vs->texture_set_data(texture[CameraServer::FEED_RGBA_IMAGE], p_rgb_img);
@@ -211,7 +211,7 @@ void CameraFeed::set_YCbCr_img(Ref<Image> p_ycbcr_img) {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
if (active) {
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
int new_width = p_ycbcr_img->get_width();
int new_height = p_ycbcr_img->get_height();
@@ -221,7 +221,7 @@ void CameraFeed::set_YCbCr_img(Ref<Image> p_ycbcr_img) {
base_width = new_width;
base_height = new_height;
- vs->texture_allocate(texture[CameraServer::FEED_RGBA_IMAGE], new_width, new_height, 0, Image::FORMAT_RGB8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAGS_DEFAULT);
+ vs->texture_allocate(texture[CameraServer::FEED_RGBA_IMAGE], new_width, new_height, 0, Image::FORMAT_RGB8, RS::TEXTURE_TYPE_2D, RS::TEXTURE_FLAGS_DEFAULT);
}
vs->texture_set_data(texture[CameraServer::FEED_RGBA_IMAGE], p_ycbcr_img);
@@ -234,7 +234,7 @@ void CameraFeed::set_YCbCr_imgs(Ref<Image> p_y_img, Ref<Image> p_cbcr_img) {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
if (active) {
- VisualServer *vs = VisualServer::get_singleton();
+ RenderingServer *vs = RenderingServer::get_singleton();
///@TODO investigate whether we can use thirdparty/misc/yuv2rgb.h here to convert our YUV data to RGB, our shader approach is potentially faster though..
// Wondering about including that into multiple projects, may cause issues.
@@ -250,10 +250,10 @@ void CameraFeed::set_YCbCr_imgs(Ref<Image> p_y_img, Ref<Image> p_cbcr_img) {
base_width = new_y_width;
base_height = new_y_height;
- vs->texture_allocate(texture[CameraServer::FEED_Y_IMAGE], new_y_width, new_y_height, 0, Image::FORMAT_R8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING);
+ vs->texture_allocate(texture[CameraServer::FEED_Y_IMAGE], new_y_width, new_y_height, 0, Image::FORMAT_R8, RS::TEXTURE_TYPE_2D, RS::TEXTURE_FLAG_USED_FOR_STREAMING);
///@TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion
- vs->texture_allocate(texture[CameraServer::FEED_CBCR_IMAGE], new_cbcr_width, new_cbcr_height, 0, Image::FORMAT_RG8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING);
+ vs->texture_allocate(texture[CameraServer::FEED_CBCR_IMAGE], new_cbcr_width, new_cbcr_height, 0, Image::FORMAT_RG8, RS::TEXTURE_TYPE_2D, RS::TEXTURE_FLAG_USED_FOR_STREAMING);
}
vs->texture_set_data(texture[CameraServer::FEED_Y_IMAGE], p_y_img);
@@ -265,15 +265,15 @@ void CameraFeed::set_YCbCr_imgs(Ref<Image> p_y_img, Ref<Image> p_cbcr_img) {
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
-void CameraFeed::allocate_texture(int p_width, int p_height, Image::Format p_format, VisualServer::TextureType p_texture_type, FeedDataType p_data_type) {
- VisualServer *vs = VisualServer::get_singleton();
+void CameraFeed::allocate_texture(int p_width, int p_height, Image::Format p_format, RenderingServer::TextureType p_texture_type, FeedDataType p_data_type) {
+ RenderingServer *vs = RenderingServer::get_singleton();
if ((base_width != p_width) || (base_height != p_height)) {
// We're assuming here that our camera image doesn't change around formats etc, allocate the whole lot...
base_width = p_width;
base_height = p_height;
- vs->texture_allocate(texture[0], p_width, p_height, 0, p_format, p_texture_type, VS::TEXTURE_FLAGS_DEFAULT);
+ vs->texture_allocate(texture[0], p_width, p_height, 0, p_format, p_texture_type, RS::TEXTURE_FLAGS_DEFAULT);
}
datatype = p_data_type;
diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h
index b99ded68e4..52a737cd8d 100644
--- a/servers/camera/camera_feed.h
+++ b/servers/camera/camera_feed.h
@@ -34,7 +34,7 @@
#include "core/image.h"
#include "core/math/transform_2d.h"
#include "servers/camera_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
/**
@author Bastiaan Olij <mux213@gmail.com>
@@ -105,7 +105,7 @@ public:
void set_YCbCr_imgs(Ref<Image> p_y_img, Ref<Image> p_cbcr_img);
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
- void allocate_texture(int p_width, int p_height, Image::Format p_format, VisualServer::TextureType p_texture_type, FeedDataType p_data_type);
+ void allocate_texture(int p_width, int p_height, Image::Format p_format, RenderingServer::TextureType p_texture_type, FeedDataType p_data_type);
#endif
virtual bool activate_feed();
diff --git a/servers/camera_server.cpp b/servers/camera_server.cpp
index fd88d15e58..1a86ff1af4 100644
--- a/servers/camera_server.cpp
+++ b/servers/camera_server.cpp
@@ -29,8 +29,8 @@
/*************************************************************************/
#include "camera_server.h"
+#include "rendering_server.h"
#include "servers/camera/camera_feed.h"
-#include "visual_server.h"
////////////////////////////////////////////////////////
// CameraServer
diff --git a/servers/display_server.h b/servers/display_server.h
index 4803eeb084..c0e92891a3 100644
--- a/servers/display_server.h
+++ b/servers/display_server.h
@@ -83,7 +83,7 @@ protected:
static DisplayServerCreate server_create_functions[MAX_SERVERS];
static int server_create_count;
- friend class VisualServerRaster;
+ friend class RenderingServerRaster;
virtual void _set_use_vsync(bool p_enable);
public:
diff --git a/servers/navigation_2d_server.cpp b/servers/navigation_server_2d.cpp
index d9b53122e2..b64ad0e5ab 100644
--- a/servers/navigation_2d_server.cpp
+++ b/servers/navigation_server_2d.cpp
@@ -28,77 +28,77 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "servers/navigation_2d_server.h"
+#include "servers/navigation_server_2d.h"
#include "core/math/transform.h"
#include "core/math/transform_2d.h"
-#include "servers/navigation_server.h"
+#include "servers/navigation_server_3d.h"
/**
@author AndreaCatania
*/
-Navigation2DServer *Navigation2DServer::singleton = NULL;
+NavigationServer2D *NavigationServer2D::singleton = NULL;
-#define FORWARD_0_C(FUNC_NAME) \
- Navigation2DServer::FUNC_NAME() \
- const { \
- return NavigationServer::get_singleton()->FUNC_NAME(); \
+#define FORWARD_0_C(FUNC_NAME) \
+ NavigationServer2D::FUNC_NAME() \
+ const { \
+ return NavigationServer3D::get_singleton()->FUNC_NAME(); \
}
-#define FORWARD_1(FUNC_NAME, T_0, D_0, CONV_0) \
- Navigation2DServer::FUNC_NAME(T_0 D_0) { \
- return NavigationServer::get_singleton_mut()->FUNC_NAME(CONV_0(D_0)); \
+#define FORWARD_1(FUNC_NAME, T_0, D_0, CONV_0) \
+ NavigationServer2D::FUNC_NAME(T_0 D_0) { \
+ return NavigationServer3D::get_singleton_mut()->FUNC_NAME(CONV_0(D_0)); \
}
-#define FORWARD_1_C(FUNC_NAME, T_0, D_0, CONV_0) \
- Navigation2DServer::FUNC_NAME(T_0 D_0) \
- const { \
- return NavigationServer::get_singleton()->FUNC_NAME(CONV_0(D_0)); \
+#define FORWARD_1_C(FUNC_NAME, T_0, D_0, CONV_0) \
+ NavigationServer2D::FUNC_NAME(T_0 D_0) \
+ const { \
+ return NavigationServer3D::get_singleton()->FUNC_NAME(CONV_0(D_0)); \
}
-#define FORWARD_2_C(FUNC_NAME, T_0, D_0, T_1, D_1, CONV_0, CONV_1) \
- Navigation2DServer::FUNC_NAME(T_0 D_0, T_1 D_1) \
- const { \
- return NavigationServer::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1)); \
+#define FORWARD_2_C(FUNC_NAME, T_0, D_0, T_1, D_1, CONV_0, CONV_1) \
+ NavigationServer2D::FUNC_NAME(T_0 D_0, T_1 D_1) \
+ const { \
+ return NavigationServer3D::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1)); \
}
-#define FORWARD_2_R_C(CONV_R, FUNC_NAME, T_0, D_0, T_1, D_1, CONV_0, CONV_1) \
- Navigation2DServer::FUNC_NAME(T_0 D_0, T_1 D_1) \
- const { \
- return CONV_R(NavigationServer::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1))); \
+#define FORWARD_2_R_C(CONV_R, FUNC_NAME, T_0, D_0, T_1, D_1, CONV_0, CONV_1) \
+ NavigationServer2D::FUNC_NAME(T_0 D_0, T_1 D_1) \
+ const { \
+ return CONV_R(NavigationServer3D::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1))); \
}
-#define FORWARD_4_R_C(CONV_R, FUNC_NAME, T_0, D_0, T_1, D_1, T_2, D_2, T_3, D_3, CONV_0, CONV_1, CONV_2, CONV_3) \
- Navigation2DServer::FUNC_NAME(T_0 D_0, T_1 D_1, T_2 D_2, T_3 D_3) \
- const { \
- return CONV_R(NavigationServer::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1), CONV_2(D_2), CONV_3(D_3))); \
+#define FORWARD_4_R_C(CONV_R, FUNC_NAME, T_0, D_0, T_1, D_1, T_2, D_2, T_3, D_3, CONV_0, CONV_1, CONV_2, CONV_3) \
+ NavigationServer2D::FUNC_NAME(T_0 D_0, T_1 D_1, T_2 D_2, T_3 D_3) \
+ const { \
+ return CONV_R(NavigationServer3D::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1), CONV_2(D_2), CONV_3(D_3))); \
}
-#define FORWARD_4_C(FUNC_NAME, T_0, D_0, T_1, D_1, T_2, D_2, T_3, D_3, CONV_0, CONV_1, CONV_2, CONV_3) \
- Navigation2DServer::FUNC_NAME(T_0 D_0, T_1 D_1, T_2 D_2, T_3 D_3) \
- const { \
- return NavigationServer::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1), CONV_2(D_2), CONV_3(D_3)); \
+#define FORWARD_4_C(FUNC_NAME, T_0, D_0, T_1, D_1, T_2, D_2, T_3, D_3, CONV_0, CONV_1, CONV_2, CONV_3) \
+ NavigationServer2D::FUNC_NAME(T_0 D_0, T_1 D_1, T_2 D_2, T_3 D_3) \
+ const { \
+ return NavigationServer3D::get_singleton()->FUNC_NAME(CONV_0(D_0), CONV_1(D_1), CONV_2(D_2), CONV_3(D_3)); \
}
-RID rid_to_rid(const RID d) {
+static RID rid_to_rid(const RID d) {
return d;
}
-bool bool_to_bool(const bool d) {
+static bool bool_to_bool(const bool d) {
return d;
}
-int int_to_int(const int d) {
+static int int_to_int(const int d) {
return d;
}
-real_t real_to_real(const real_t d) {
+static real_t real_to_real(const real_t d) {
return d;
}
-Vector3 v2_to_v3(const Vector2 d) {
+static Vector3 v2_to_v3(const Vector2 d) {
return Vector3(d.x, 0.0, d.y);
}
-Vector2 v3_to_v2(const Vector3 &d) {
+static Vector2 v3_to_v2(const Vector3 &d) {
return Vector2(d.x, d.z);
}
-Vector<Vector2> vector_v3_to_v2(const Vector<Vector3> &d) {
+static Vector<Vector2> vector_v3_to_v2(const Vector<Vector3> &d) {
Vector<Vector2> nd;
nd.resize(d.size());
for (int i(0); i < nd.size(); i++) {
@@ -106,22 +106,22 @@ Vector<Vector2> vector_v3_to_v2(const Vector<Vector3> &d) {
}
return nd;
}
-Transform trf2_to_trf3(const Transform2D &d) {
+static Transform trf2_to_trf3(const Transform2D &d) {
Vector3 o(v2_to_v3(d.get_origin()));
Basis b;
b.rotate(Vector3(0, 1, 0), d.get_rotation());
return Transform(b, o);
}
-Object *obj_to_obj(Object *d) {
+static Object *obj_to_obj(Object *d) {
return d;
}
-StringName sn_to_sn(StringName &d) {
+static StringName sn_to_sn(StringName &d) {
return d;
}
-Variant var_to_var(Variant &d) {
+static Variant var_to_var(Variant &d) {
return d;
}
-Ref<NavigationMesh> poly_to_mesh(Ref<NavigationPolygon> d) {
+static Ref<NavigationMesh> poly_to_mesh(Ref<NavigationPolygon> d) {
if (d.is_valid()) {
return d->get_mesh();
} else {
@@ -129,44 +129,44 @@ Ref<NavigationMesh> poly_to_mesh(Ref<NavigationPolygon> d) {
}
}
-void Navigation2DServer::_bind_methods() {
- ClassDB::bind_method(D_METHOD("map_create"), &Navigation2DServer::map_create);
- ClassDB::bind_method(D_METHOD("map_set_active", "map", "active"), &Navigation2DServer::map_set_active);
- ClassDB::bind_method(D_METHOD("map_is_active", "nap"), &Navigation2DServer::map_is_active);
- ClassDB::bind_method(D_METHOD("map_set_cell_size", "map", "cell_size"), &Navigation2DServer::map_set_cell_size);
- ClassDB::bind_method(D_METHOD("map_get_cell_size", "map"), &Navigation2DServer::map_get_cell_size);
- ClassDB::bind_method(D_METHOD("map_set_edge_connection_margin", "map", "margin"), &Navigation2DServer::map_set_edge_connection_margin);
- ClassDB::bind_method(D_METHOD("map_get_edge_connection_margin", "map"), &Navigation2DServer::map_get_edge_connection_margin);
- ClassDB::bind_method(D_METHOD("map_get_path", "map", "origin", "destination", "optimize"), &Navigation2DServer::map_get_path);
- ClassDB::bind_method(D_METHOD("map_get_closest_point", "map", "to_point"), &Navigation2DServer::map_get_closest_point);
- ClassDB::bind_method(D_METHOD("map_get_closest_point_owner", "map", "to_point"), &Navigation2DServer::map_get_closest_point_owner);
-
- ClassDB::bind_method(D_METHOD("region_create"), &Navigation2DServer::region_create);
- ClassDB::bind_method(D_METHOD("region_set_map", "region", "map"), &Navigation2DServer::region_set_map);
- ClassDB::bind_method(D_METHOD("region_set_transform", "region", "transform"), &Navigation2DServer::region_set_transform);
- ClassDB::bind_method(D_METHOD("region_set_navpoly", "region", "nav_poly"), &Navigation2DServer::region_set_navpoly);
-
- ClassDB::bind_method(D_METHOD("agent_create"), &Navigation2DServer::agent_create);
- ClassDB::bind_method(D_METHOD("agent_set_map", "agent", "map"), &Navigation2DServer::agent_set_map);
- ClassDB::bind_method(D_METHOD("agent_set_neighbor_dist", "agent", "dist"), &Navigation2DServer::agent_set_neighbor_dist);
- ClassDB::bind_method(D_METHOD("agent_set_max_neighbors", "agent", "count"), &Navigation2DServer::agent_set_max_neighbors);
- ClassDB::bind_method(D_METHOD("agent_set_time_horizon", "agent", "time"), &Navigation2DServer::agent_set_time_horizon);
- ClassDB::bind_method(D_METHOD("agent_set_radius", "agent", "radius"), &Navigation2DServer::agent_set_radius);
- ClassDB::bind_method(D_METHOD("agent_set_max_speed", "agent", "max_speed"), &Navigation2DServer::agent_set_max_speed);
- ClassDB::bind_method(D_METHOD("agent_set_velocity", "agent", "velocity"), &Navigation2DServer::agent_set_velocity);
- ClassDB::bind_method(D_METHOD("agent_set_target_velocity", "agent", "target_velocity"), &Navigation2DServer::agent_set_target_velocity);
- ClassDB::bind_method(D_METHOD("agent_set_position", "agent", "position"), &Navigation2DServer::agent_set_position);
- ClassDB::bind_method(D_METHOD("agent_is_map_changed", "agent"), &Navigation2DServer::agent_is_map_changed);
- ClassDB::bind_method(D_METHOD("agent_set_callback", "agent", "receiver", "method", "userdata"), &Navigation2DServer::agent_set_callback, DEFVAL(Variant()));
-
- ClassDB::bind_method(D_METHOD("free", "object"), &Navigation2DServer::free);
-}
-
-Navigation2DServer::Navigation2DServer() {
+void NavigationServer2D::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("map_create"), &NavigationServer2D::map_create);
+ ClassDB::bind_method(D_METHOD("map_set_active", "map", "active"), &NavigationServer2D::map_set_active);
+ ClassDB::bind_method(D_METHOD("map_is_active", "nap"), &NavigationServer2D::map_is_active);
+ ClassDB::bind_method(D_METHOD("map_set_cell_size", "map", "cell_size"), &NavigationServer2D::map_set_cell_size);
+ ClassDB::bind_method(D_METHOD("map_get_cell_size", "map"), &NavigationServer2D::map_get_cell_size);
+ ClassDB::bind_method(D_METHOD("map_set_edge_connection_margin", "map", "margin"), &NavigationServer2D::map_set_edge_connection_margin);
+ ClassDB::bind_method(D_METHOD("map_get_edge_connection_margin", "map"), &NavigationServer2D::map_get_edge_connection_margin);
+ ClassDB::bind_method(D_METHOD("map_get_path", "map", "origin", "destination", "optimize"), &NavigationServer2D::map_get_path);
+ ClassDB::bind_method(D_METHOD("map_get_closest_point", "map", "to_point"), &NavigationServer2D::map_get_closest_point);
+ ClassDB::bind_method(D_METHOD("map_get_closest_point_owner", "map", "to_point"), &NavigationServer2D::map_get_closest_point_owner);
+
+ ClassDB::bind_method(D_METHOD("region_create"), &NavigationServer2D::region_create);
+ ClassDB::bind_method(D_METHOD("region_set_map", "region", "map"), &NavigationServer2D::region_set_map);
+ ClassDB::bind_method(D_METHOD("region_set_transform", "region", "transform"), &NavigationServer2D::region_set_transform);
+ ClassDB::bind_method(D_METHOD("region_set_navpoly", "region", "nav_poly"), &NavigationServer2D::region_set_navpoly);
+
+ ClassDB::bind_method(D_METHOD("agent_create"), &NavigationServer2D::agent_create);
+ ClassDB::bind_method(D_METHOD("agent_set_map", "agent", "map"), &NavigationServer2D::agent_set_map);
+ ClassDB::bind_method(D_METHOD("agent_set_neighbor_dist", "agent", "dist"), &NavigationServer2D::agent_set_neighbor_dist);
+ ClassDB::bind_method(D_METHOD("agent_set_max_neighbors", "agent", "count"), &NavigationServer2D::agent_set_max_neighbors);
+ ClassDB::bind_method(D_METHOD("agent_set_time_horizon", "agent", "time"), &NavigationServer2D::agent_set_time_horizon);
+ ClassDB::bind_method(D_METHOD("agent_set_radius", "agent", "radius"), &NavigationServer2D::agent_set_radius);
+ ClassDB::bind_method(D_METHOD("agent_set_max_speed", "agent", "max_speed"), &NavigationServer2D::agent_set_max_speed);
+ ClassDB::bind_method(D_METHOD("agent_set_velocity", "agent", "velocity"), &NavigationServer2D::agent_set_velocity);
+ ClassDB::bind_method(D_METHOD("agent_set_target_velocity", "agent", "target_velocity"), &NavigationServer2D::agent_set_target_velocity);
+ ClassDB::bind_method(D_METHOD("agent_set_position", "agent", "position"), &NavigationServer2D::agent_set_position);
+ ClassDB::bind_method(D_METHOD("agent_is_map_changed", "agent"), &NavigationServer2D::agent_is_map_changed);
+ ClassDB::bind_method(D_METHOD("agent_set_callback", "agent", "receiver", "method", "userdata"), &NavigationServer2D::agent_set_callback, DEFVAL(Variant()));
+
+ ClassDB::bind_method(D_METHOD("free", "object"), &NavigationServer2D::free);
+}
+
+NavigationServer2D::NavigationServer2D() {
singleton = this;
}
-Navigation2DServer::~Navigation2DServer() {
+NavigationServer2D::~NavigationServer2D() {
singleton = NULL;
}
@@ -192,13 +192,13 @@ void FORWARD_2_C(region_set_map, RID, p_region, RID, p_map, rid_to_rid, rid_to_r
void FORWARD_2_C(region_set_transform, RID, p_region, Transform2D, p_transform, rid_to_rid, trf2_to_trf3);
-void Navigation2DServer::region_set_navpoly(RID p_region, Ref<NavigationPolygon> p_nav_mesh) const {
- NavigationServer::get_singleton()->region_set_navmesh(p_region, poly_to_mesh(p_nav_mesh));
+void NavigationServer2D::region_set_navpoly(RID p_region, Ref<NavigationPolygon> p_nav_mesh) const {
+ NavigationServer3D::get_singleton()->region_set_navmesh(p_region, poly_to_mesh(p_nav_mesh));
}
-RID Navigation2DServer::agent_create() const {
- RID agent = NavigationServer::get_singleton()->agent_create();
- NavigationServer::get_singleton()->agent_set_ignore_y(agent, true);
+RID NavigationServer2D::agent_create() const {
+ RID agent = NavigationServer3D::get_singleton()->agent_create();
+ NavigationServer3D::get_singleton()->agent_set_ignore_y(agent, true);
return agent;
}
diff --git a/servers/navigation_2d_server.h b/servers/navigation_server_2d.h
index 35902f83d4..272d07667d 100644
--- a/servers/navigation_2d_server.h
+++ b/servers/navigation_server_2d.h
@@ -40,20 +40,20 @@
#include "scene/2d/navigation_region_2d.h"
// This server exposes the 3D `NavigationServer` features in the 2D world.
-class Navigation2DServer : public Object {
- GDCLASS(Navigation2DServer, Object);
+class NavigationServer2D : public Object {
+ GDCLASS(NavigationServer2D, Object);
- static Navigation2DServer *singleton;
+ static NavigationServer2D *singleton;
protected:
static void _bind_methods();
public:
/// Thread safe, can be used across many threads.
- static const Navigation2DServer *get_singleton() { return singleton; }
+ static const NavigationServer2D *get_singleton() { return singleton; }
/// MUST be used in single thread!
- static Navigation2DServer *get_singleton_mut() { return singleton; }
+ static NavigationServer2D *get_singleton_mut() { return singleton; }
/// Create a new map.
virtual RID map_create() const;
@@ -156,8 +156,8 @@ public:
/// Destroy the `RID`
virtual void free(RID p_object) const;
- Navigation2DServer();
- virtual ~Navigation2DServer();
+ NavigationServer2D();
+ virtual ~NavigationServer2D();
};
#endif
diff --git a/servers/navigation_server.cpp b/servers/navigation_server_3d.cpp
index f2b727ac47..3cfc47b1e5 100644
--- a/servers/navigation_server.cpp
+++ b/servers/navigation_server_3d.cpp
@@ -32,76 +32,76 @@
@author AndreaCatania
*/
-#include "navigation_server.h"
-
-NavigationServer *NavigationServer::singleton = NULL;
-
-void NavigationServer::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("map_create"), &NavigationServer::map_create);
- ClassDB::bind_method(D_METHOD("map_set_active", "map", "active"), &NavigationServer::map_set_active);
- ClassDB::bind_method(D_METHOD("map_is_active", "nap"), &NavigationServer::map_is_active);
- ClassDB::bind_method(D_METHOD("map_set_up", "map", "up"), &NavigationServer::map_set_up);
- ClassDB::bind_method(D_METHOD("map_get_up", "map"), &NavigationServer::map_get_up);
- ClassDB::bind_method(D_METHOD("map_set_cell_size", "map", "cell_size"), &NavigationServer::map_set_cell_size);
- ClassDB::bind_method(D_METHOD("map_get_cell_size", "map"), &NavigationServer::map_get_cell_size);
- ClassDB::bind_method(D_METHOD("map_set_edge_connection_margin", "map", "margin"), &NavigationServer::map_set_edge_connection_margin);
- ClassDB::bind_method(D_METHOD("map_get_edge_connection_margin", "map"), &NavigationServer::map_get_edge_connection_margin);
- ClassDB::bind_method(D_METHOD("map_get_path", "map", "origin", "destination", "optimize"), &NavigationServer::map_get_path);
- ClassDB::bind_method(D_METHOD("map_get_closest_point_to_segment", "map", "start", "end", "use_collision"), &NavigationServer::map_get_closest_point_to_segment, DEFVAL(false));
- ClassDB::bind_method(D_METHOD("map_get_closest_point", "map", "to_point"), &NavigationServer::map_get_closest_point);
- ClassDB::bind_method(D_METHOD("map_get_closest_point_normal", "map", "to_point"), &NavigationServer::map_get_closest_point_normal);
- ClassDB::bind_method(D_METHOD("map_get_closest_point_owner", "map", "to_point"), &NavigationServer::map_get_closest_point_owner);
-
- ClassDB::bind_method(D_METHOD("region_create"), &NavigationServer::region_create);
- ClassDB::bind_method(D_METHOD("region_set_map", "region", "map"), &NavigationServer::region_set_map);
- ClassDB::bind_method(D_METHOD("region_set_transform", "region", "transform"), &NavigationServer::region_set_transform);
- ClassDB::bind_method(D_METHOD("region_set_navmesh", "region", "nav_mesh"), &NavigationServer::region_set_navmesh);
- ClassDB::bind_method(D_METHOD("region_bake_navmesh", "mesh", "node"), &NavigationServer::region_bake_navmesh);
-
- ClassDB::bind_method(D_METHOD("agent_create"), &NavigationServer::agent_create);
- ClassDB::bind_method(D_METHOD("agent_set_map", "agent", "map"), &NavigationServer::agent_set_map);
- ClassDB::bind_method(D_METHOD("agent_set_neighbor_dist", "agent", "dist"), &NavigationServer::agent_set_neighbor_dist);
- ClassDB::bind_method(D_METHOD("agent_set_max_neighbors", "agent", "count"), &NavigationServer::agent_set_max_neighbors);
- ClassDB::bind_method(D_METHOD("agent_set_time_horizon", "agent", "time"), &NavigationServer::agent_set_time_horizon);
- ClassDB::bind_method(D_METHOD("agent_set_radius", "agent", "radius"), &NavigationServer::agent_set_radius);
- ClassDB::bind_method(D_METHOD("agent_set_max_speed", "agent", "max_speed"), &NavigationServer::agent_set_max_speed);
- ClassDB::bind_method(D_METHOD("agent_set_velocity", "agent", "velocity"), &NavigationServer::agent_set_velocity);
- ClassDB::bind_method(D_METHOD("agent_set_target_velocity", "agent", "target_velocity"), &NavigationServer::agent_set_target_velocity);
- ClassDB::bind_method(D_METHOD("agent_set_position", "agent", "position"), &NavigationServer::agent_set_position);
- ClassDB::bind_method(D_METHOD("agent_is_map_changed", "agent"), &NavigationServer::agent_is_map_changed);
- ClassDB::bind_method(D_METHOD("agent_set_callback", "agent", "receiver", "method", "userdata"), &NavigationServer::agent_set_callback, DEFVAL(Variant()));
-
- ClassDB::bind_method(D_METHOD("free", "object"), &NavigationServer::free);
-
- ClassDB::bind_method(D_METHOD("set_active", "active"), &NavigationServer::set_active);
- ClassDB::bind_method(D_METHOD("process", "delta_time"), &NavigationServer::process);
+#include "navigation_server_3d.h"
+
+NavigationServer3D *NavigationServer3D::singleton = NULL;
+
+void NavigationServer3D::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("map_create"), &NavigationServer3D::map_create);
+ ClassDB::bind_method(D_METHOD("map_set_active", "map", "active"), &NavigationServer3D::map_set_active);
+ ClassDB::bind_method(D_METHOD("map_is_active", "nap"), &NavigationServer3D::map_is_active);
+ ClassDB::bind_method(D_METHOD("map_set_up", "map", "up"), &NavigationServer3D::map_set_up);
+ ClassDB::bind_method(D_METHOD("map_get_up", "map"), &NavigationServer3D::map_get_up);
+ ClassDB::bind_method(D_METHOD("map_set_cell_size", "map", "cell_size"), &NavigationServer3D::map_set_cell_size);
+ ClassDB::bind_method(D_METHOD("map_get_cell_size", "map"), &NavigationServer3D::map_get_cell_size);
+ ClassDB::bind_method(D_METHOD("map_set_edge_connection_margin", "map", "margin"), &NavigationServer3D::map_set_edge_connection_margin);
+ ClassDB::bind_method(D_METHOD("map_get_edge_connection_margin", "map"), &NavigationServer3D::map_get_edge_connection_margin);
+ ClassDB::bind_method(D_METHOD("map_get_path", "map", "origin", "destination", "optimize"), &NavigationServer3D::map_get_path);
+ ClassDB::bind_method(D_METHOD("map_get_closest_point_to_segment", "map", "start", "end", "use_collision"), &NavigationServer3D::map_get_closest_point_to_segment, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("map_get_closest_point", "map", "to_point"), &NavigationServer3D::map_get_closest_point);
+ ClassDB::bind_method(D_METHOD("map_get_closest_point_normal", "map", "to_point"), &NavigationServer3D::map_get_closest_point_normal);
+ ClassDB::bind_method(D_METHOD("map_get_closest_point_owner", "map", "to_point"), &NavigationServer3D::map_get_closest_point_owner);
+
+ ClassDB::bind_method(D_METHOD("region_create"), &NavigationServer3D::region_create);
+ ClassDB::bind_method(D_METHOD("region_set_map", "region", "map"), &NavigationServer3D::region_set_map);
+ ClassDB::bind_method(D_METHOD("region_set_transform", "region", "transform"), &NavigationServer3D::region_set_transform);
+ ClassDB::bind_method(D_METHOD("region_set_navmesh", "region", "nav_mesh"), &NavigationServer3D::region_set_navmesh);
+ ClassDB::bind_method(D_METHOD("region_bake_navmesh", "mesh", "node"), &NavigationServer3D::region_bake_navmesh);
+
+ ClassDB::bind_method(D_METHOD("agent_create"), &NavigationServer3D::agent_create);
+ ClassDB::bind_method(D_METHOD("agent_set_map", "agent", "map"), &NavigationServer3D::agent_set_map);
+ ClassDB::bind_method(D_METHOD("agent_set_neighbor_dist", "agent", "dist"), &NavigationServer3D::agent_set_neighbor_dist);
+ ClassDB::bind_method(D_METHOD("agent_set_max_neighbors", "agent", "count"), &NavigationServer3D::agent_set_max_neighbors);
+ ClassDB::bind_method(D_METHOD("agent_set_time_horizon", "agent", "time"), &NavigationServer3D::agent_set_time_horizon);
+ ClassDB::bind_method(D_METHOD("agent_set_radius", "agent", "radius"), &NavigationServer3D::agent_set_radius);
+ ClassDB::bind_method(D_METHOD("agent_set_max_speed", "agent", "max_speed"), &NavigationServer3D::agent_set_max_speed);
+ ClassDB::bind_method(D_METHOD("agent_set_velocity", "agent", "velocity"), &NavigationServer3D::agent_set_velocity);
+ ClassDB::bind_method(D_METHOD("agent_set_target_velocity", "agent", "target_velocity"), &NavigationServer3D::agent_set_target_velocity);
+ ClassDB::bind_method(D_METHOD("agent_set_position", "agent", "position"), &NavigationServer3D::agent_set_position);
+ ClassDB::bind_method(D_METHOD("agent_is_map_changed", "agent"), &NavigationServer3D::agent_is_map_changed);
+ ClassDB::bind_method(D_METHOD("agent_set_callback", "agent", "receiver", "method", "userdata"), &NavigationServer3D::agent_set_callback, DEFVAL(Variant()));
+
+ ClassDB::bind_method(D_METHOD("free", "object"), &NavigationServer3D::free);
+
+ ClassDB::bind_method(D_METHOD("set_active", "active"), &NavigationServer3D::set_active);
+ ClassDB::bind_method(D_METHOD("process", "delta_time"), &NavigationServer3D::process);
}
-const NavigationServer *NavigationServer::get_singleton() {
+const NavigationServer3D *NavigationServer3D::get_singleton() {
return singleton;
}
-NavigationServer *NavigationServer::get_singleton_mut() {
+NavigationServer3D *NavigationServer3D::get_singleton_mut() {
return singleton;
}
-NavigationServer::NavigationServer() {
+NavigationServer3D::NavigationServer3D() {
ERR_FAIL_COND(singleton != NULL);
singleton = this;
}
-NavigationServer::~NavigationServer() {
+NavigationServer3D::~NavigationServer3D() {
singleton = NULL;
}
-NavigationServerCallback NavigationServerManager::create_callback = NULL;
+NavigationServer3DCallback NavigationServer3DManager::create_callback = NULL;
-void NavigationServerManager::set_default_server(NavigationServerCallback p_callback) {
+void NavigationServer3DManager::set_default_server(NavigationServer3DCallback p_callback) {
create_callback = p_callback;
}
-NavigationServer *NavigationServerManager::new_default_server() {
+NavigationServer3D *NavigationServer3DManager::new_default_server() {
ERR_FAIL_COND_V(create_callback == NULL, NULL);
return create_callback();
}
diff --git a/servers/navigation_server.h b/servers/navigation_server_3d.h
index 2ea8e787cf..2e9d078f73 100644
--- a/servers/navigation_server.h
+++ b/servers/navigation_server_3d.h
@@ -45,20 +45,20 @@
///
/// Note: All the `set` functions are commands executed during the `sync` phase,
/// don't expect that a change is immediately propagated.
-class NavigationServer : public Object {
- GDCLASS(NavigationServer, Object);
+class NavigationServer3D : public Object {
+ GDCLASS(NavigationServer3D, Object);
- static NavigationServer *singleton;
+ static NavigationServer3D *singleton;
protected:
static void _bind_methods();
public:
/// Thread safe, can be used across many threads.
- static const NavigationServer *get_singleton();
+ static const NavigationServer3D *get_singleton();
/// MUST be used in single thread!
- static NavigationServer *get_singleton_mut();
+ static NavigationServer3D *get_singleton_mut();
/// Create a new map.
virtual RID map_create() const = 0;
@@ -181,19 +181,19 @@ public:
/// Note: This function is not thread safe.
virtual void process(real_t delta_time) = 0;
- NavigationServer();
- virtual ~NavigationServer();
+ NavigationServer3D();
+ virtual ~NavigationServer3D();
};
-typedef NavigationServer *(*NavigationServerCallback)();
+typedef NavigationServer3D *(*NavigationServer3DCallback)();
/// Manager used for the server singleton registration
-class NavigationServerManager {
- static NavigationServerCallback create_callback;
+class NavigationServer3DManager {
+ static NavigationServer3DCallback create_callback;
public:
- static void set_default_server(NavigationServerCallback p_callback);
- static NavigationServer *new_default_server();
+ static void set_default_server(NavigationServer3DCallback p_callback);
+ static NavigationServer3D *new_default_server();
};
#endif
diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp
deleted file mode 100644
index 25b21a5394..0000000000
--- a/servers/physics/physics_server_sw.cpp
+++ /dev/null
@@ -1,1589 +0,0 @@
-/*************************************************************************/
-/* physics_server_sw.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "physics_server_sw.h"
-
-#include "broad_phase_basic.h"
-#include "broad_phase_octree.h"
-#include "core/debugger/engine_debugger.h"
-#include "core/os/os.h"
-#include "joints/cone_twist_joint_sw.h"
-#include "joints/generic_6dof_joint_sw.h"
-#include "joints/hinge_joint_sw.h"
-#include "joints/pin_joint_sw.h"
-#include "joints/slider_joint_sw.h"
-
-#define FLUSH_QUERY_CHECK(m_object) \
- ERR_FAIL_COND_MSG(m_object->get_space() && flushing_queries, "Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead.");
-
-RID PhysicsServerSW::shape_create(ShapeType p_shape) {
-
- ShapeSW *shape = NULL;
- switch (p_shape) {
-
- case SHAPE_PLANE: {
-
- shape = memnew(PlaneShapeSW);
- } break;
- case SHAPE_RAY: {
-
- shape = memnew(RayShapeSW);
- } break;
- case SHAPE_SPHERE: {
-
- shape = memnew(SphereShapeSW);
- } break;
- case SHAPE_BOX: {
-
- shape = memnew(BoxShapeSW);
- } break;
- case SHAPE_CAPSULE: {
-
- shape = memnew(CapsuleShapeSW);
- } break;
- case SHAPE_CYLINDER: {
-
- ERR_FAIL_V_MSG(RID(), "CylinderShape is not supported in GodotPhysics. Please switch to Bullet in the Project Settings.");
- } break;
- case SHAPE_CONVEX_POLYGON: {
-
- shape = memnew(ConvexPolygonShapeSW);
- } break;
- case SHAPE_CONCAVE_POLYGON: {
-
- shape = memnew(ConcavePolygonShapeSW);
- } break;
- case SHAPE_HEIGHTMAP: {
-
- shape = memnew(HeightMapShapeSW);
- } break;
- case SHAPE_CUSTOM: {
-
- ERR_FAIL_V(RID());
-
- } break;
- }
-
- RID id = shape_owner.make_rid(shape);
- shape->set_self(id);
-
- return id;
-};
-
-void PhysicsServerSW::shape_set_data(RID p_shape, const Variant &p_data) {
-
- ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND(!shape);
- shape->set_data(p_data);
-};
-
-void PhysicsServerSW::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) {
-
- ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND(!shape);
- shape->set_custom_bias(p_bias);
-}
-
-PhysicsServer::ShapeType PhysicsServerSW::shape_get_type(RID p_shape) const {
-
- const ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND_V(!shape, SHAPE_CUSTOM);
- return shape->get_type();
-};
-
-Variant PhysicsServerSW::shape_get_data(RID p_shape) const {
-
- const ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND_V(!shape, Variant());
- ERR_FAIL_COND_V(!shape->is_configured(), Variant());
- return shape->get_data();
-};
-
-void PhysicsServerSW::shape_set_margin(RID p_shape, real_t p_margin) {
-}
-
-real_t PhysicsServerSW::shape_get_margin(RID p_shape) const {
- return 0.0;
-}
-
-real_t PhysicsServerSW::shape_get_custom_solver_bias(RID p_shape) const {
-
- const ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND_V(!shape, 0);
- return shape->get_custom_bias();
-}
-
-RID PhysicsServerSW::space_create() {
-
- SpaceSW *space = memnew(SpaceSW);
- RID id = space_owner.make_rid(space);
- space->set_self(id);
- RID area_id = area_create();
- AreaSW *area = area_owner.getornull(area_id);
- ERR_FAIL_COND_V(!area, RID());
- space->set_default_area(area);
- area->set_space(space);
- area->set_priority(-1);
- RID sgb = body_create();
- body_set_space(sgb, id);
- body_set_mode(sgb, BODY_MODE_STATIC);
- space->set_static_global_body(sgb);
-
- return id;
-};
-
-void PhysicsServerSW::space_set_active(RID p_space, bool p_active) {
-
- SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND(!space);
- if (p_active)
- active_spaces.insert(space);
- else
- active_spaces.erase(space);
-}
-
-bool PhysicsServerSW::space_is_active(RID p_space) const {
-
- const SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND_V(!space, false);
-
- return active_spaces.has(space);
-}
-
-void PhysicsServerSW::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) {
-
- SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND(!space);
-
- space->set_param(p_param, p_value);
-}
-
-real_t PhysicsServerSW::space_get_param(RID p_space, SpaceParameter p_param) const {
-
- const SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND_V(!space, 0);
- return space->get_param(p_param);
-}
-
-PhysicsDirectSpaceState *PhysicsServerSW::space_get_direct_state(RID p_space) {
-
- SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND_V(!space, NULL);
- ERR_FAIL_COND_V_MSG(!doing_sync || space->is_locked(), NULL, "Space state is inaccessible right now, wait for iteration or physics process notification.");
-
- return space->get_direct_state();
-}
-
-void PhysicsServerSW::space_set_debug_contacts(RID p_space, int p_max_contacts) {
-
- SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND(!space);
- space->set_debug_contacts(p_max_contacts);
-}
-
-Vector<Vector3> PhysicsServerSW::space_get_contacts(RID p_space) const {
-
- SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND_V(!space, Vector<Vector3>());
- return space->get_debug_contacts();
-}
-
-int PhysicsServerSW::space_get_contact_count(RID p_space) const {
-
- SpaceSW *space = space_owner.getornull(p_space);
- ERR_FAIL_COND_V(!space, 0);
- return space->get_debug_contact_count();
-}
-
-RID PhysicsServerSW::area_create() {
-
- AreaSW *area = memnew(AreaSW);
- RID rid = area_owner.make_rid(area);
- area->set_self(rid);
- return rid;
-};
-
-void PhysicsServerSW::area_set_space(RID p_area, RID p_space) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- SpaceSW *space = NULL;
- if (p_space.is_valid()) {
- space = space_owner.getornull(p_space);
- ERR_FAIL_COND(!space);
- }
-
- if (area->get_space() == space)
- return; //pointless
-
- area->clear_constraints();
- area->set_space(space);
-};
-
-RID PhysicsServerSW::area_get_space(RID p_area) const {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, RID());
-
- SpaceSW *space = area->get_space();
- if (!space)
- return RID();
- return space->get_self();
-};
-
-void PhysicsServerSW::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_space_override_mode(p_mode);
-}
-
-PhysicsServer::AreaSpaceOverrideMode PhysicsServerSW::area_get_space_override_mode(RID p_area) const {
-
- const AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, AREA_SPACE_OVERRIDE_DISABLED);
-
- return area->get_space_override_mode();
-}
-
-void PhysicsServerSW::area_add_shape(RID p_area, RID p_shape, const Transform &p_transform, bool p_disabled) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND(!shape);
-
- area->add_shape(shape, p_transform, p_disabled);
-}
-
-void PhysicsServerSW::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND(!shape);
- ERR_FAIL_COND(!shape->is_configured());
-
- area->set_shape(p_shape_idx, shape);
-}
-
-void PhysicsServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_shape_transform(p_shape_idx, p_transform);
-}
-
-int PhysicsServerSW::area_get_shape_count(RID p_area) const {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, -1);
-
- return area->get_shape_count();
-}
-RID PhysicsServerSW::area_get_shape(RID p_area, int p_shape_idx) const {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, RID());
-
- ShapeSW *shape = area->get_shape(p_shape_idx);
- ERR_FAIL_COND_V(!shape, RID());
-
- return shape->get_self();
-}
-Transform PhysicsServerSW::area_get_shape_transform(RID p_area, int p_shape_idx) const {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, Transform());
-
- return area->get_shape_transform(p_shape_idx);
-}
-
-void PhysicsServerSW::area_remove_shape(RID p_area, int p_shape_idx) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->remove_shape(p_shape_idx);
-}
-
-void PhysicsServerSW::area_clear_shapes(RID p_area) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- while (area->get_shape_count())
- area->remove_shape(0);
-}
-
-void PhysicsServerSW::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
- ERR_FAIL_INDEX(p_shape_idx, area->get_shape_count());
- FLUSH_QUERY_CHECK(area);
- area->set_shape_as_disabled(p_shape_idx, p_disabled);
-}
-
-void PhysicsServerSW::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
-
- if (space_owner.owns(p_area)) {
- SpaceSW *space = space_owner.getornull(p_area);
- p_area = space->get_default_area()->get_self();
- }
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
- area->set_instance_id(p_id);
-}
-ObjectID PhysicsServerSW::area_get_object_instance_id(RID p_area) const {
-
- if (space_owner.owns(p_area)) {
- SpaceSW *space = space_owner.getornull(p_area);
- p_area = space->get_default_area()->get_self();
- }
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, ObjectID());
- return area->get_instance_id();
-}
-
-void PhysicsServerSW::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) {
-
- if (space_owner.owns(p_area)) {
- SpaceSW *space = space_owner.getornull(p_area);
- p_area = space->get_default_area()->get_self();
- }
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
- area->set_param(p_param, p_value);
-};
-
-void PhysicsServerSW::area_set_transform(RID p_area, const Transform &p_transform) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
- area->set_transform(p_transform);
-};
-
-Variant PhysicsServerSW::area_get_param(RID p_area, AreaParameter p_param) const {
-
- if (space_owner.owns(p_area)) {
- SpaceSW *space = space_owner.getornull(p_area);
- p_area = space->get_default_area()->get_self();
- }
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, Variant());
-
- return area->get_param(p_param);
-};
-
-Transform PhysicsServerSW::area_get_transform(RID p_area) const {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, Transform());
-
- return area->get_transform();
-};
-
-void PhysicsServerSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_collision_layer(p_layer);
-}
-
-void PhysicsServerSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_collision_mask(p_mask);
-}
-
-void PhysicsServerSW::area_set_monitorable(RID p_area, bool p_monitorable) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
- FLUSH_QUERY_CHECK(area);
-
- area->set_monitorable(p_monitorable);
-}
-
-void PhysicsServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
-}
-
-void PhysicsServerSW::area_set_ray_pickable(RID p_area, bool p_enable) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_ray_pickable(p_enable);
-}
-
-bool PhysicsServerSW::area_is_ray_pickable(RID p_area) const {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND_V(!area, false);
-
- return area->is_ray_pickable();
-}
-
-void PhysicsServerSW::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
-
- AreaSW *area = area_owner.getornull(p_area);
- ERR_FAIL_COND(!area);
-
- area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
-}
-
-/* BODY API */
-
-RID PhysicsServerSW::body_create(BodyMode p_mode, bool p_init_sleeping) {
-
- BodySW *body = memnew(BodySW);
- if (p_mode != BODY_MODE_RIGID)
- body->set_mode(p_mode);
- if (p_init_sleeping)
- body->set_state(BODY_STATE_SLEEPING, p_init_sleeping);
- RID rid = body_owner.make_rid(body);
- body->set_self(rid);
- return rid;
-};
-
-void PhysicsServerSW::body_set_space(RID p_body, RID p_space) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- SpaceSW *space = NULL;
- if (p_space.is_valid()) {
- space = space_owner.getornull(p_space);
- ERR_FAIL_COND(!space);
- }
-
- if (body->get_space() == space)
- return; //pointless
-
- body->clear_constraint_map();
- body->set_space(space);
-};
-
-RID PhysicsServerSW::body_get_space(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, RID());
-
- SpaceSW *space = body->get_space();
- if (!space)
- return RID();
- return space->get_self();
-};
-
-void PhysicsServerSW::body_set_mode(RID p_body, BodyMode p_mode) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_mode(p_mode);
-};
-
-PhysicsServer::BodyMode PhysicsServerSW::body_get_mode(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, BODY_MODE_STATIC);
-
- return body->get_mode();
-};
-
-void PhysicsServerSW::body_add_shape(RID p_body, RID p_shape, const Transform &p_transform, bool p_disabled) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND(!shape);
-
- body->add_shape(shape, p_transform, p_disabled);
-}
-
-void PhysicsServerSW::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- ShapeSW *shape = shape_owner.getornull(p_shape);
- ERR_FAIL_COND(!shape);
- ERR_FAIL_COND(!shape->is_configured());
-
- body->set_shape(p_shape_idx, shape);
-}
-void PhysicsServerSW::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_shape_transform(p_shape_idx, p_transform);
-}
-
-int PhysicsServerSW::body_get_shape_count(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, -1);
-
- return body->get_shape_count();
-}
-RID PhysicsServerSW::body_get_shape(RID p_body, int p_shape_idx) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, RID());
-
- ShapeSW *shape = body->get_shape(p_shape_idx);
- ERR_FAIL_COND_V(!shape, RID());
-
- return shape->get_self();
-}
-
-void PhysicsServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
- ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count());
- FLUSH_QUERY_CHECK(body);
-
- body->set_shape_as_disabled(p_shape_idx, p_disabled);
-}
-
-Transform PhysicsServerSW::body_get_shape_transform(RID p_body, int p_shape_idx) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, Transform());
-
- return body->get_shape_transform(p_shape_idx);
-}
-
-void PhysicsServerSW::body_remove_shape(RID p_body, int p_shape_idx) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->remove_shape(p_shape_idx);
-}
-
-void PhysicsServerSW::body_clear_shapes(RID p_body) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- while (body->get_shape_count())
- body->remove_shape(0);
-}
-
-void PhysicsServerSW::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_continuous_collision_detection(p_enable);
-}
-
-bool PhysicsServerSW::body_is_continuous_collision_detection_enabled(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, false);
-
- return body->is_continuous_collision_detection_enabled();
-}
-
-void PhysicsServerSW::body_set_collision_layer(RID p_body, uint32_t p_layer) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_collision_layer(p_layer);
- body->wakeup();
-}
-
-uint32_t PhysicsServerSW::body_get_collision_layer(RID p_body) const {
-
- const BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
-
- return body->get_collision_layer();
-}
-
-void PhysicsServerSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_collision_mask(p_mask);
- body->wakeup();
-}
-
-uint32_t PhysicsServerSW::body_get_collision_mask(RID p_body) const {
-
- const BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
-
- return body->get_collision_mask();
-}
-
-void PhysicsServerSW::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_instance_id(p_id);
-};
-
-ObjectID PhysicsServerSW::body_get_object_instance_id(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, ObjectID());
-
- return body->get_instance_id();
-};
-
-void PhysicsServerSW::body_set_user_flags(RID p_body, uint32_t p_flags) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-};
-
-uint32_t PhysicsServerSW::body_get_user_flags(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
-
- return 0;
-};
-
-void PhysicsServerSW::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_param(p_param, p_value);
-};
-
-real_t PhysicsServerSW::body_get_param(RID p_body, BodyParameter p_param) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
-
- return body->get_param(p_param);
-};
-
-void PhysicsServerSW::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) {
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
- body->set_kinematic_margin(p_margin);
-}
-
-real_t PhysicsServerSW::body_get_kinematic_safe_margin(RID p_body) const {
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
-
- return body->get_kinematic_margin();
-}
-
-void PhysicsServerSW::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_state(p_state, p_variant);
-};
-
-Variant PhysicsServerSW::body_get_state(RID p_body, BodyState p_state) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, Variant());
-
- return body->get_state(p_state);
-};
-
-void PhysicsServerSW::body_set_applied_force(RID p_body, const Vector3 &p_force) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_applied_force(p_force);
- body->wakeup();
-};
-
-Vector3 PhysicsServerSW::body_get_applied_force(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, Vector3());
- return body->get_applied_force();
-};
-
-void PhysicsServerSW::body_set_applied_torque(RID p_body, const Vector3 &p_torque) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_applied_torque(p_torque);
- body->wakeup();
-};
-
-Vector3 PhysicsServerSW::body_get_applied_torque(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, Vector3());
-
- return body->get_applied_torque();
-};
-
-void PhysicsServerSW::body_add_central_force(RID p_body, const Vector3 &p_force) {
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->add_central_force(p_force);
- body->wakeup();
-}
-
-void PhysicsServerSW::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) {
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->add_force(p_force, p_pos);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_add_torque(RID p_body, const Vector3 &p_torque) {
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->add_torque(p_torque);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) {
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- _update_shapes();
-
- body->apply_central_impulse(p_impulse);
- body->wakeup();
-}
-
-void PhysicsServerSW::body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- _update_shapes();
-
- body->apply_impulse(p_pos, p_impulse);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- _update_shapes();
-
- body->apply_torque_impulse(p_impulse);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- _update_shapes();
-
- Vector3 v = body->get_linear_velocity();
- Vector3 axis = p_axis_velocity.normalized();
- v -= axis * axis.dot(v);
- v += p_axis_velocity;
- body->set_linear_velocity(v);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_axis_lock(p_axis, p_lock);
- body->wakeup();
-}
-
-bool PhysicsServerSW::body_is_axis_locked(RID p_body, BodyAxis p_axis) const {
-
- const BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
- return body->is_axis_locked(p_axis);
-}
-
-void PhysicsServerSW::body_add_collision_exception(RID p_body, RID p_body_b) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->add_exception(p_body_b);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_remove_collision_exception(RID p_body, RID p_body_b) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->remove_exception(p_body_b);
- body->wakeup();
-};
-
-void PhysicsServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- for (int i = 0; i < body->get_exceptions().size(); i++) {
- p_exceptions->push_back(body->get_exceptions()[i]);
- }
-};
-
-void PhysicsServerSW::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-};
-
-real_t PhysicsServerSW::body_get_contacts_reported_depth_threshold(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, 0);
- return 0;
-};
-
-void PhysicsServerSW::body_set_omit_force_integration(RID p_body, bool p_omit) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
-
- body->set_omit_force_integration(p_omit);
-};
-
-bool PhysicsServerSW::body_is_omitting_force_integration(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, false);
- return body->get_omit_force_integration();
-};
-
-void PhysicsServerSW::body_set_max_contacts_reported(RID p_body, int p_contacts) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
- body->set_max_contacts_reported(p_contacts);
-}
-
-int PhysicsServerSW::body_get_max_contacts_reported(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, -1);
- return body->get_max_contacts_reported();
-}
-
-void PhysicsServerSW::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
- body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method, p_udata);
-}
-
-void PhysicsServerSW::body_set_ray_pickable(RID p_body, bool p_enable) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND(!body);
- body->set_ray_pickable(p_enable);
-}
-
-bool PhysicsServerSW::body_is_ray_pickable(RID p_body) const {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, false);
- return body->is_ray_pickable();
-}
-
-bool PhysicsServerSW::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, false);
- ERR_FAIL_COND_V(!body->get_space(), false);
- ERR_FAIL_COND_V(body->get_space()->is_locked(), false);
-
- _update_shapes();
-
- return body->get_space()->test_body_motion(body, p_from, p_motion, p_infinite_inertia, body->get_kinematic_margin(), r_result, p_exclude_raycast_shapes);
-}
-
-int PhysicsServerSW::body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, false);
- ERR_FAIL_COND_V(!body->get_space(), false);
- ERR_FAIL_COND_V(body->get_space()->is_locked(), false);
-
- _update_shapes();
-
- return body->get_space()->test_body_ray_separation(body, p_transform, p_infinite_inertia, r_recover_motion, r_results, p_result_max, p_margin);
-}
-
-PhysicsDirectBodyState *PhysicsServerSW::body_get_direct_state(RID p_body) {
-
- BodySW *body = body_owner.getornull(p_body);
- ERR_FAIL_COND_V(!body, NULL);
- ERR_FAIL_COND_V_MSG(!doing_sync || body->get_space()->is_locked(), NULL, "Body state is inaccessible right now, wait for iteration or physics process notification.");
-
- direct_state->body = body;
- return direct_state;
-}
-
-/* JOINT API */
-
-RID PhysicsServerSW::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) {
-
- BodySW *body_A = body_owner.getornull(p_body_A);
- ERR_FAIL_COND_V(!body_A, RID());
-
- if (!p_body_B.is_valid()) {
- ERR_FAIL_COND_V(!body_A->get_space(), RID());
- p_body_B = body_A->get_space()->get_static_global_body();
- }
-
- BodySW *body_B = body_owner.getornull(p_body_B);
- ERR_FAIL_COND_V(!body_B, RID());
-
- ERR_FAIL_COND_V(body_A == body_B, RID());
-
- JointSW *joint = memnew(PinJointSW(body_A, p_local_A, body_B, p_local_B));
- RID rid = joint_owner.make_rid(joint);
- joint->set_self(rid);
- return rid;
-}
-
-void PhysicsServerSW::pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
- PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- pin_joint->set_param(p_param, p_value);
-}
-real_t PhysicsServerSW::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, 0);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, 0);
- PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- return pin_joint->get_param(p_param);
-}
-
-void PhysicsServerSW::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
- PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- pin_joint->set_pos_a(p_A);
-}
-Vector3 PhysicsServerSW::pin_joint_get_local_a(RID p_joint) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, Vector3());
- ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
- PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- return pin_joint->get_position_a();
-}
-
-void PhysicsServerSW::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
- PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- pin_joint->set_pos_b(p_B);
-}
-Vector3 PhysicsServerSW::pin_joint_get_local_b(RID p_joint) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, Vector3());
- ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
- PinJointSW *pin_joint = static_cast<PinJointSW *>(joint);
- return pin_joint->get_position_b();
-}
-
-RID PhysicsServerSW::joint_create_hinge(RID p_body_A, const Transform &p_frame_A, RID p_body_B, const Transform &p_frame_B) {
-
- BodySW *body_A = body_owner.getornull(p_body_A);
- ERR_FAIL_COND_V(!body_A, RID());
-
- if (!p_body_B.is_valid()) {
- ERR_FAIL_COND_V(!body_A->get_space(), RID());
- p_body_B = body_A->get_space()->get_static_global_body();
- }
-
- BodySW *body_B = body_owner.getornull(p_body_B);
- ERR_FAIL_COND_V(!body_B, RID());
-
- ERR_FAIL_COND_V(body_A == body_B, RID());
-
- JointSW *joint = memnew(HingeJointSW(body_A, body_B, p_frame_A, p_frame_B));
- RID rid = joint_owner.make_rid(joint);
- joint->set_self(rid);
- return rid;
-}
-
-RID PhysicsServerSW::joint_create_hinge_simple(RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) {
-
- BodySW *body_A = body_owner.getornull(p_body_A);
- ERR_FAIL_COND_V(!body_A, RID());
-
- if (!p_body_B.is_valid()) {
- ERR_FAIL_COND_V(!body_A->get_space(), RID());
- p_body_B = body_A->get_space()->get_static_global_body();
- }
-
- BodySW *body_B = body_owner.getornull(p_body_B);
- ERR_FAIL_COND_V(!body_B, RID());
-
- ERR_FAIL_COND_V(body_A == body_B, RID());
-
- JointSW *joint = memnew(HingeJointSW(body_A, body_B, p_pivot_A, p_pivot_B, p_axis_A, p_axis_B));
- RID rid = joint_owner.make_rid(joint);
- joint->set_self(rid);
- return rid;
-}
-
-void PhysicsServerSW::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, real_t p_value) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_HINGE);
- HingeJointSW *hinge_joint = static_cast<HingeJointSW *>(joint);
- hinge_joint->set_param(p_param, p_value);
-}
-real_t PhysicsServerSW::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, 0);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, 0);
- HingeJointSW *hinge_joint = static_cast<HingeJointSW *>(joint);
- return hinge_joint->get_param(p_param);
-}
-
-void PhysicsServerSW::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_HINGE);
- HingeJointSW *hinge_joint = static_cast<HingeJointSW *>(joint);
- hinge_joint->set_flag(p_flag, p_value);
-}
-bool PhysicsServerSW::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, false);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, false);
- HingeJointSW *hinge_joint = static_cast<HingeJointSW *>(joint);
- return hinge_joint->get_flag(p_flag);
-}
-
-void PhysicsServerSW::joint_set_solver_priority(RID p_joint, int p_priority) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- joint->set_priority(p_priority);
-}
-
-int PhysicsServerSW::joint_get_solver_priority(RID p_joint) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, 0);
- return joint->get_priority();
-}
-
-void PhysicsServerSW::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) {
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
-
- joint->disable_collisions_between_bodies(p_disable);
-
- if (2 == joint->get_body_count()) {
- BodySW *body_a = *joint->get_body_ptr();
- BodySW *body_b = *(joint->get_body_ptr() + 1);
-
- if (p_disable) {
- body_add_collision_exception(body_a->get_self(), body_b->get_self());
- body_add_collision_exception(body_b->get_self(), body_a->get_self());
- } else {
- body_remove_collision_exception(body_a->get_self(), body_b->get_self());
- body_remove_collision_exception(body_b->get_self(), body_a->get_self());
- }
- }
-}
-
-bool PhysicsServerSW::joint_is_disabled_collisions_between_bodies(RID p_joint) const {
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, true);
-
- return joint->is_disabled_collisions_between_bodies();
-}
-
-PhysicsServerSW::JointType PhysicsServerSW::joint_get_type(RID p_joint) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, JOINT_PIN);
- return joint->get_type();
-}
-
-RID PhysicsServerSW::joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
-
- BodySW *body_A = body_owner.getornull(p_body_A);
- ERR_FAIL_COND_V(!body_A, RID());
-
- if (!p_body_B.is_valid()) {
- ERR_FAIL_COND_V(!body_A->get_space(), RID());
- p_body_B = body_A->get_space()->get_static_global_body();
- }
-
- BodySW *body_B = body_owner.getornull(p_body_B);
- ERR_FAIL_COND_V(!body_B, RID());
-
- ERR_FAIL_COND_V(body_A == body_B, RID());
-
- JointSW *joint = memnew(SliderJointSW(body_A, body_B, p_local_frame_A, p_local_frame_B));
- RID rid = joint_owner.make_rid(joint);
- joint->set_self(rid);
- return rid;
-}
-
-void PhysicsServerSW::slider_joint_set_param(RID p_joint, SliderJointParam p_param, real_t p_value) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_SLIDER);
- SliderJointSW *slider_joint = static_cast<SliderJointSW *>(joint);
- slider_joint->set_param(p_param, p_value);
-}
-real_t PhysicsServerSW::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, 0);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0);
- SliderJointSW *slider_joint = static_cast<SliderJointSW *>(joint);
- return slider_joint->get_param(p_param);
-}
-
-RID PhysicsServerSW::joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
-
- BodySW *body_A = body_owner.getornull(p_body_A);
- ERR_FAIL_COND_V(!body_A, RID());
-
- if (!p_body_B.is_valid()) {
- ERR_FAIL_COND_V(!body_A->get_space(), RID());
- p_body_B = body_A->get_space()->get_static_global_body();
- }
-
- BodySW *body_B = body_owner.getornull(p_body_B);
- ERR_FAIL_COND_V(!body_B, RID());
-
- ERR_FAIL_COND_V(body_A == body_B, RID());
-
- JointSW *joint = memnew(ConeTwistJointSW(body_A, body_B, p_local_frame_A, p_local_frame_B));
- RID rid = joint_owner.make_rid(joint);
- joint->set_self(rid);
- return rid;
-}
-
-void PhysicsServerSW::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, real_t p_value) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_CONE_TWIST);
- ConeTwistJointSW *cone_twist_joint = static_cast<ConeTwistJointSW *>(joint);
- cone_twist_joint->set_param(p_param, p_value);
-}
-real_t PhysicsServerSW::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, 0);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0);
- ConeTwistJointSW *cone_twist_joint = static_cast<ConeTwistJointSW *>(joint);
- return cone_twist_joint->get_param(p_param);
-}
-
-RID PhysicsServerSW::joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
-
- BodySW *body_A = body_owner.getornull(p_body_A);
- ERR_FAIL_COND_V(!body_A, RID());
-
- if (!p_body_B.is_valid()) {
- ERR_FAIL_COND_V(!body_A->get_space(), RID());
- p_body_B = body_A->get_space()->get_static_global_body();
- }
-
- BodySW *body_B = body_owner.getornull(p_body_B);
- ERR_FAIL_COND_V(!body_B, RID());
-
- ERR_FAIL_COND_V(body_A == body_B, RID());
-
- JointSW *joint = memnew(Generic6DOFJointSW(body_A, body_B, p_local_frame_A, p_local_frame_B, true));
- RID rid = joint_owner.make_rid(joint);
- joint->set_self(rid);
- return rid;
-}
-
-void PhysicsServerSW::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, real_t p_value) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
- Generic6DOFJointSW *generic_6dof_joint = static_cast<Generic6DOFJointSW *>(joint);
- generic_6dof_joint->set_param(p_axis, p_param, p_value);
-}
-real_t PhysicsServerSW::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, 0);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0);
- Generic6DOFJointSW *generic_6dof_joint = static_cast<Generic6DOFJointSW *>(joint);
- return generic_6dof_joint->get_param(p_axis, p_param);
-}
-
-void PhysicsServerSW::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND(!joint);
- ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
- Generic6DOFJointSW *generic_6dof_joint = static_cast<Generic6DOFJointSW *>(joint);
- generic_6dof_joint->set_flag(p_axis, p_flag, p_enable);
-}
-bool PhysicsServerSW::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) {
-
- JointSW *joint = joint_owner.getornull(p_joint);
- ERR_FAIL_COND_V(!joint, false);
- ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, false);
- Generic6DOFJointSW *generic_6dof_joint = static_cast<Generic6DOFJointSW *>(joint);
- return generic_6dof_joint->get_flag(p_axis, p_flag);
-}
-
-void PhysicsServerSW::free(RID p_rid) {
-
- _update_shapes(); //just in case
-
- if (shape_owner.owns(p_rid)) {
-
- ShapeSW *shape = shape_owner.getornull(p_rid);
-
- while (shape->get_owners().size()) {
- ShapeOwnerSW *so = shape->get_owners().front()->key();
- so->remove_shape(shape);
- }
-
- shape_owner.free(p_rid);
- memdelete(shape);
- } else if (body_owner.owns(p_rid)) {
-
- BodySW *body = body_owner.getornull(p_rid);
-
- /*
- if (body->get_state_query())
- _clear_query(body->get_state_query());
-
- if (body->get_direct_state_query())
- _clear_query(body->get_direct_state_query());
- */
-
- body->set_space(NULL);
-
- while (body->get_shape_count()) {
-
- body->remove_shape(0);
- }
-
- body_owner.free(p_rid);
- memdelete(body);
-
- } else if (area_owner.owns(p_rid)) {
-
- AreaSW *area = area_owner.getornull(p_rid);
-
- /*
- if (area->get_monitor_query())
- _clear_query(area->get_monitor_query());
- */
-
- area->set_space(NULL);
-
- while (area->get_shape_count()) {
-
- area->remove_shape(0);
- }
-
- area_owner.free(p_rid);
- memdelete(area);
- } else if (space_owner.owns(p_rid)) {
-
- SpaceSW *space = space_owner.getornull(p_rid);
-
- while (space->get_objects().size()) {
- CollisionObjectSW *co = (CollisionObjectSW *)space->get_objects().front()->get();
- co->set_space(NULL);
- }
-
- active_spaces.erase(space);
- free(space->get_default_area()->get_self());
- free(space->get_static_global_body());
-
- space_owner.free(p_rid);
- memdelete(space);
- } else if (joint_owner.owns(p_rid)) {
-
- JointSW *joint = joint_owner.getornull(p_rid);
-
- for (int i = 0; i < joint->get_body_count(); i++) {
-
- joint->get_body_ptr()[i]->remove_constraint(joint);
- }
- joint_owner.free(p_rid);
- memdelete(joint);
-
- } else {
-
- ERR_FAIL_MSG("Invalid ID.");
- }
-};
-
-void PhysicsServerSW::set_active(bool p_active) {
-
- active = p_active;
-};
-
-void PhysicsServerSW::init() {
-
- doing_sync = true;
- last_step = 0.001;
- iterations = 8; // 8?
- stepper = memnew(StepSW);
- direct_state = memnew(PhysicsDirectBodyStateSW);
-};
-
-void PhysicsServerSW::step(real_t p_step) {
-
-#ifndef _3D_DISABLED
-
- if (!active)
- return;
-
- _update_shapes();
-
- doing_sync = false;
-
- last_step = p_step;
- PhysicsDirectBodyStateSW::singleton->step = p_step;
-
- island_count = 0;
- active_objects = 0;
- collision_pairs = 0;
- for (Set<const SpaceSW *>::Element *E = active_spaces.front(); E; E = E->next()) {
-
- stepper->step((SpaceSW *)E->get(), p_step, iterations);
- island_count += E->get()->get_island_count();
- active_objects += E->get()->get_active_objects();
- collision_pairs += E->get()->get_collision_pairs();
- }
-#endif
-}
-
-void PhysicsServerSW::sync(){
-
-};
-
-void PhysicsServerSW::flush_queries() {
-
-#ifndef _3D_DISABLED
-
- if (!active)
- return;
-
- doing_sync = true;
-
- flushing_queries = true;
-
- uint64_t time_beg = OS::get_singleton()->get_ticks_usec();
-
- for (Set<const SpaceSW *>::Element *E = active_spaces.front(); E; E = E->next()) {
-
- SpaceSW *space = (SpaceSW *)E->get();
- space->call_queries();
- }
-
- flushing_queries = false;
-
- if (EngineDebugger::is_profiling("servers")) {
-
- uint64_t total_time[SpaceSW::ELAPSED_TIME_MAX];
- static const char *time_name[SpaceSW::ELAPSED_TIME_MAX] = {
- "integrate_forces",
- "generate_islands",
- "setup_constraints",
- "solve_constraints",
- "integrate_velocities"
- };
-
- for (int i = 0; i < SpaceSW::ELAPSED_TIME_MAX; i++) {
- total_time[i] = 0;
- }
-
- for (Set<const SpaceSW *>::Element *E = active_spaces.front(); E; E = E->next()) {
-
- for (int i = 0; i < SpaceSW::ELAPSED_TIME_MAX; i++) {
- total_time[i] += E->get()->get_elapsed_time(SpaceSW::ElapsedTime(i));
- }
- }
-
- Array values;
- values.resize(SpaceSW::ELAPSED_TIME_MAX * 2);
- for (int i = 0; i < SpaceSW::ELAPSED_TIME_MAX; i++) {
- values[i * 2 + 0] = time_name[i];
- values[i * 2 + 1] = USEC_TO_SEC(total_time[i]);
- }
- values.push_back("flush_queries");
- values.push_back(USEC_TO_SEC(OS::get_singleton()->get_ticks_usec() - time_beg));
-
- values.push_front("physics");
- EngineDebugger::profiler_add_frame_data("server", values);
- }
-#endif
-};
-
-void PhysicsServerSW::finish() {
-
- memdelete(stepper);
- memdelete(direct_state);
-};
-
-int PhysicsServerSW::get_process_info(ProcessInfo p_info) {
-
- switch (p_info) {
-
- case INFO_ACTIVE_OBJECTS: {
-
- return active_objects;
- } break;
- case INFO_COLLISION_PAIRS: {
- return collision_pairs;
- } break;
- case INFO_ISLAND_COUNT: {
-
- return island_count;
- } break;
- }
-
- return 0;
-}
-
-void PhysicsServerSW::_update_shapes() {
-
- while (pending_shape_update_list.first()) {
- pending_shape_update_list.first()->self()->_shape_changed();
- pending_shape_update_list.remove(pending_shape_update_list.first());
- }
-}
-
-void PhysicsServerSW::_shape_col_cbk(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata) {
-
- CollCbkData *cbk = (CollCbkData *)p_userdata;
-
- if (cbk->max == 0)
- return;
-
- if (cbk->amount == cbk->max) {
- //find least deep
- real_t min_depth = 1e20;
- int min_depth_idx = 0;
- for (int i = 0; i < cbk->amount; i++) {
-
- real_t d = cbk->ptr[i * 2 + 0].distance_squared_to(cbk->ptr[i * 2 + 1]);
- if (d < min_depth) {
- min_depth = d;
- min_depth_idx = i;
- }
- }
-
- real_t d = p_point_A.distance_squared_to(p_point_B);
- if (d < min_depth)
- return;
- cbk->ptr[min_depth_idx * 2 + 0] = p_point_A;
- cbk->ptr[min_depth_idx * 2 + 1] = p_point_B;
-
- } else {
-
- cbk->ptr[cbk->amount * 2 + 0] = p_point_A;
- cbk->ptr[cbk->amount * 2 + 1] = p_point_B;
- cbk->amount++;
- }
-}
-
-PhysicsServerSW *PhysicsServerSW::singleton = NULL;
-PhysicsServerSW::PhysicsServerSW() {
- singleton = this;
- BroadPhaseSW::create_func = BroadPhaseOctree::_create;
- island_count = 0;
- active_objects = 0;
- collision_pairs = 0;
-
- active = true;
- flushing_queries = false;
-};
-
-PhysicsServerSW::~PhysicsServerSW(){
-
-};
diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp
index 45666d9d09..85ec2aae47 100644
--- a/servers/physics_2d/area_2d_sw.cpp
+++ b/servers/physics_2d/area_2d_sw.cpp
@@ -117,40 +117,40 @@ void Area2DSW::set_area_monitor_callback(ObjectID p_id, const StringName &p_meth
get_space()->area_add_to_moved_list(&moved_list);
}
-void Area2DSW::set_space_override_mode(Physics2DServer::AreaSpaceOverrideMode p_mode) {
- bool do_override = p_mode != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED;
- if (do_override == (space_override_mode != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED))
+void Area2DSW::set_space_override_mode(PhysicsServer2D::AreaSpaceOverrideMode p_mode) {
+ bool do_override = p_mode != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED;
+ if (do_override == (space_override_mode != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED))
return;
_unregister_shapes();
space_override_mode = p_mode;
_shape_changed();
}
-void Area2DSW::set_param(Physics2DServer::AreaParameter p_param, const Variant &p_value) {
+void Area2DSW::set_param(PhysicsServer2D::AreaParameter p_param, const Variant &p_value) {
switch (p_param) {
- case Physics2DServer::AREA_PARAM_GRAVITY: gravity = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_VECTOR: gravity_vector = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_IS_POINT: gravity_is_point = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE: gravity_distance_scale = p_value; break;
- case Physics2DServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION: point_attenuation = p_value; break;
- case Physics2DServer::AREA_PARAM_LINEAR_DAMP: linear_damp = p_value; break;
- case Physics2DServer::AREA_PARAM_ANGULAR_DAMP: angular_damp = p_value; break;
- case Physics2DServer::AREA_PARAM_PRIORITY: priority = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY: gravity = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR: gravity_vector = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_IS_POINT: gravity_is_point = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_DISTANCE_SCALE: gravity_distance_scale = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_POINT_ATTENUATION: point_attenuation = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_LINEAR_DAMP: linear_damp = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_ANGULAR_DAMP: angular_damp = p_value; break;
+ case PhysicsServer2D::AREA_PARAM_PRIORITY: priority = p_value; break;
}
}
-Variant Area2DSW::get_param(Physics2DServer::AreaParameter p_param) const {
+Variant Area2DSW::get_param(PhysicsServer2D::AreaParameter p_param) const {
switch (p_param) {
- case Physics2DServer::AREA_PARAM_GRAVITY: return gravity;
- case Physics2DServer::AREA_PARAM_GRAVITY_VECTOR: return gravity_vector;
- case Physics2DServer::AREA_PARAM_GRAVITY_IS_POINT: return gravity_is_point;
- case Physics2DServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE: return gravity_distance_scale;
- case Physics2DServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION: return point_attenuation;
- case Physics2DServer::AREA_PARAM_LINEAR_DAMP: return linear_damp;
- case Physics2DServer::AREA_PARAM_ANGULAR_DAMP: return angular_damp;
- case Physics2DServer::AREA_PARAM_PRIORITY: return priority;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY: return gravity;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_VECTOR: return gravity_vector;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_IS_POINT: return gravity_is_point;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_DISTANCE_SCALE: return gravity_distance_scale;
+ case PhysicsServer2D::AREA_PARAM_GRAVITY_POINT_ATTENUATION: return point_attenuation;
+ case PhysicsServer2D::AREA_PARAM_LINEAR_DAMP: return linear_damp;
+ case PhysicsServer2D::AREA_PARAM_ANGULAR_DAMP: return angular_damp;
+ case PhysicsServer2D::AREA_PARAM_PRIORITY: return priority;
}
return Variant();
@@ -194,7 +194,7 @@ void Area2DSW::call_queries() {
if (E->get().state == 0)
continue; //nothing happened
- res[0] = E->get().state > 0 ? Physics2DServer::AREA_BODY_ADDED : Physics2DServer::AREA_BODY_REMOVED;
+ res[0] = E->get().state > 0 ? PhysicsServer2D::AREA_BODY_ADDED : PhysicsServer2D::AREA_BODY_REMOVED;
res[1] = E->key().rid;
res[2] = E->key().instance_id;
res[3] = E->key().body_shape;
@@ -226,7 +226,7 @@ void Area2DSW::call_queries() {
if (E->get().state == 0)
continue; //nothing happened
- res[0] = E->get().state > 0 ? Physics2DServer::AREA_BODY_ADDED : Physics2DServer::AREA_BODY_REMOVED;
+ res[0] = E->get().state > 0 ? PhysicsServer2D::AREA_BODY_ADDED : PhysicsServer2D::AREA_BODY_REMOVED;
res[1] = E->key().rid;
res[2] = E->key().instance_id;
res[3] = E->key().body_shape;
@@ -248,7 +248,7 @@ Area2DSW::Area2DSW() :
moved_list(this) {
_set_static(true); //areas are not active by default
- space_override_mode = Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED;
+ space_override_mode = PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED;
gravity = 9.80665;
gravity_vector = Vector2(0, -1);
gravity_is_point = false;
diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h
index 54ffd9763d..ae2a8ff995 100644
--- a/servers/physics_2d/area_2d_sw.h
+++ b/servers/physics_2d/area_2d_sw.h
@@ -33,8 +33,8 @@
#include "collision_object_2d_sw.h"
#include "core/self_list.h"
-#include "servers/physics_2d_server.h"
-//#include "servers/physics/query_sw.h"
+#include "servers/physics_server_2d.h"
+//#include "servers/physics_3d/query_sw.h"
class Space2DSW;
class Body2DSW;
@@ -42,7 +42,7 @@ class Constraint2DSW;
class Area2DSW : public CollisionObject2DSW {
- Physics2DServer::AreaSpaceOverrideMode space_override_mode;
+ PhysicsServer2D::AreaSpaceOverrideMode space_override_mode;
real_t gravity;
Vector2 gravity_vector;
bool gravity_is_point;
@@ -121,11 +121,11 @@ public:
_FORCE_INLINE_ void add_area_to_query(Area2DSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape);
_FORCE_INLINE_ void remove_area_from_query(Area2DSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape);
- void set_param(Physics2DServer::AreaParameter p_param, const Variant &p_value);
- Variant get_param(Physics2DServer::AreaParameter p_param) const;
+ void set_param(PhysicsServer2D::AreaParameter p_param, const Variant &p_value);
+ Variant get_param(PhysicsServer2D::AreaParameter p_param) const;
- void set_space_override_mode(Physics2DServer::AreaSpaceOverrideMode p_mode);
- Physics2DServer::AreaSpaceOverrideMode get_space_override_mode() const { return space_override_mode; }
+ void set_space_override_mode(PhysicsServer2D::AreaSpaceOverrideMode p_mode);
+ PhysicsServer2D::AreaSpaceOverrideMode get_space_override_mode() const { return space_override_mode; }
_FORCE_INLINE_ void set_gravity(real_t p_gravity) { gravity = p_gravity; }
_FORCE_INLINE_ real_t get_gravity() const { return gravity; }
diff --git a/servers/physics_2d/area_pair_2d_sw.cpp b/servers/physics_2d/area_pair_2d_sw.cpp
index 05d71cfabe..669f27bcc8 100644
--- a/servers/physics_2d/area_pair_2d_sw.cpp
+++ b/servers/physics_2d/area_pair_2d_sw.cpp
@@ -45,14 +45,14 @@ bool AreaPair2DSW::setup(real_t p_step) {
if (result) {
- if (area->get_space_override_mode() != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED)
+ if (area->get_space_override_mode() != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED)
body->add_area(area);
if (area->has_monitor_callback())
area->add_body_to_query(body, body_shape, area_shape);
} else {
- if (area->get_space_override_mode() != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED)
+ if (area->get_space_override_mode() != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED)
body->remove_area(area);
if (area->has_monitor_callback())
area->remove_body_from_query(body, body_shape, area_shape);
@@ -76,7 +76,7 @@ AreaPair2DSW::AreaPair2DSW(Body2DSW *p_body, int p_body_shape, Area2DSW *p_area,
colliding = false;
body->add_constraint(this, 0);
area->add_constraint(this);
- if (p_body->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC) //need to be active to process pair
+ if (p_body->get_mode() == PhysicsServer2D::BODY_MODE_KINEMATIC) //need to be active to process pair
p_body->set_active(true);
}
@@ -84,7 +84,7 @@ AreaPair2DSW::~AreaPair2DSW() {
if (colliding) {
- if (area->get_space_override_mode() != Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED)
+ if (area->get_space_override_mode() != PhysicsServer2D::AREA_SPACE_OVERRIDE_DISABLED)
body->remove_area(area);
if (area->has_monitor_callback())
area->remove_body_from_query(body, body_shape, area_shape);
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index 863b422996..79388ffe93 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -30,7 +30,7 @@
#include "body_2d_sw.h"
#include "area_2d_sw.h"
-#include "physics_2d_server_sw.h"
+#include "physics_server_2d_sw.h"
#include "space_2d_sw.h"
void Body2DSW::_update_inertia() {
@@ -45,7 +45,7 @@ void Body2DSW::update_inertias() {
switch (mode) {
- case Physics2DServer::BODY_MODE_RIGID: {
+ case PhysicsServer2D::BODY_MODE_RIGID: {
if (user_inertia) {
_inv_inertia = inertia > 0 ? (1.0 / inertia) : 0;
@@ -86,13 +86,13 @@ void Body2DSW::update_inertias() {
_inv_mass = 0;
} break;
- case Physics2DServer::BODY_MODE_KINEMATIC:
- case Physics2DServer::BODY_MODE_STATIC: {
+ case PhysicsServer2D::BODY_MODE_KINEMATIC:
+ case PhysicsServer2D::BODY_MODE_STATIC: {
_inv_inertia = 0;
_inv_mass = 0;
} break;
- case Physics2DServer::BODY_MODE_CHARACTER: {
+ case PhysicsServer2D::BODY_MODE_CHARACTER: {
_inv_inertia = 0;
_inv_mass = 1.0 / mass;
@@ -114,7 +114,7 @@ void Body2DSW::set_active(bool p_active) {
if (get_space())
get_space()->body_remove_from_active_list(&active_list);
} else {
- if (mode == Physics2DServer::BODY_MODE_STATIC)
+ if (mode == PhysicsServer2D::BODY_MODE_STATIC)
return; //static bodies can't become active
if (get_space())
get_space()->body_add_to_active_list(&active_list);
@@ -134,24 +134,24 @@ void Body2DSW::set_active(bool p_active) {
*/
}
-void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, real_t p_value) {
+void Body2DSW::set_param(PhysicsServer2D::BodyParameter p_param, real_t p_value) {
switch (p_param) {
- case Physics2DServer::BODY_PARAM_BOUNCE: {
+ case PhysicsServer2D::BODY_PARAM_BOUNCE: {
bounce = p_value;
} break;
- case Physics2DServer::BODY_PARAM_FRICTION: {
+ case PhysicsServer2D::BODY_PARAM_FRICTION: {
friction = p_value;
} break;
- case Physics2DServer::BODY_PARAM_MASS: {
+ case PhysicsServer2D::BODY_PARAM_MASS: {
ERR_FAIL_COND(p_value <= 0);
mass = p_value;
_update_inertia();
} break;
- case Physics2DServer::BODY_PARAM_INERTIA: {
+ case PhysicsServer2D::BODY_PARAM_INERTIA: {
if (p_value <= 0) {
user_inertia = false;
_update_inertia();
@@ -161,14 +161,14 @@ void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, real_t p_value)
_inv_inertia = 1.0 / p_value;
}
} break;
- case Physics2DServer::BODY_PARAM_GRAVITY_SCALE: {
+ case PhysicsServer2D::BODY_PARAM_GRAVITY_SCALE: {
gravity_scale = p_value;
} break;
- case Physics2DServer::BODY_PARAM_LINEAR_DAMP: {
+ case PhysicsServer2D::BODY_PARAM_LINEAR_DAMP: {
linear_damp = p_value;
} break;
- case Physics2DServer::BODY_PARAM_ANGULAR_DAMP: {
+ case PhysicsServer2D::BODY_PARAM_ANGULAR_DAMP: {
angular_damp = p_value;
} break;
@@ -177,31 +177,31 @@ void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, real_t p_value)
}
}
-real_t Body2DSW::get_param(Physics2DServer::BodyParameter p_param) const {
+real_t Body2DSW::get_param(PhysicsServer2D::BodyParameter p_param) const {
switch (p_param) {
- case Physics2DServer::BODY_PARAM_BOUNCE: {
+ case PhysicsServer2D::BODY_PARAM_BOUNCE: {
return bounce;
}
- case Physics2DServer::BODY_PARAM_FRICTION: {
+ case PhysicsServer2D::BODY_PARAM_FRICTION: {
return friction;
}
- case Physics2DServer::BODY_PARAM_MASS: {
+ case PhysicsServer2D::BODY_PARAM_MASS: {
return mass;
}
- case Physics2DServer::BODY_PARAM_INERTIA: {
+ case PhysicsServer2D::BODY_PARAM_INERTIA: {
return inertia;
}
- case Physics2DServer::BODY_PARAM_GRAVITY_SCALE: {
+ case PhysicsServer2D::BODY_PARAM_GRAVITY_SCALE: {
return gravity_scale;
}
- case Physics2DServer::BODY_PARAM_LINEAR_DAMP: {
+ case PhysicsServer2D::BODY_PARAM_LINEAR_DAMP: {
return linear_damp;
}
- case Physics2DServer::BODY_PARAM_ANGULAR_DAMP: {
+ case PhysicsServer2D::BODY_PARAM_ANGULAR_DAMP: {
return angular_damp;
}
@@ -212,28 +212,28 @@ real_t Body2DSW::get_param(Physics2DServer::BodyParameter p_param) const {
return 0;
}
-void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) {
+void Body2DSW::set_mode(PhysicsServer2D::BodyMode p_mode) {
- Physics2DServer::BodyMode prev = mode;
+ PhysicsServer2D::BodyMode prev = mode;
mode = p_mode;
switch (p_mode) {
//CLEAR UP EVERYTHING IN CASE IT NOT WORKS!
- case Physics2DServer::BODY_MODE_STATIC:
- case Physics2DServer::BODY_MODE_KINEMATIC: {
+ case PhysicsServer2D::BODY_MODE_STATIC:
+ case PhysicsServer2D::BODY_MODE_KINEMATIC: {
_set_inv_transform(get_transform().affine_inverse());
_inv_mass = 0;
_inv_inertia = 0;
- _set_static(p_mode == Physics2DServer::BODY_MODE_STATIC);
- set_active(p_mode == Physics2DServer::BODY_MODE_KINEMATIC && contacts.size());
+ _set_static(p_mode == PhysicsServer2D::BODY_MODE_STATIC);
+ set_active(p_mode == PhysicsServer2D::BODY_MODE_KINEMATIC && contacts.size());
linear_velocity = Vector2();
angular_velocity = 0;
- if (mode == Physics2DServer::BODY_MODE_KINEMATIC && prev != mode) {
+ if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC && prev != mode) {
first_time_kinematic = true;
}
} break;
- case Physics2DServer::BODY_MODE_RIGID: {
+ case PhysicsServer2D::BODY_MODE_RIGID: {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_inv_inertia = inertia > 0 ? (1.0 / inertia) : 0;
@@ -241,7 +241,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) {
set_active(true);
} break;
- case Physics2DServer::BODY_MODE_CHARACTER: {
+ case PhysicsServer2D::BODY_MODE_CHARACTER: {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_inv_inertia = 0;
@@ -250,7 +250,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) {
angular_velocity = 0;
} break;
}
- if (p_mode == Physics2DServer::BODY_MODE_RIGID && _inv_inertia == 0) {
+ if (p_mode == PhysicsServer2D::BODY_MODE_RIGID && _inv_inertia == 0) {
_update_inertia();
}
/*
@@ -258,7 +258,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) {
_update_queries();
*/
}
-Physics2DServer::BodyMode Body2DSW::get_mode() const {
+PhysicsServer2D::BodyMode Body2DSW::get_mode() const {
return mode;
}
@@ -269,12 +269,12 @@ void Body2DSW::_shapes_changed() {
wakeup_neighbours();
}
-void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant &p_variant) {
+void Body2DSW::set_state(PhysicsServer2D::BodyState p_state, const Variant &p_variant) {
switch (p_state) {
- case Physics2DServer::BODY_STATE_TRANSFORM: {
+ case PhysicsServer2D::BODY_STATE_TRANSFORM: {
- if (mode == Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC) {
new_transform = p_variant;
//wakeup_neighbours();
@@ -284,7 +284,7 @@ void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant &p_va
_set_inv_transform(get_transform().affine_inverse());
first_time_kinematic = false;
}
- } else if (mode == Physics2DServer::BODY_MODE_STATIC) {
+ } else if (mode == PhysicsServer2D::BODY_MODE_STATIC) {
_set_transform(p_variant);
_set_inv_transform(get_transform().affine_inverse());
wakeup_neighbours();
@@ -300,28 +300,28 @@ void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant &p_va
wakeup();
} break;
- case Physics2DServer::BODY_STATE_LINEAR_VELOCITY: {
+ case PhysicsServer2D::BODY_STATE_LINEAR_VELOCITY: {
/*
- if (mode==Physics2DServer::BODY_MODE_STATIC)
+ if (mode==PhysicsServer2D::BODY_MODE_STATIC)
break;
*/
linear_velocity = p_variant;
wakeup();
} break;
- case Physics2DServer::BODY_STATE_ANGULAR_VELOCITY: {
+ case PhysicsServer2D::BODY_STATE_ANGULAR_VELOCITY: {
/*
- if (mode!=Physics2DServer::BODY_MODE_RIGID)
+ if (mode!=PhysicsServer2D::BODY_MODE_RIGID)
break;
*/
angular_velocity = p_variant;
wakeup();
} break;
- case Physics2DServer::BODY_STATE_SLEEPING: {
+ case PhysicsServer2D::BODY_STATE_SLEEPING: {
//?
- if (mode == Physics2DServer::BODY_MODE_STATIC || mode == Physics2DServer::BODY_MODE_KINEMATIC)
+ if (mode == PhysicsServer2D::BODY_MODE_STATIC || mode == PhysicsServer2D::BODY_MODE_KINEMATIC)
break;
bool do_sleep = p_variant;
if (do_sleep) {
@@ -331,34 +331,34 @@ void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant &p_va
//biased_angular_velocity=Vector3();
set_active(false);
} else {
- if (mode != Physics2DServer::BODY_MODE_STATIC)
+ if (mode != PhysicsServer2D::BODY_MODE_STATIC)
set_active(true);
}
} break;
- case Physics2DServer::BODY_STATE_CAN_SLEEP: {
+ case PhysicsServer2D::BODY_STATE_CAN_SLEEP: {
can_sleep = p_variant;
- if (mode == Physics2DServer::BODY_MODE_RIGID && !active && !can_sleep)
+ if (mode == PhysicsServer2D::BODY_MODE_RIGID && !active && !can_sleep)
set_active(true);
} break;
}
}
-Variant Body2DSW::get_state(Physics2DServer::BodyState p_state) const {
+Variant Body2DSW::get_state(PhysicsServer2D::BodyState p_state) const {
switch (p_state) {
- case Physics2DServer::BODY_STATE_TRANSFORM: {
+ case PhysicsServer2D::BODY_STATE_TRANSFORM: {
return get_transform();
}
- case Physics2DServer::BODY_STATE_LINEAR_VELOCITY: {
+ case PhysicsServer2D::BODY_STATE_LINEAR_VELOCITY: {
return linear_velocity;
}
- case Physics2DServer::BODY_STATE_ANGULAR_VELOCITY: {
+ case PhysicsServer2D::BODY_STATE_ANGULAR_VELOCITY: {
return angular_velocity;
}
- case Physics2DServer::BODY_STATE_SLEEPING: {
+ case PhysicsServer2D::BODY_STATE_SLEEPING: {
return !is_active();
}
- case Physics2DServer::BODY_STATE_CAN_SLEEP: {
+ case PhysicsServer2D::BODY_STATE_CAN_SLEEP: {
return can_sleep;
}
}
@@ -418,7 +418,7 @@ void Body2DSW::_compute_area_gravity_and_dampenings(const Area2DSW *p_area) {
void Body2DSW::integrate_forces(real_t p_step) {
- if (mode == Physics2DServer::BODY_MODE_STATIC)
+ if (mode == PhysicsServer2D::BODY_MODE_STATIC)
return;
Area2DSW *def_area = get_space()->get_default_area();
@@ -435,20 +435,20 @@ void Body2DSW::integrate_forces(real_t p_step) {
const AreaCMP *aa = &areas[0];
// damp_area = aa[ac-1].area;
for (int i = ac - 1; i >= 0 && !stopped; i--) {
- Physics2DServer::AreaSpaceOverrideMode mode = aa[i].area->get_space_override_mode();
+ PhysicsServer2D::AreaSpaceOverrideMode mode = aa[i].area->get_space_override_mode();
switch (mode) {
- case Physics2DServer::AREA_SPACE_OVERRIDE_COMBINE:
- case Physics2DServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE: {
+ case PhysicsServer2D::AREA_SPACE_OVERRIDE_COMBINE:
+ case PhysicsServer2D::AREA_SPACE_OVERRIDE_COMBINE_REPLACE: {
_compute_area_gravity_and_dampenings(aa[i].area);
- stopped = mode == Physics2DServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE;
+ stopped = mode == PhysicsServer2D::AREA_SPACE_OVERRIDE_COMBINE_REPLACE;
} break;
- case Physics2DServer::AREA_SPACE_OVERRIDE_REPLACE:
- case Physics2DServer::AREA_SPACE_OVERRIDE_REPLACE_COMBINE: {
+ case PhysicsServer2D::AREA_SPACE_OVERRIDE_REPLACE:
+ case PhysicsServer2D::AREA_SPACE_OVERRIDE_REPLACE_COMBINE: {
gravity = Vector2(0, 0);
area_angular_damp = 0;
area_linear_damp = 0;
_compute_area_gravity_and_dampenings(aa[i].area);
- stopped = mode == Physics2DServer::AREA_SPACE_OVERRIDE_REPLACE;
+ stopped = mode == PhysicsServer2D::AREA_SPACE_OVERRIDE_REPLACE;
} break;
default: {
}
@@ -478,7 +478,7 @@ void Body2DSW::integrate_forces(real_t p_step) {
Vector2 motion;
bool do_motion = false;
- if (mode == Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC) {
//compute motion, angular and etc. velocities from prev transform
motion = new_transform.get_origin() - get_transform().get_origin();
@@ -521,7 +521,7 @@ void Body2DSW::integrate_forces(real_t p_step) {
angular_velocity += _inv_inertia * torque * p_step;
}
- if (continuous_cd_mode != Physics2DServer::CCD_MODE_DISABLED) {
+ if (continuous_cd_mode != PhysicsServer2D::CCD_MODE_DISABLED) {
motion = linear_velocity * p_step;
do_motion = true;
@@ -545,13 +545,13 @@ void Body2DSW::integrate_forces(real_t p_step) {
void Body2DSW::integrate_velocities(real_t p_step) {
- if (mode == Physics2DServer::BODY_MODE_STATIC)
+ if (mode == PhysicsServer2D::BODY_MODE_STATIC)
return;
if (fi_callback)
get_space()->body_add_to_state_query_list(&direct_state_query_list);
- if (mode == Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC) {
_set_transform(new_transform, false);
_set_inv_transform(new_transform.affine_inverse());
@@ -566,10 +566,10 @@ void Body2DSW::integrate_velocities(real_t p_step) {
real_t angle = get_transform().get_rotation() + total_angular_velocity * p_step;
Vector2 pos = get_transform().get_origin() + total_linear_velocity * p_step;
- _set_transform(Transform2D(angle, pos), continuous_cd_mode == Physics2DServer::CCD_MODE_DISABLED);
+ _set_transform(Transform2D(angle, pos), continuous_cd_mode == PhysicsServer2D::CCD_MODE_DISABLED);
_set_inv_transform(get_transform().inverse());
- if (continuous_cd_mode != Physics2DServer::CCD_MODE_DISABLED)
+ if (continuous_cd_mode != PhysicsServer2D::CCD_MODE_DISABLED)
new_transform = get_transform();
//_update_inertia_tensor();
@@ -588,7 +588,7 @@ void Body2DSW::wakeup_neighbours() {
if (i == E->get())
continue;
Body2DSW *b = n[i];
- if (b->mode != Physics2DServer::BODY_MODE_RIGID)
+ if (b->mode != PhysicsServer2D::BODY_MODE_RIGID)
continue;
if (!b->is_active())
@@ -626,9 +626,9 @@ void Body2DSW::call_queries() {
bool Body2DSW::sleep_test(real_t p_step) {
- if (mode == Physics2DServer::BODY_MODE_STATIC || mode == Physics2DServer::BODY_MODE_KINEMATIC)
+ if (mode == PhysicsServer2D::BODY_MODE_STATIC || mode == PhysicsServer2D::BODY_MODE_KINEMATIC)
return true; //
- else if (mode == Physics2DServer::BODY_MODE_CHARACTER)
+ else if (mode == PhysicsServer2D::BODY_MODE_CHARACTER)
return !active; // characters and kinematic bodies don't sleep unless asked to sleep
else if (!can_sleep)
return false;
@@ -668,7 +668,7 @@ Body2DSW::Body2DSW() :
inertia_update_list(this),
direct_state_query_list(this) {
- mode = Physics2DServer::BODY_MODE_RIGID;
+ mode = PhysicsServer2D::BODY_MODE_RIGID;
active = true;
angular_velocity = 0;
biased_angular_velocity = 0;
@@ -695,7 +695,7 @@ Body2DSW::Body2DSW() :
first_integration = false;
still_time = 0;
- continuous_cd_mode = Physics2DServer::CCD_MODE_DISABLED;
+ continuous_cd_mode = PhysicsServer2D::CCD_MODE_DISABLED;
can_sleep = true;
fi_callback = NULL;
}
@@ -708,7 +708,7 @@ Body2DSW::~Body2DSW() {
Physics2DDirectBodyStateSW *Physics2DDirectBodyStateSW::singleton = NULL;
-Physics2DDirectSpaceState *Physics2DDirectBodyStateSW::get_space_state() {
+PhysicsDirectSpaceState2D *Physics2DDirectBodyStateSW::get_space_state() {
return body->get_space()->get_direct_state();
}
@@ -717,11 +717,11 @@ Variant Physics2DDirectBodyStateSW::get_contact_collider_shape_metadata(int p_co
ERR_FAIL_INDEX_V(p_contact_idx, body->contact_count, Variant());
- if (!Physics2DServerSW::singletonsw->body_owner.owns(body->contacts[p_contact_idx].collider)) {
+ if (!PhysicsServer2DSW::singletonsw->body_owner.owns(body->contacts[p_contact_idx].collider)) {
return Variant();
}
- Body2DSW *other = Physics2DServerSW::singletonsw->body_owner.getornull(body->contacts[p_contact_idx].collider);
+ Body2DSW *other = PhysicsServer2DSW::singletonsw->body_owner.getornull(body->contacts[p_contact_idx].collider);
int sidx = body->contacts[p_contact_idx].collider_shape;
if (sidx < 0 || sidx >= other->get_shape_count()) {
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h
index ea07b8260c..4a83cf9500 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -39,7 +39,7 @@ class Constraint2DSW;
class Body2DSW : public CollisionObject2DSW {
- Physics2DServer::BodyMode mode;
+ PhysicsServer2D::BodyMode mode;
Vector2 biased_linear_velocity;
real_t biased_angular_velocity;
@@ -74,7 +74,7 @@ class Body2DSW : public CollisionObject2DSW {
SelfList<Body2DSW> direct_state_query_list;
VSet<RID> exceptions;
- Physics2DServer::CCDMode continuous_cd_mode;
+ PhysicsServer2D::CCDMode continuous_cd_mode;
bool omit_force_integration;
bool active;
bool can_sleep;
@@ -158,7 +158,7 @@ public:
_FORCE_INLINE_ void set_max_contacts_reported(int p_size) {
contacts.resize(p_size);
contact_count = 0;
- if (mode == Physics2DServer::BODY_MODE_KINEMATIC && p_size) set_active(true);
+ if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC && p_size) set_active(true);
}
_FORCE_INLINE_ int get_max_contacts_reported() const { return contacts.size(); }
@@ -224,19 +224,19 @@ public:
_FORCE_INLINE_ bool is_active() const { return active; }
_FORCE_INLINE_ void wakeup() {
- if ((!get_space()) || mode == Physics2DServer::BODY_MODE_STATIC || mode == Physics2DServer::BODY_MODE_KINEMATIC)
+ if ((!get_space()) || mode == PhysicsServer2D::BODY_MODE_STATIC || mode == PhysicsServer2D::BODY_MODE_KINEMATIC)
return;
set_active(true);
}
- void set_param(Physics2DServer::BodyParameter p_param, real_t);
- real_t get_param(Physics2DServer::BodyParameter p_param) const;
+ void set_param(PhysicsServer2D::BodyParameter p_param, real_t);
+ real_t get_param(PhysicsServer2D::BodyParameter p_param) const;
- void set_mode(Physics2DServer::BodyMode p_mode);
- Physics2DServer::BodyMode get_mode() const;
+ void set_mode(PhysicsServer2D::BodyMode p_mode);
+ PhysicsServer2D::BodyMode get_mode() const;
- void set_state(Physics2DServer::BodyState p_state, const Variant &p_variant);
- Variant get_state(Physics2DServer::BodyState p_state) const;
+ void set_state(PhysicsServer2D::BodyState p_state, const Variant &p_variant);
+ Variant get_state(PhysicsServer2D::BodyState p_state) const;
void set_applied_force(const Vector2 &p_force) { applied_force = p_force; }
Vector2 get_applied_force() const { return applied_force; }
@@ -258,8 +258,8 @@ public:
applied_torque += p_torque;
}
- _FORCE_INLINE_ void set_continuous_collision_detection_mode(Physics2DServer::CCDMode p_mode) { continuous_cd_mode = p_mode; }
- _FORCE_INLINE_ Physics2DServer::CCDMode get_continuous_collision_detection_mode() const { return continuous_cd_mode; }
+ _FORCE_INLINE_ void set_continuous_collision_detection_mode(PhysicsServer2D::CCDMode p_mode) { continuous_cd_mode = p_mode; }
+ _FORCE_INLINE_ PhysicsServer2D::CCDMode get_continuous_collision_detection_mode() const { return continuous_cd_mode; }
void set_space(Space2DSW *p_space);
@@ -278,9 +278,9 @@ public:
_FORCE_INLINE_ Vector2 get_motion() const {
- if (mode > Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (mode > PhysicsServer2D::BODY_MODE_KINEMATIC) {
return new_transform.get_origin() - get_transform().get_origin();
- } else if (mode == Physics2DServer::BODY_MODE_KINEMATIC) {
+ } else if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC) {
return get_transform().get_origin() - new_transform.get_origin(); //kinematic simulates forward
}
return Vector2();
@@ -341,9 +341,9 @@ void Body2DSW::add_contact(const Vector2 &p_local_pos, const Vector2 &p_local_no
c[idx].collider_velocity_at_pos = p_collider_velocity_at_pos;
}
-class Physics2DDirectBodyStateSW : public Physics2DDirectBodyState {
+class Physics2DDirectBodyStateSW : public PhysicsDirectBodyState2D {
- GDCLASS(Physics2DDirectBodyStateSW, Physics2DDirectBodyState);
+ GDCLASS(Physics2DDirectBodyStateSW, PhysicsDirectBodyState2D);
public:
static Physics2DDirectBodyStateSW *singleton;
@@ -363,7 +363,7 @@ public:
virtual void set_angular_velocity(real_t p_velocity) { body->set_angular_velocity(p_velocity); }
virtual real_t get_angular_velocity() const { return body->get_angular_velocity(); }
- virtual void set_transform(const Transform2D &p_transform) { body->set_state(Physics2DServer::BODY_STATE_TRANSFORM, p_transform); }
+ virtual void set_transform(const Transform2D &p_transform) { body->set_state(PhysicsServer2D::BODY_STATE_TRANSFORM, p_transform); }
virtual Transform2D get_transform() const { return body->get_transform(); }
virtual void add_central_force(const Vector2 &p_force) { body->add_central_force(p_force); }
@@ -414,7 +414,7 @@ public:
return body->contacts[p_contact_idx].collider_velocity_at_pos;
}
- virtual Physics2DDirectSpaceState *get_space_state();
+ virtual PhysicsDirectSpaceState2D *get_space_state();
virtual real_t get_step() const { return step; }
Physics2DDirectBodyStateSW() {
diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp
index 38f33134a5..f38a76cff6 100644
--- a/servers/physics_2d/body_pair_2d_sw.cpp
+++ b/servers/physics_2d/body_pair_2d_sw.cpp
@@ -230,7 +230,7 @@ real_t combine_friction(Body2DSW *A, Body2DSW *B) {
bool BodyPair2DSW::setup(real_t p_step) {
//cannot collide
- if (!A->test_collision_mask(B) || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC && B->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC && A->get_max_contacts_reported() == 0 && B->get_max_contacts_reported() == 0)) {
+ if (!A->test_collision_mask(B) || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode() <= PhysicsServer2D::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer2D::BODY_MODE_KINEMATIC && A->get_max_contacts_reported() == 0 && B->get_max_contacts_reported() == 0)) {
collided = false;
return false;
}
@@ -258,10 +258,10 @@ bool BodyPair2DSW::setup(real_t p_step) {
Vector2 motion_A, motion_B;
- if (A->get_continuous_collision_detection_mode() == Physics2DServer::CCD_MODE_CAST_SHAPE) {
+ if (A->get_continuous_collision_detection_mode() == PhysicsServer2D::CCD_MODE_CAST_SHAPE) {
motion_A = A->get_motion();
}
- if (B->get_continuous_collision_detection_mode() == Physics2DServer::CCD_MODE_CAST_SHAPE) {
+ if (B->get_continuous_collision_detection_mode() == PhysicsServer2D::CCD_MODE_CAST_SHAPE) {
motion_B = B->get_motion();
}
//faster to set than to check..
@@ -273,12 +273,12 @@ bool BodyPair2DSW::setup(real_t p_step) {
//test ccd (currently just a raycast)
- if (A->get_continuous_collision_detection_mode() == Physics2DServer::CCD_MODE_CAST_RAY && A->get_mode() > Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (A->get_continuous_collision_detection_mode() == PhysicsServer2D::CCD_MODE_CAST_RAY && A->get_mode() > PhysicsServer2D::BODY_MODE_KINEMATIC) {
if (_test_ccd(p_step, A, shape_A, xform_A, B, shape_B, xform_B))
collided = true;
}
- if (B->get_continuous_collision_detection_mode() == Physics2DServer::CCD_MODE_CAST_RAY && B->get_mode() > Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (B->get_continuous_collision_detection_mode() == PhysicsServer2D::CCD_MODE_CAST_RAY && B->get_mode() > PhysicsServer2D::BODY_MODE_KINEMATIC) {
if (_test_ccd(p_step, B, shape_B, xform_B, A, shape_A, xform_A, true))
collided = true;
}
@@ -405,7 +405,7 @@ bool BodyPair2DSW::setup(real_t p_step) {
}
}
- if ((A->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC && B->get_mode() <= Physics2DServer::BODY_MODE_KINEMATIC)) {
+ if ((A->get_mode() <= PhysicsServer2D::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer2D::BODY_MODE_KINEMATIC)) {
c.active = false;
collided = false;
continue;
diff --git a/servers/physics_2d/collision_object_2d_sw.cpp b/servers/physics_2d/collision_object_2d_sw.cpp
index 8fb3296be6..a6891372c2 100644
--- a/servers/physics_2d/collision_object_2d_sw.cpp
+++ b/servers/physics_2d/collision_object_2d_sw.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "collision_object_2d_sw.h"
-#include "servers/physics_2d/physics_2d_server_sw.h"
+#include "servers/physics_2d/physics_server_2d_sw.h"
#include "space_2d_sw.h"
void CollisionObject2DSW::add_shape(Shape2DSW *p_shape, const Transform2D &p_transform, bool p_disabled) {
@@ -46,7 +46,7 @@ void CollisionObject2DSW::add_shape(Shape2DSW *p_shape, const Transform2D &p_tra
p_shape->add_owner(this);
if (!pending_shape_update_list.in_list()) {
- Physics2DServerSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer2DSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
}
// _update_shapes();
// _shapes_changed();
@@ -61,7 +61,7 @@ void CollisionObject2DSW::set_shape(int p_index, Shape2DSW *p_shape) {
p_shape->add_owner(this);
if (!pending_shape_update_list.in_list()) {
- Physics2DServerSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer2DSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
}
// _update_shapes();
// _shapes_changed();
@@ -81,7 +81,7 @@ void CollisionObject2DSW::set_shape_transform(int p_index, const Transform2D &p_
shapes.write[p_index].xform_inv = p_transform.affine_inverse();
if (!pending_shape_update_list.in_list()) {
- Physics2DServerSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer2DSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
}
// _update_shapes();
// _shapes_changed();
@@ -103,12 +103,12 @@ void CollisionObject2DSW::set_shape_as_disabled(int p_idx, bool p_disabled) {
space->get_broadphase()->remove(shape.bpid);
shape.bpid = 0;
if (!pending_shape_update_list.in_list()) {
- Physics2DServerSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer2DSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
}
//_update_shapes();
} else if (!p_disabled && shape.bpid == 0) {
if (!pending_shape_update_list.in_list()) {
- Physics2DServerSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer2DSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
}
//_update_shapes(); // automatically adds shape with bpid == 0
}
@@ -142,7 +142,7 @@ void CollisionObject2DSW::remove_shape(int p_index) {
shapes.remove(p_index);
if (!pending_shape_update_list.in_list()) {
- Physics2DServerSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer2DSW::singletonsw->pending_shape_update_list.add(&pending_shape_update_list);
}
// _update_shapes();
// _shapes_changed();
diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h
index 3f9d19bbab..98105a7c0e 100644
--- a/servers/physics_2d/collision_object_2d_sw.h
+++ b/servers/physics_2d/collision_object_2d_sw.h
@@ -33,7 +33,7 @@
#include "broad_phase_2d_sw.h"
#include "core/self_list.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
#include "shape_2d_sw.h"
class Space2DSW;
diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp
index da67fcc770..217c93c6da 100644
--- a/servers/physics_2d/collision_solver_2d_sat.cpp
+++ b/servers/physics_2d/collision_solver_2d_sat.cpp
@@ -1042,16 +1042,16 @@ static void _collision_convex_polygon_convex_polygon(const Shape2DSW *p_a, const
bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D &p_transform_A, const Vector2 &p_motion_A, const Shape2DSW *p_shape_B, const Transform2D &p_transform_B, const Vector2 &p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap, Vector2 *sep_axis, real_t p_margin_A, real_t p_margin_B) {
- Physics2DServer::ShapeType type_A = p_shape_A->get_type();
+ PhysicsServer2D::ShapeType type_A = p_shape_A->get_type();
- ERR_FAIL_COND_V(type_A == Physics2DServer::SHAPE_LINE, false);
- //ERR_FAIL_COND_V(type_A==Physics2DServer::SHAPE_RAY,false);
+ ERR_FAIL_COND_V(type_A == PhysicsServer2D::SHAPE_LINE, false);
+ //ERR_FAIL_COND_V(type_A==PhysicsServer2D::SHAPE_RAY,false);
ERR_FAIL_COND_V(p_shape_A->is_concave(), false);
- Physics2DServer::ShapeType type_B = p_shape_B->get_type();
+ PhysicsServer2D::ShapeType type_B = p_shape_B->get_type();
- ERR_FAIL_COND_V(type_B == Physics2DServer::SHAPE_LINE, false);
- //ERR_FAIL_COND_V(type_B==Physics2DServer::SHAPE_RAY,false);
+ ERR_FAIL_COND_V(type_B == PhysicsServer2D::SHAPE_LINE, false);
+ //ERR_FAIL_COND_V(type_B==PhysicsServer2D::SHAPE_RAY,false);
ERR_FAIL_COND_V(p_shape_B->is_concave(), false);
static const CollisionFunc collision_table[5][5] = {
diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp
index 60cca6f825..f117dcbfe5 100644
--- a/servers/physics_2d/collision_solver_2d_sw.cpp
+++ b/servers/physics_2d/collision_solver_2d_sw.cpp
@@ -37,7 +37,7 @@
bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A, const Transform2D &p_transform_A, const Shape2DSW *p_shape_B, const Transform2D &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result) {
const LineShape2DSW *line = static_cast<const LineShape2DSW *>(p_shape_A);
- if (p_shape_B->get_type() == Physics2DServer::SHAPE_LINE)
+ if (p_shape_B->get_type() == PhysicsServer2D::SHAPE_LINE)
return false;
Vector2 n = p_transform_A.basis_xform(line->get_normal()).normalized();
@@ -75,7 +75,7 @@ bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A, const Tr
bool CollisionSolver2DSW::solve_raycast(const Shape2DSW *p_shape_A, const Vector2 &p_motion_A, const Transform2D &p_transform_A, const Shape2DSW *p_shape_B, const Transform2D &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result, Vector2 *sep_axis) {
const RayShape2DSW *ray = static_cast<const RayShape2DSW *>(p_shape_A);
- if (p_shape_B->get_type() == Physics2DServer::SHAPE_RAY)
+ if (p_shape_B->get_type() == PhysicsServer2D::SHAPE_RAY)
return false;
Vector2 from = p_transform_A.get_origin();
@@ -195,8 +195,8 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A, const Transf
bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A, const Transform2D &p_transform_A, const Vector2 &p_motion_A, const Shape2DSW *p_shape_B, const Transform2D &p_transform_B, const Vector2 &p_motion_B, CallbackResult p_result_callback, void *p_userdata, Vector2 *sep_axis, real_t p_margin_A, real_t p_margin_B) {
- Physics2DServer::ShapeType type_A = p_shape_A->get_type();
- Physics2DServer::ShapeType type_B = p_shape_B->get_type();
+ PhysicsServer2D::ShapeType type_A = p_shape_A->get_type();
+ PhysicsServer2D::ShapeType type_B = p_shape_B->get_type();
bool concave_A = p_shape_A->is_concave();
bool concave_B = p_shape_B->is_concave();
real_t margin_A = p_margin_A, margin_B = p_margin_B;
@@ -210,9 +210,9 @@ bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A, const Transform2D &p
swap = true;
}
- if (type_A == Physics2DServer::SHAPE_LINE) {
+ if (type_A == PhysicsServer2D::SHAPE_LINE) {
- if (type_B == Physics2DServer::SHAPE_LINE || type_B == Physics2DServer::SHAPE_RAY) {
+ if (type_B == PhysicsServer2D::SHAPE_LINE || type_B == PhysicsServer2D::SHAPE_RAY) {
return false;
}
@@ -222,9 +222,9 @@ bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A, const Transform2D &p
return solve_static_line(p_shape_A, p_transform_A, p_shape_B, p_transform_B, p_result_callback, p_userdata, false);
}
- } else if (type_A == Physics2DServer::SHAPE_RAY) {
+ } else if (type_A == PhysicsServer2D::SHAPE_RAY) {
- if (type_B == Physics2DServer::SHAPE_RAY) {
+ if (type_B == PhysicsServer2D::SHAPE_RAY) {
return false; //no ray-ray
}
diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp
index 02b3502242..4524629d50 100644
--- a/servers/physics_2d/joints_2d_sw.cpp
+++ b/servers/physics_2d/joints_2d_sw.cpp
@@ -171,15 +171,15 @@ void PinJoint2DSW::solve(real_t p_step) {
P += impulse;
}
-void PinJoint2DSW::set_param(Physics2DServer::PinJointParam p_param, real_t p_value) {
+void PinJoint2DSW::set_param(PhysicsServer2D::PinJointParam p_param, real_t p_value) {
- if (p_param == Physics2DServer::PIN_JOINT_SOFTNESS)
+ if (p_param == PhysicsServer2D::PIN_JOINT_SOFTNESS)
softness = p_value;
}
-real_t PinJoint2DSW::get_param(Physics2DServer::PinJointParam p_param) const {
+real_t PinJoint2DSW::get_param(PhysicsServer2D::PinJointParam p_param) const {
- if (p_param == Physics2DServer::PIN_JOINT_SOFTNESS)
+ if (p_param == PhysicsServer2D::PIN_JOINT_SOFTNESS)
return softness;
ERR_FAIL_V(0);
}
@@ -396,38 +396,38 @@ void DampedSpringJoint2DSW::solve(real_t p_step) {
B->apply_impulse(rB, j);
}
-void DampedSpringJoint2DSW::set_param(Physics2DServer::DampedStringParam p_param, real_t p_value) {
+void DampedSpringJoint2DSW::set_param(PhysicsServer2D::DampedStringParam p_param, real_t p_value) {
switch (p_param) {
- case Physics2DServer::DAMPED_STRING_REST_LENGTH: {
+ case PhysicsServer2D::DAMPED_STRING_REST_LENGTH: {
rest_length = p_value;
} break;
- case Physics2DServer::DAMPED_STRING_DAMPING: {
+ case PhysicsServer2D::DAMPED_STRING_DAMPING: {
damping = p_value;
} break;
- case Physics2DServer::DAMPED_STRING_STIFFNESS: {
+ case PhysicsServer2D::DAMPED_STRING_STIFFNESS: {
stiffness = p_value;
} break;
}
}
-real_t DampedSpringJoint2DSW::get_param(Physics2DServer::DampedStringParam p_param) const {
+real_t DampedSpringJoint2DSW::get_param(PhysicsServer2D::DampedStringParam p_param) const {
switch (p_param) {
- case Physics2DServer::DAMPED_STRING_REST_LENGTH: {
+ case PhysicsServer2D::DAMPED_STRING_REST_LENGTH: {
return rest_length;
} break;
- case Physics2DServer::DAMPED_STRING_DAMPING: {
+ case PhysicsServer2D::DAMPED_STRING_DAMPING: {
return damping;
} break;
- case Physics2DServer::DAMPED_STRING_STIFFNESS: {
+ case PhysicsServer2D::DAMPED_STRING_STIFFNESS: {
return stiffness;
} break;
diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h
index 3e8fc1a29f..f4aeb6e3c8 100644
--- a/servers/physics_2d/joints_2d_sw.h
+++ b/servers/physics_2d/joints_2d_sw.h
@@ -50,7 +50,7 @@ public:
_FORCE_INLINE_ void set_max_bias(real_t p_bias) { max_bias = p_bias; }
_FORCE_INLINE_ real_t get_max_bias() const { return max_bias; }
- virtual Physics2DServer::JointType get_type() const = 0;
+ virtual PhysicsServer2D::JointType get_type() const = 0;
Joint2DSW(Body2DSW **p_body_ptr = NULL, int p_body_count = 0) :
Constraint2DSW(p_body_ptr, p_body_count) {
bias = 0;
@@ -78,13 +78,13 @@ class PinJoint2DSW : public Joint2DSW {
real_t softness;
public:
- virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_PIN; }
+ virtual PhysicsServer2D::JointType get_type() const { return PhysicsServer2D::JOINT_PIN; }
virtual bool setup(real_t p_step);
virtual void solve(real_t p_step);
- void set_param(Physics2DServer::PinJointParam p_param, real_t p_value);
- real_t get_param(Physics2DServer::PinJointParam p_param) const;
+ void set_param(PhysicsServer2D::PinJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer2D::PinJointParam p_param) const;
PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p_body_b = NULL);
~PinJoint2DSW();
@@ -116,7 +116,7 @@ class GrooveJoint2DSW : public Joint2DSW {
bool correct;
public:
- virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_GROOVE; }
+ virtual PhysicsServer2D::JointType get_type() const { return PhysicsServer2D::JOINT_GROOVE; }
virtual bool setup(real_t p_step);
virtual void solve(real_t p_step);
@@ -150,13 +150,13 @@ class DampedSpringJoint2DSW : public Joint2DSW {
real_t v_coef;
public:
- virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_DAMPED_SPRING; }
+ virtual PhysicsServer2D::JointType get_type() const { return PhysicsServer2D::JOINT_DAMPED_SPRING; }
virtual bool setup(real_t p_step);
virtual void solve(real_t p_step);
- void set_param(Physics2DServer::DampedStringParam p_param, real_t p_value);
- real_t get_param(Physics2DServer::DampedStringParam p_param) const;
+ void set_param(PhysicsServer2D::DampedStringParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer2D::DampedStringParam p_param) const;
DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, Body2DSW *p_body_a, Body2DSW *p_body_b);
~DampedSpringJoint2DSW();
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_server_2d_sw.cpp
index baeb3f76b0..cd1f14b69d 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_server_2d_sw.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "physics_2d_server_sw.h"
+#include "physics_server_2d_sw.h"
#include "broad_phase_2d_basic.h"
#include "broad_phase_2d_hash_grid.h"
#include "collision_solver_2d_sw.h"
@@ -39,7 +39,7 @@
#define FLUSH_QUERY_CHECK(m_object) \
ERR_FAIL_COND_MSG(m_object->get_space() && flushing_queries, "Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead.");
-RID Physics2DServerSW::_shape_create(ShapeType p_shape) {
+RID PhysicsServer2DSW::_shape_create(ShapeType p_shape) {
Shape2DSW *shape = NULL;
switch (p_shape) {
@@ -89,63 +89,63 @@ RID Physics2DServerSW::_shape_create(ShapeType p_shape) {
return id;
}
-RID Physics2DServerSW::line_shape_create() {
+RID PhysicsServer2DSW::line_shape_create() {
return _shape_create(SHAPE_LINE);
}
-RID Physics2DServerSW::ray_shape_create() {
+RID PhysicsServer2DSW::ray_shape_create() {
return _shape_create(SHAPE_RAY);
}
-RID Physics2DServerSW::segment_shape_create() {
+RID PhysicsServer2DSW::segment_shape_create() {
return _shape_create(SHAPE_SEGMENT);
}
-RID Physics2DServerSW::circle_shape_create() {
+RID PhysicsServer2DSW::circle_shape_create() {
return _shape_create(SHAPE_CIRCLE);
}
-RID Physics2DServerSW::rectangle_shape_create() {
+RID PhysicsServer2DSW::rectangle_shape_create() {
return _shape_create(SHAPE_RECTANGLE);
}
-RID Physics2DServerSW::capsule_shape_create() {
+RID PhysicsServer2DSW::capsule_shape_create() {
return _shape_create(SHAPE_CAPSULE);
}
-RID Physics2DServerSW::convex_polygon_shape_create() {
+RID PhysicsServer2DSW::convex_polygon_shape_create() {
return _shape_create(SHAPE_CONVEX_POLYGON);
}
-RID Physics2DServerSW::concave_polygon_shape_create() {
+RID PhysicsServer2DSW::concave_polygon_shape_create() {
return _shape_create(SHAPE_CONCAVE_POLYGON);
}
-void Physics2DServerSW::shape_set_data(RID p_shape, const Variant &p_data) {
+void PhysicsServer2DSW::shape_set_data(RID p_shape, const Variant &p_data) {
Shape2DSW *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND(!shape);
shape->set_data(p_data);
};
-void Physics2DServerSW::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) {
+void PhysicsServer2DSW::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) {
Shape2DSW *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND(!shape);
shape->set_custom_bias(p_bias);
}
-Physics2DServer::ShapeType Physics2DServerSW::shape_get_type(RID p_shape) const {
+PhysicsServer2D::ShapeType PhysicsServer2DSW::shape_get_type(RID p_shape) const {
const Shape2DSW *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, SHAPE_CUSTOM);
return shape->get_type();
};
-Variant Physics2DServerSW::shape_get_data(RID p_shape) const {
+Variant PhysicsServer2DSW::shape_get_data(RID p_shape) const {
const Shape2DSW *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, Variant());
@@ -153,14 +153,14 @@ Variant Physics2DServerSW::shape_get_data(RID p_shape) const {
return shape->get_data();
};
-real_t Physics2DServerSW::shape_get_custom_solver_bias(RID p_shape) const {
+real_t PhysicsServer2DSW::shape_get_custom_solver_bias(RID p_shape) const {
const Shape2DSW *shape = shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
return shape->get_custom_bias();
}
-void Physics2DServerSW::_shape_col_cbk(const Vector2 &p_point_A, const Vector2 &p_point_B, void *p_userdata) {
+void PhysicsServer2DSW::_shape_col_cbk(const Vector2 &p_point_A, const Vector2 &p_point_B, void *p_userdata) {
CollCbkData *cbk = (CollCbkData *)p_userdata;
@@ -217,7 +217,7 @@ void Physics2DServerSW::_shape_col_cbk(const Vector2 &p_point_A, const Vector2 &
}
}
-bool Physics2DServerSW::shape_collide(RID p_shape_A, const Transform2D &p_xform_A, const Vector2 &p_motion_A, RID p_shape_B, const Transform2D &p_xform_B, const Vector2 &p_motion_B, Vector2 *r_results, int p_result_max, int &r_result_count) {
+bool PhysicsServer2DSW::shape_collide(RID p_shape_A, const Transform2D &p_xform_A, const Vector2 &p_motion_A, RID p_shape_B, const Transform2D &p_xform_B, const Vector2 &p_motion_B, Vector2 *r_results, int p_result_max, int &r_result_count) {
Shape2DSW *shape_A = shape_owner.getornull(p_shape_A);
ERR_FAIL_COND_V(!shape_A, false);
@@ -240,7 +240,7 @@ bool Physics2DServerSW::shape_collide(RID p_shape_A, const Transform2D &p_xform_
return res;
}
-RID Physics2DServerSW::space_create() {
+RID PhysicsServer2DSW::space_create() {
Space2DSW *space = memnew(Space2DSW);
RID id = space_owner.make_rid(space);
@@ -255,7 +255,7 @@ RID Physics2DServerSW::space_create() {
return id;
};
-void Physics2DServerSW::space_set_active(RID p_space, bool p_active) {
+void PhysicsServer2DSW::space_set_active(RID p_space, bool p_active) {
Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND(!space);
@@ -265,7 +265,7 @@ void Physics2DServerSW::space_set_active(RID p_space, bool p_active) {
active_spaces.erase(space);
}
-bool Physics2DServerSW::space_is_active(RID p_space) const {
+bool PhysicsServer2DSW::space_is_active(RID p_space) const {
const Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, false);
@@ -273,7 +273,7 @@ bool Physics2DServerSW::space_is_active(RID p_space) const {
return active_spaces.has(space);
}
-void Physics2DServerSW::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) {
+void PhysicsServer2DSW::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) {
Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND(!space);
@@ -281,35 +281,35 @@ void Physics2DServerSW::space_set_param(RID p_space, SpaceParameter p_param, rea
space->set_param(p_param, p_value);
}
-real_t Physics2DServerSW::space_get_param(RID p_space, SpaceParameter p_param) const {
+real_t PhysicsServer2DSW::space_get_param(RID p_space, SpaceParameter p_param) const {
const Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, 0);
return space->get_param(p_param);
}
-void Physics2DServerSW::space_set_debug_contacts(RID p_space, int p_max_contacts) {
+void PhysicsServer2DSW::space_set_debug_contacts(RID p_space, int p_max_contacts) {
Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND(!space);
space->set_debug_contacts(p_max_contacts);
}
-Vector<Vector2> Physics2DServerSW::space_get_contacts(RID p_space) const {
+Vector<Vector2> PhysicsServer2DSW::space_get_contacts(RID p_space) const {
Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, Vector<Vector2>());
return space->get_debug_contacts();
}
-int Physics2DServerSW::space_get_contact_count(RID p_space) const {
+int PhysicsServer2DSW::space_get_contact_count(RID p_space) const {
Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, 0);
return space->get_debug_contact_count();
}
-Physics2DDirectSpaceState *Physics2DServerSW::space_get_direct_state(RID p_space) {
+PhysicsDirectSpaceState2D *PhysicsServer2DSW::space_get_direct_state(RID p_space) {
Space2DSW *space = space_owner.getornull(p_space);
ERR_FAIL_COND_V(!space, NULL);
@@ -318,7 +318,7 @@ Physics2DDirectSpaceState *Physics2DServerSW::space_get_direct_state(RID p_space
return space->get_direct_state();
}
-RID Physics2DServerSW::area_create() {
+RID PhysicsServer2DSW::area_create() {
Area2DSW *area = memnew(Area2DSW);
RID rid = area_owner.make_rid(area);
@@ -326,7 +326,7 @@ RID Physics2DServerSW::area_create() {
return rid;
};
-void Physics2DServerSW::area_set_space(RID p_area, RID p_space) {
+void PhysicsServer2DSW::area_set_space(RID p_area, RID p_space) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -344,7 +344,7 @@ void Physics2DServerSW::area_set_space(RID p_area, RID p_space) {
area->set_space(space);
};
-RID Physics2DServerSW::area_get_space(RID p_area) const {
+RID PhysicsServer2DSW::area_get_space(RID p_area) const {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, RID());
@@ -355,7 +355,7 @@ RID Physics2DServerSW::area_get_space(RID p_area) const {
return space->get_self();
};
-void Physics2DServerSW::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) {
+void PhysicsServer2DSW::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -363,7 +363,7 @@ void Physics2DServerSW::area_set_space_override_mode(RID p_area, AreaSpaceOverri
area->set_space_override_mode(p_mode);
}
-Physics2DServer::AreaSpaceOverrideMode Physics2DServerSW::area_get_space_override_mode(RID p_area) const {
+PhysicsServer2D::AreaSpaceOverrideMode PhysicsServer2DSW::area_get_space_override_mode(RID p_area) const {
const Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, AREA_SPACE_OVERRIDE_DISABLED);
@@ -371,7 +371,7 @@ Physics2DServer::AreaSpaceOverrideMode Physics2DServerSW::area_get_space_overrid
return area->get_space_override_mode();
}
-void Physics2DServerSW::area_add_shape(RID p_area, RID p_shape, const Transform2D &p_transform, bool p_disabled) {
+void PhysicsServer2DSW::area_add_shape(RID p_area, RID p_shape, const Transform2D &p_transform, bool p_disabled) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -382,7 +382,7 @@ void Physics2DServerSW::area_add_shape(RID p_area, RID p_shape, const Transform2
area->add_shape(shape, p_transform, p_disabled);
}
-void Physics2DServerSW::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {
+void PhysicsServer2DSW::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -393,7 +393,7 @@ void Physics2DServerSW::area_set_shape(RID p_area, int p_shape_idx, RID p_shape)
area->set_shape(p_shape_idx, shape);
}
-void Physics2DServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D &p_transform) {
+void PhysicsServer2DSW::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D &p_transform) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -401,7 +401,7 @@ void Physics2DServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, co
area->set_shape_transform(p_shape_idx, p_transform);
}
-void Physics2DServerSW::area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) {
+void PhysicsServer2DSW::area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -411,14 +411,14 @@ void Physics2DServerSW::area_set_shape_disabled(RID p_area, int p_shape, bool p_
area->set_shape_as_disabled(p_shape, p_disabled);
}
-int Physics2DServerSW::area_get_shape_count(RID p_area) const {
+int PhysicsServer2DSW::area_get_shape_count(RID p_area) const {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, -1);
return area->get_shape_count();
}
-RID Physics2DServerSW::area_get_shape(RID p_area, int p_shape_idx) const {
+RID PhysicsServer2DSW::area_get_shape(RID p_area, int p_shape_idx) const {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, RID());
@@ -428,7 +428,7 @@ RID Physics2DServerSW::area_get_shape(RID p_area, int p_shape_idx) const {
return shape->get_self();
}
-Transform2D Physics2DServerSW::area_get_shape_transform(RID p_area, int p_shape_idx) const {
+Transform2D PhysicsServer2DSW::area_get_shape_transform(RID p_area, int p_shape_idx) const {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, Transform2D());
@@ -436,7 +436,7 @@ Transform2D Physics2DServerSW::area_get_shape_transform(RID p_area, int p_shape_
return area->get_shape_transform(p_shape_idx);
}
-void Physics2DServerSW::area_remove_shape(RID p_area, int p_shape_idx) {
+void PhysicsServer2DSW::area_remove_shape(RID p_area, int p_shape_idx) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -444,7 +444,7 @@ void Physics2DServerSW::area_remove_shape(RID p_area, int p_shape_idx) {
area->remove_shape(p_shape_idx);
}
-void Physics2DServerSW::area_clear_shapes(RID p_area) {
+void PhysicsServer2DSW::area_clear_shapes(RID p_area) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -453,7 +453,7 @@ void Physics2DServerSW::area_clear_shapes(RID p_area) {
area->remove_shape(0);
}
-void Physics2DServerSW::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
+void PhysicsServer2DSW::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.getornull(p_area);
@@ -463,7 +463,7 @@ void Physics2DServerSW::area_attach_object_instance_id(RID p_area, ObjectID p_id
ERR_FAIL_COND(!area);
area->set_instance_id(p_id);
}
-ObjectID Physics2DServerSW::area_get_object_instance_id(RID p_area) const {
+ObjectID PhysicsServer2DSW::area_get_object_instance_id(RID p_area) const {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.getornull(p_area);
@@ -474,7 +474,7 @@ ObjectID Physics2DServerSW::area_get_object_instance_id(RID p_area) const {
return area->get_instance_id();
}
-void Physics2DServerSW::area_attach_canvas_instance_id(RID p_area, ObjectID p_id) {
+void PhysicsServer2DSW::area_attach_canvas_instance_id(RID p_area, ObjectID p_id) {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.getornull(p_area);
@@ -484,7 +484,7 @@ void Physics2DServerSW::area_attach_canvas_instance_id(RID p_area, ObjectID p_id
ERR_FAIL_COND(!area);
area->set_canvas_instance_id(p_id);
}
-ObjectID Physics2DServerSW::area_get_canvas_instance_id(RID p_area) const {
+ObjectID PhysicsServer2DSW::area_get_canvas_instance_id(RID p_area) const {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.getornull(p_area);
@@ -495,7 +495,7 @@ ObjectID Physics2DServerSW::area_get_canvas_instance_id(RID p_area) const {
return area->get_canvas_instance_id();
}
-void Physics2DServerSW::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) {
+void PhysicsServer2DSW::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.getornull(p_area);
@@ -506,14 +506,14 @@ void Physics2DServerSW::area_set_param(RID p_area, AreaParameter p_param, const
area->set_param(p_param, p_value);
};
-void Physics2DServerSW::area_set_transform(RID p_area, const Transform2D &p_transform) {
+void PhysicsServer2DSW::area_set_transform(RID p_area, const Transform2D &p_transform) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_transform(p_transform);
};
-Variant Physics2DServerSW::area_get_param(RID p_area, AreaParameter p_param) const {
+Variant PhysicsServer2DSW::area_get_param(RID p_area, AreaParameter p_param) const {
if (space_owner.owns(p_area)) {
Space2DSW *space = space_owner.getornull(p_area);
@@ -525,7 +525,7 @@ Variant Physics2DServerSW::area_get_param(RID p_area, AreaParameter p_param) con
return area->get_param(p_param);
};
-Transform2D Physics2DServerSW::area_get_transform(RID p_area) const {
+Transform2D PhysicsServer2DSW::area_get_transform(RID p_area) const {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND_V(!area, Transform2D());
@@ -533,14 +533,14 @@ Transform2D Physics2DServerSW::area_get_transform(RID p_area) const {
return area->get_transform();
};
-void Physics2DServerSW::area_set_pickable(RID p_area, bool p_pickable) {
+void PhysicsServer2DSW::area_set_pickable(RID p_area, bool p_pickable) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
area->set_pickable(p_pickable);
}
-void Physics2DServerSW::area_set_monitorable(RID p_area, bool p_monitorable) {
+void PhysicsServer2DSW::area_set_monitorable(RID p_area, bool p_monitorable) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -549,7 +549,7 @@ void Physics2DServerSW::area_set_monitorable(RID p_area, bool p_monitorable) {
area->set_monitorable(p_monitorable);
}
-void Physics2DServerSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
+void PhysicsServer2DSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -557,7 +557,7 @@ void Physics2DServerSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
area->set_collision_mask(p_mask);
}
-void Physics2DServerSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
+void PhysicsServer2DSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -565,7 +565,7 @@ void Physics2DServerSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
area->set_collision_layer(p_layer);
}
-void Physics2DServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
+void PhysicsServer2DSW::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -573,7 +573,7 @@ void Physics2DServerSW::area_set_monitor_callback(RID p_area, Object *p_receiver
area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
}
-void Physics2DServerSW::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
+void PhysicsServer2DSW::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
Area2DSW *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
@@ -583,7 +583,7 @@ void Physics2DServerSW::area_set_area_monitor_callback(RID p_area, Object *p_rec
/* BODY API */
-RID Physics2DServerSW::body_create() {
+RID PhysicsServer2DSW::body_create() {
Body2DSW *body = memnew(Body2DSW);
RID rid = body_owner.make_rid(body);
@@ -591,7 +591,7 @@ RID Physics2DServerSW::body_create() {
return rid;
}
-void Physics2DServerSW::body_set_space(RID p_body, RID p_space) {
+void PhysicsServer2DSW::body_set_space(RID p_body, RID p_space) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -608,7 +608,7 @@ void Physics2DServerSW::body_set_space(RID p_body, RID p_space) {
body->set_space(space);
};
-RID Physics2DServerSW::body_get_space(RID p_body) const {
+RID PhysicsServer2DSW::body_get_space(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, RID());
@@ -619,7 +619,7 @@ RID Physics2DServerSW::body_get_space(RID p_body) const {
return space->get_self();
};
-void Physics2DServerSW::body_set_mode(RID p_body, BodyMode p_mode) {
+void PhysicsServer2DSW::body_set_mode(RID p_body, BodyMode p_mode) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -628,7 +628,7 @@ void Physics2DServerSW::body_set_mode(RID p_body, BodyMode p_mode) {
body->set_mode(p_mode);
};
-Physics2DServer::BodyMode Physics2DServerSW::body_get_mode(RID p_body) const {
+PhysicsServer2D::BodyMode PhysicsServer2DSW::body_get_mode(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, BODY_MODE_STATIC);
@@ -636,7 +636,7 @@ Physics2DServer::BodyMode Physics2DServerSW::body_get_mode(RID p_body) const {
return body->get_mode();
};
-void Physics2DServerSW::body_add_shape(RID p_body, RID p_shape, const Transform2D &p_transform, bool p_disabled) {
+void PhysicsServer2DSW::body_add_shape(RID p_body, RID p_shape, const Transform2D &p_transform, bool p_disabled) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -647,7 +647,7 @@ void Physics2DServerSW::body_add_shape(RID p_body, RID p_shape, const Transform2
body->add_shape(shape, p_transform, p_disabled);
}
-void Physics2DServerSW::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {
+void PhysicsServer2DSW::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -658,7 +658,7 @@ void Physics2DServerSW::body_set_shape(RID p_body, int p_shape_idx, RID p_shape)
body->set_shape(p_shape_idx, shape);
}
-void Physics2DServerSW::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D &p_transform) {
+void PhysicsServer2DSW::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D &p_transform) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -666,28 +666,28 @@ void Physics2DServerSW::body_set_shape_transform(RID p_body, int p_shape_idx, co
body->set_shape_transform(p_shape_idx, p_transform);
}
-void Physics2DServerSW::body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant &p_metadata) {
+void PhysicsServer2DSW::body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant &p_metadata) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_shape_metadata(p_shape_idx, p_metadata);
}
-Variant Physics2DServerSW::body_get_shape_metadata(RID p_body, int p_shape_idx) const {
+Variant PhysicsServer2DSW::body_get_shape_metadata(RID p_body, int p_shape_idx) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Variant());
return body->get_shape_metadata(p_shape_idx);
}
-int Physics2DServerSW::body_get_shape_count(RID p_body) const {
+int PhysicsServer2DSW::body_get_shape_count(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, -1);
return body->get_shape_count();
}
-RID Physics2DServerSW::body_get_shape(RID p_body, int p_shape_idx) const {
+RID PhysicsServer2DSW::body_get_shape(RID p_body, int p_shape_idx) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, RID());
@@ -697,7 +697,7 @@ RID Physics2DServerSW::body_get_shape(RID p_body, int p_shape_idx) const {
return shape->get_self();
}
-Transform2D Physics2DServerSW::body_get_shape_transform(RID p_body, int p_shape_idx) const {
+Transform2D PhysicsServer2DSW::body_get_shape_transform(RID p_body, int p_shape_idx) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Transform2D());
@@ -705,7 +705,7 @@ Transform2D Physics2DServerSW::body_get_shape_transform(RID p_body, int p_shape_
return body->get_shape_transform(p_shape_idx);
}
-void Physics2DServerSW::body_remove_shape(RID p_body, int p_shape_idx) {
+void PhysicsServer2DSW::body_remove_shape(RID p_body, int p_shape_idx) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -713,7 +713,7 @@ void Physics2DServerSW::body_remove_shape(RID p_body, int p_shape_idx) {
body->remove_shape(p_shape_idx);
}
-void Physics2DServerSW::body_clear_shapes(RID p_body) {
+void PhysicsServer2DSW::body_clear_shapes(RID p_body) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -722,7 +722,7 @@ void Physics2DServerSW::body_clear_shapes(RID p_body) {
body->remove_shape(0);
}
-void Physics2DServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
+void PhysicsServer2DSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -731,7 +731,7 @@ void Physics2DServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, boo
body->set_shape_as_disabled(p_shape_idx, p_disabled);
}
-void Physics2DServerSW::body_set_shape_as_one_way_collision(RID p_body, int p_shape_idx, bool p_enable, float p_margin) {
+void PhysicsServer2DSW::body_set_shape_as_one_way_collision(RID p_body, int p_shape_idx, bool p_enable, float p_margin) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -741,14 +741,14 @@ void Physics2DServerSW::body_set_shape_as_one_way_collision(RID p_body, int p_sh
body->set_shape_as_one_way_collision(p_shape_idx, p_enable, p_margin);
}
-void Physics2DServerSW::body_set_continuous_collision_detection_mode(RID p_body, CCDMode p_mode) {
+void PhysicsServer2DSW::body_set_continuous_collision_detection_mode(RID p_body, CCDMode p_mode) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_continuous_collision_detection_mode(p_mode);
}
-Physics2DServerSW::CCDMode Physics2DServerSW::body_get_continuous_collision_detection_mode(RID p_body) const {
+PhysicsServer2DSW::CCDMode PhysicsServer2DSW::body_get_continuous_collision_detection_mode(RID p_body) const {
const Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, CCD_MODE_DISABLED);
@@ -756,7 +756,7 @@ Physics2DServerSW::CCDMode Physics2DServerSW::body_get_continuous_collision_dete
return body->get_continuous_collision_detection_mode();
}
-void Physics2DServerSW::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
+void PhysicsServer2DSW::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -764,7 +764,7 @@ void Physics2DServerSW::body_attach_object_instance_id(RID p_body, ObjectID p_id
body->set_instance_id(p_id);
};
-ObjectID Physics2DServerSW::body_get_object_instance_id(RID p_body) const {
+ObjectID PhysicsServer2DSW::body_get_object_instance_id(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, ObjectID());
@@ -772,7 +772,7 @@ ObjectID Physics2DServerSW::body_get_object_instance_id(RID p_body) const {
return body->get_instance_id();
};
-void Physics2DServerSW::body_attach_canvas_instance_id(RID p_body, ObjectID p_id) {
+void PhysicsServer2DSW::body_attach_canvas_instance_id(RID p_body, ObjectID p_id) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -780,7 +780,7 @@ void Physics2DServerSW::body_attach_canvas_instance_id(RID p_body, ObjectID p_id
body->set_canvas_instance_id(p_id);
};
-ObjectID Physics2DServerSW::body_get_canvas_instance_id(RID p_body) const {
+ObjectID PhysicsServer2DSW::body_get_canvas_instance_id(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, ObjectID());
@@ -788,14 +788,14 @@ ObjectID Physics2DServerSW::body_get_canvas_instance_id(RID p_body) const {
return body->get_canvas_instance_id();
};
-void Physics2DServerSW::body_set_collision_layer(RID p_body, uint32_t p_layer) {
+void PhysicsServer2DSW::body_set_collision_layer(RID p_body, uint32_t p_layer) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_collision_layer(p_layer);
};
-uint32_t Physics2DServerSW::body_get_collision_layer(RID p_body) const {
+uint32_t PhysicsServer2DSW::body_get_collision_layer(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -803,14 +803,14 @@ uint32_t Physics2DServerSW::body_get_collision_layer(RID p_body) const {
return body->get_collision_layer();
};
-void Physics2DServerSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
+void PhysicsServer2DSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_collision_mask(p_mask);
};
-uint32_t Physics2DServerSW::body_get_collision_mask(RID p_body) const {
+uint32_t PhysicsServer2DSW::body_get_collision_mask(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -818,7 +818,7 @@ uint32_t Physics2DServerSW::body_get_collision_mask(RID p_body) const {
return body->get_collision_mask();
};
-void Physics2DServerSW::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) {
+void PhysicsServer2DSW::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -826,7 +826,7 @@ void Physics2DServerSW::body_set_param(RID p_body, BodyParameter p_param, real_t
body->set_param(p_param, p_value);
};
-real_t Physics2DServerSW::body_get_param(RID p_body, BodyParameter p_param) const {
+real_t PhysicsServer2DSW::body_get_param(RID p_body, BodyParameter p_param) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -834,7 +834,7 @@ real_t Physics2DServerSW::body_get_param(RID p_body, BodyParameter p_param) cons
return body->get_param(p_param);
};
-void Physics2DServerSW::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
+void PhysicsServer2DSW::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -842,7 +842,7 @@ void Physics2DServerSW::body_set_state(RID p_body, BodyState p_state, const Vari
body->set_state(p_state, p_variant);
};
-Variant Physics2DServerSW::body_get_state(RID p_body, BodyState p_state) const {
+Variant PhysicsServer2DSW::body_get_state(RID p_body, BodyState p_state) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Variant());
@@ -850,7 +850,7 @@ Variant Physics2DServerSW::body_get_state(RID p_body, BodyState p_state) const {
return body->get_state(p_state);
};
-void Physics2DServerSW::body_set_applied_force(RID p_body, const Vector2 &p_force) {
+void PhysicsServer2DSW::body_set_applied_force(RID p_body, const Vector2 &p_force) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -859,14 +859,14 @@ void Physics2DServerSW::body_set_applied_force(RID p_body, const Vector2 &p_forc
body->wakeup();
};
-Vector2 Physics2DServerSW::body_get_applied_force(RID p_body) const {
+Vector2 PhysicsServer2DSW::body_get_applied_force(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, Vector2());
return body->get_applied_force();
};
-void Physics2DServerSW::body_set_applied_torque(RID p_body, real_t p_torque) {
+void PhysicsServer2DSW::body_set_applied_torque(RID p_body, real_t p_torque) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -875,7 +875,7 @@ void Physics2DServerSW::body_set_applied_torque(RID p_body, real_t p_torque) {
body->wakeup();
};
-real_t Physics2DServerSW::body_get_applied_torque(RID p_body) const {
+real_t PhysicsServer2DSW::body_get_applied_torque(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
@@ -883,7 +883,7 @@ real_t Physics2DServerSW::body_get_applied_torque(RID p_body) const {
return body->get_applied_torque();
};
-void Physics2DServerSW::body_apply_central_impulse(RID p_body, const Vector2 &p_impulse) {
+void PhysicsServer2DSW::body_apply_central_impulse(RID p_body, const Vector2 &p_impulse) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -891,7 +891,7 @@ void Physics2DServerSW::body_apply_central_impulse(RID p_body, const Vector2 &p_
body->wakeup();
}
-void Physics2DServerSW::body_apply_torque_impulse(RID p_body, real_t p_torque) {
+void PhysicsServer2DSW::body_apply_torque_impulse(RID p_body, real_t p_torque) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -900,7 +900,7 @@ void Physics2DServerSW::body_apply_torque_impulse(RID p_body, real_t p_torque) {
body->apply_torque_impulse(p_torque);
}
-void Physics2DServerSW::body_apply_impulse(RID p_body, const Vector2 &p_pos, const Vector2 &p_impulse) {
+void PhysicsServer2DSW::body_apply_impulse(RID p_body, const Vector2 &p_pos, const Vector2 &p_impulse) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -911,7 +911,7 @@ void Physics2DServerSW::body_apply_impulse(RID p_body, const Vector2 &p_pos, con
body->wakeup();
};
-void Physics2DServerSW::body_add_central_force(RID p_body, const Vector2 &p_force) {
+void PhysicsServer2DSW::body_add_central_force(RID p_body, const Vector2 &p_force) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -919,7 +919,7 @@ void Physics2DServerSW::body_add_central_force(RID p_body, const Vector2 &p_forc
body->wakeup();
};
-void Physics2DServerSW::body_add_force(RID p_body, const Vector2 &p_offset, const Vector2 &p_force) {
+void PhysicsServer2DSW::body_add_force(RID p_body, const Vector2 &p_offset, const Vector2 &p_force) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -928,7 +928,7 @@ void Physics2DServerSW::body_add_force(RID p_body, const Vector2 &p_offset, cons
body->wakeup();
};
-void Physics2DServerSW::body_add_torque(RID p_body, real_t p_torque) {
+void PhysicsServer2DSW::body_add_torque(RID p_body, real_t p_torque) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -936,7 +936,7 @@ void Physics2DServerSW::body_add_torque(RID p_body, real_t p_torque) {
body->wakeup();
};
-void Physics2DServerSW::body_set_axis_velocity(RID p_body, const Vector2 &p_axis_velocity) {
+void PhysicsServer2DSW::body_set_axis_velocity(RID p_body, const Vector2 &p_axis_velocity) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -951,7 +951,7 @@ void Physics2DServerSW::body_set_axis_velocity(RID p_body, const Vector2 &p_axis
body->wakeup();
};
-void Physics2DServerSW::body_add_collision_exception(RID p_body, RID p_body_b) {
+void PhysicsServer2DSW::body_add_collision_exception(RID p_body, RID p_body_b) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -960,7 +960,7 @@ void Physics2DServerSW::body_add_collision_exception(RID p_body, RID p_body_b) {
body->wakeup();
};
-void Physics2DServerSW::body_remove_collision_exception(RID p_body, RID p_body_b) {
+void PhysicsServer2DSW::body_remove_collision_exception(RID p_body, RID p_body_b) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -969,7 +969,7 @@ void Physics2DServerSW::body_remove_collision_exception(RID p_body, RID p_body_b
body->wakeup();
};
-void Physics2DServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
+void PhysicsServer2DSW::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -979,20 +979,20 @@ void Physics2DServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_e
}
};
-void Physics2DServerSW::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) {
+void PhysicsServer2DSW::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
};
-real_t Physics2DServerSW::body_get_contacts_reported_depth_threshold(RID p_body) const {
+real_t PhysicsServer2DSW::body_get_contacts_reported_depth_threshold(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, 0);
return 0;
};
-void Physics2DServerSW::body_set_omit_force_integration(RID p_body, bool p_omit) {
+void PhysicsServer2DSW::body_set_omit_force_integration(RID p_body, bool p_omit) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
@@ -1000,35 +1000,35 @@ void Physics2DServerSW::body_set_omit_force_integration(RID p_body, bool p_omit)
body->set_omit_force_integration(p_omit);
};
-bool Physics2DServerSW::body_is_omitting_force_integration(RID p_body) const {
+bool PhysicsServer2DSW::body_is_omitting_force_integration(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
return body->get_omit_force_integration();
};
-void Physics2DServerSW::body_set_max_contacts_reported(RID p_body, int p_contacts) {
+void PhysicsServer2DSW::body_set_max_contacts_reported(RID p_body, int p_contacts) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_max_contacts_reported(p_contacts);
}
-int Physics2DServerSW::body_get_max_contacts_reported(RID p_body) const {
+int PhysicsServer2DSW::body_get_max_contacts_reported(RID p_body) const {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, -1);
return body->get_max_contacts_reported();
}
-void Physics2DServerSW::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
+void PhysicsServer2DSW::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method, p_udata);
}
-bool Physics2DServerSW::body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count) {
+bool PhysicsServer2DSW::body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
@@ -1037,14 +1037,14 @@ bool Physics2DServerSW::body_collide_shape(RID p_body, int p_body_shape, RID p_s
return shape_collide(body->get_shape(p_body_shape)->get_self(), body->get_transform() * body->get_shape_transform(p_body_shape), Vector2(), p_shape, p_shape_xform, p_motion, r_results, p_result_max, r_result_count);
}
-void Physics2DServerSW::body_set_pickable(RID p_body, bool p_pickable) {
+void PhysicsServer2DSW::body_set_pickable(RID p_body, bool p_pickable) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND(!body);
body->set_pickable(p_pickable);
}
-bool Physics2DServerSW::body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin, MotionResult *r_result, bool p_exclude_raycast_shapes) {
+bool PhysicsServer2DSW::body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin, MotionResult *r_result, bool p_exclude_raycast_shapes) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
@@ -1056,7 +1056,7 @@ bool Physics2DServerSW::body_test_motion(RID p_body, const Transform2D &p_from,
return body->get_space()->test_body_motion(body, p_from, p_motion, p_infinite_inertia, p_margin, r_result, p_exclude_raycast_shapes);
}
-int Physics2DServerSW::body_test_ray_separation(RID p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) {
+int PhysicsServer2DSW::body_test_ray_separation(RID p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) {
Body2DSW *body = body_owner.getornull(p_body);
ERR_FAIL_COND_V(!body, false);
@@ -1066,7 +1066,7 @@ int Physics2DServerSW::body_test_ray_separation(RID p_body, const Transform2D &p
return body->get_space()->test_body_ray_separation(body, p_transform, p_infinite_inertia, r_recover_motion, r_results, p_result_max, p_margin);
}
-Physics2DDirectBodyState *Physics2DServerSW::body_get_direct_state(RID p_body) {
+PhysicsDirectBodyState2D *PhysicsServer2DSW::body_get_direct_state(RID p_body) {
ERR_FAIL_COND_V_MSG((using_threads && !doing_sync), NULL, "Body state is inaccessible right now, wait for iteration or physics process notification.");
@@ -1084,7 +1084,7 @@ Physics2DDirectBodyState *Physics2DServerSW::body_get_direct_state(RID p_body) {
/* JOINT API */
-void Physics2DServerSW::joint_set_param(RID p_joint, JointParam p_param, real_t p_value) {
+void PhysicsServer2DSW::joint_set_param(RID p_joint, JointParam p_param, real_t p_value) {
Joint2DSW *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
@@ -1096,7 +1096,7 @@ void Physics2DServerSW::joint_set_param(RID p_joint, JointParam p_param, real_t
}
}
-real_t Physics2DServerSW::joint_get_param(RID p_joint, JointParam p_param) const {
+real_t PhysicsServer2DSW::joint_get_param(RID p_joint, JointParam p_param) const {
const Joint2DSW *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, -1);
@@ -1110,7 +1110,7 @@ real_t Physics2DServerSW::joint_get_param(RID p_joint, JointParam p_param) const
return 0;
}
-void Physics2DServerSW::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) {
+void PhysicsServer2DSW::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) {
Joint2DSW *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!joint);
@@ -1130,14 +1130,14 @@ void Physics2DServerSW::joint_disable_collisions_between_bodies(RID p_joint, con
}
}
-bool Physics2DServerSW::joint_is_disabled_collisions_between_bodies(RID p_joint) const {
+bool PhysicsServer2DSW::joint_is_disabled_collisions_between_bodies(RID p_joint) const {
const Joint2DSW *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, true);
return joint->is_disabled_collisions_between_bodies();
}
-RID Physics2DServerSW::pin_joint_create(const Vector2 &p_pos, RID p_body_a, RID p_body_b) {
+RID PhysicsServer2DSW::pin_joint_create(const Vector2 &p_pos, RID p_body_a, RID p_body_b) {
Body2DSW *A = body_owner.getornull(p_body_a);
ERR_FAIL_COND_V(!A, RID());
@@ -1154,7 +1154,7 @@ RID Physics2DServerSW::pin_joint_create(const Vector2 &p_pos, RID p_body_a, RID
return self;
}
-RID Physics2DServerSW::groove_joint_create(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, RID p_body_a, RID p_body_b) {
+RID PhysicsServer2DSW::groove_joint_create(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, RID p_body_a, RID p_body_b) {
Body2DSW *A = body_owner.getornull(p_body_a);
ERR_FAIL_COND_V(!A, RID());
@@ -1168,7 +1168,7 @@ RID Physics2DServerSW::groove_joint_create(const Vector2 &p_a_groove1, const Vec
return self;
}
-RID Physics2DServerSW::damped_spring_joint_create(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, RID p_body_a, RID p_body_b) {
+RID PhysicsServer2DSW::damped_spring_joint_create(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, RID p_body_a, RID p_body_b) {
Body2DSW *A = body_owner.getornull(p_body_a);
ERR_FAIL_COND_V(!A, RID());
@@ -1182,7 +1182,7 @@ RID Physics2DServerSW::damped_spring_joint_create(const Vector2 &p_anchor_a, con
return self;
}
-void Physics2DServerSW::pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) {
+void PhysicsServer2DSW::pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) {
Joint2DSW *j = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!j);
@@ -1192,7 +1192,7 @@ void Physics2DServerSW::pin_joint_set_param(RID p_joint, PinJointParam p_param,
pin_joint->set_param(p_param, p_value);
}
-real_t Physics2DServerSW::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
+real_t PhysicsServer2DSW::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
Joint2DSW *j = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!j, 0);
ERR_FAIL_COND_V(j->get_type() != JOINT_PIN, 0);
@@ -1201,7 +1201,7 @@ real_t Physics2DServerSW::pin_joint_get_param(RID p_joint, PinJointParam p_param
return pin_joint->get_param(p_param);
}
-void Physics2DServerSW::damped_string_joint_set_param(RID p_joint, DampedStringParam p_param, real_t p_value) {
+void PhysicsServer2DSW::damped_string_joint_set_param(RID p_joint, DampedStringParam p_param, real_t p_value) {
Joint2DSW *j = joint_owner.getornull(p_joint);
ERR_FAIL_COND(!j);
@@ -1211,7 +1211,7 @@ void Physics2DServerSW::damped_string_joint_set_param(RID p_joint, DampedStringP
dsj->set_param(p_param, p_value);
}
-real_t Physics2DServerSW::damped_string_joint_get_param(RID p_joint, DampedStringParam p_param) const {
+real_t PhysicsServer2DSW::damped_string_joint_get_param(RID p_joint, DampedStringParam p_param) const {
Joint2DSW *j = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!j, 0);
@@ -1221,7 +1221,7 @@ real_t Physics2DServerSW::damped_string_joint_get_param(RID p_joint, DampedStrin
return dsj->get_param(p_param);
}
-Physics2DServer::JointType Physics2DServerSW::joint_get_type(RID p_joint) const {
+PhysicsServer2D::JointType PhysicsServer2DSW::joint_get_type(RID p_joint) const {
Joint2DSW *joint = joint_owner.getornull(p_joint);
ERR_FAIL_COND_V(!joint, JOINT_PIN);
@@ -1229,7 +1229,7 @@ Physics2DServer::JointType Physics2DServerSW::joint_get_type(RID p_joint) const
return joint->get_type();
}
-void Physics2DServerSW::free(RID p_rid) {
+void PhysicsServer2DSW::free(RID p_rid) {
_update_shapes(); // just in case
@@ -1310,12 +1310,12 @@ void Physics2DServerSW::free(RID p_rid) {
}
};
-void Physics2DServerSW::set_active(bool p_active) {
+void PhysicsServer2DSW::set_active(bool p_active) {
active = p_active;
};
-void Physics2DServerSW::init() {
+void PhysicsServer2DSW::init() {
doing_sync = false;
last_step = 0.001;
@@ -1324,7 +1324,7 @@ void Physics2DServerSW::init() {
direct_state = memnew(Physics2DDirectBodyStateSW);
};
-void Physics2DServerSW::step(real_t p_step) {
+void PhysicsServer2DSW::step(real_t p_step) {
if (!active)
return;
@@ -1347,12 +1347,12 @@ void Physics2DServerSW::step(real_t p_step) {
}
};
-void Physics2DServerSW::sync() {
+void PhysicsServer2DSW::sync() {
doing_sync = true;
};
-void Physics2DServerSW::flush_queries() {
+void PhysicsServer2DSW::flush_queries() {
if (!active)
return;
@@ -1405,17 +1405,17 @@ void Physics2DServerSW::flush_queries() {
}
}
-void Physics2DServerSW::end_sync() {
+void PhysicsServer2DSW::end_sync() {
doing_sync = false;
}
-void Physics2DServerSW::finish() {
+void PhysicsServer2DSW::finish() {
memdelete(stepper);
memdelete(direct_state);
};
-void Physics2DServerSW::_update_shapes() {
+void PhysicsServer2DSW::_update_shapes() {
while (pending_shape_update_list.first()) {
pending_shape_update_list.first()->self()->_shape_changed();
@@ -1423,7 +1423,7 @@ void Physics2DServerSW::_update_shapes() {
}
}
-int Physics2DServerSW::get_process_info(ProcessInfo p_info) {
+int PhysicsServer2DSW::get_process_info(ProcessInfo p_info) {
switch (p_info) {
@@ -1443,9 +1443,9 @@ int Physics2DServerSW::get_process_info(ProcessInfo p_info) {
return 0;
}
-Physics2DServerSW *Physics2DServerSW::singletonsw = NULL;
+PhysicsServer2DSW *PhysicsServer2DSW::singletonsw = NULL;
-Physics2DServerSW::Physics2DServerSW() {
+PhysicsServer2DSW::PhysicsServer2DSW() {
singletonsw = this;
BroadPhase2DSW::create_func = BroadPhase2DHashGrid::_create;
@@ -1459,6 +1459,6 @@ Physics2DServerSW::Physics2DServerSW() {
flushing_queries = false;
};
-Physics2DServerSW::~Physics2DServerSW(){
+PhysicsServer2DSW::~PhysicsServer2DSW(){
};
diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_server_2d_sw.h
index a95a2ea0dd..196b9a50b9 100644
--- a/servers/physics_2d/physics_2d_server_sw.h
+++ b/servers/physics_2d/physics_server_2d_sw.h
@@ -33,14 +33,14 @@
#include "core/rid_owner.h"
#include "joints_2d_sw.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
#include "shape_2d_sw.h"
#include "space_2d_sw.h"
#include "step_2d_sw.h"
-class Physics2DServerSW : public Physics2DServer {
+class PhysicsServer2DSW : public PhysicsServer2D {
- GDCLASS(Physics2DServerSW, Physics2DServer);
+ GDCLASS(PhysicsServer2DSW, PhysicsServer2D);
friend class Physics2DDirectSpaceStateSW;
friend class Physics2DDirectBodyStateSW;
@@ -68,7 +68,7 @@ class Physics2DServerSW : public Physics2DServer {
mutable RID_PtrOwner<Body2DSW> body_owner;
mutable RID_PtrOwner<Joint2DSW> joint_owner;
- static Physics2DServerSW *singletonsw;
+ static PhysicsServer2DSW *singletonsw;
//void _clear_query(Query2DSW *p_query);
friend class CollisionObject2DSW;
@@ -123,7 +123,7 @@ public:
virtual int space_get_contact_count(RID p_space) const;
// this function only works on physics process, errors and returns null otherwise
- virtual Physics2DDirectSpaceState *space_get_direct_state(RID p_space);
+ virtual PhysicsDirectSpaceState2D *space_get_direct_state(RID p_space);
/* AREA API */
@@ -253,7 +253,7 @@ public:
virtual int body_test_ray_separation(RID p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin = 0.001);
// this function only works on physics process, errors and returns null otherwise
- virtual Physics2DDirectBodyState *body_get_direct_state(RID p_body);
+ virtual PhysicsDirectBodyState2D *body_get_direct_state(RID p_body);
/* JOINT API */
@@ -289,8 +289,8 @@ public:
int get_process_info(ProcessInfo p_info);
- Physics2DServerSW();
- ~Physics2DServerSW();
+ PhysicsServer2DSW();
+ ~PhysicsServer2DSW();
};
#endif
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_server_2d_wrap_mt.cpp
index 76036930c6..c0f49aa4d1 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp
+++ b/servers/physics_2d/physics_server_2d_wrap_mt.cpp
@@ -28,29 +28,29 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "physics_2d_server_wrap_mt.h"
+#include "physics_server_2d_wrap_mt.h"
#include "core/os/os.h"
-void Physics2DServerWrapMT::thread_exit() {
+void PhysicsServer2DWrapMT::thread_exit() {
exit = true;
}
-void Physics2DServerWrapMT::thread_step(real_t p_delta) {
+void PhysicsServer2DWrapMT::thread_step(real_t p_delta) {
physics_2d_server->step(p_delta);
step_sem.post();
}
-void Physics2DServerWrapMT::_thread_callback(void *_instance) {
+void PhysicsServer2DWrapMT::_thread_callback(void *_instance) {
- Physics2DServerWrapMT *vsmt = reinterpret_cast<Physics2DServerWrapMT *>(_instance);
+ PhysicsServer2DWrapMT *vsmt = reinterpret_cast<PhysicsServer2DWrapMT *>(_instance);
vsmt->thread_loop();
}
-void Physics2DServerWrapMT::thread_loop() {
+void PhysicsServer2DWrapMT::thread_loop() {
server_thread = Thread::get_caller_id();
@@ -70,11 +70,11 @@ void Physics2DServerWrapMT::thread_loop() {
/* EVENT QUEUING */
-void Physics2DServerWrapMT::step(real_t p_step) {
+void PhysicsServer2DWrapMT::step(real_t p_step) {
if (create_thread) {
- command_queue.push(this, &Physics2DServerWrapMT::thread_step, p_step);
+ command_queue.push(this, &PhysicsServer2DWrapMT::thread_step, p_step);
} else {
command_queue.flush_all(); //flush all pending from other threads
@@ -82,7 +82,7 @@ void Physics2DServerWrapMT::step(real_t p_step) {
}
}
-void Physics2DServerWrapMT::sync() {
+void PhysicsServer2DWrapMT::sync() {
if (thread) {
if (first_frame)
@@ -93,17 +93,17 @@ void Physics2DServerWrapMT::sync() {
physics_2d_server->sync();
}
-void Physics2DServerWrapMT::flush_queries() {
+void PhysicsServer2DWrapMT::flush_queries() {
physics_2d_server->flush_queries();
}
-void Physics2DServerWrapMT::end_sync() {
+void PhysicsServer2DWrapMT::end_sync() {
physics_2d_server->end_sync();
}
-void Physics2DServerWrapMT::init() {
+void PhysicsServer2DWrapMT::init() {
if (create_thread) {
@@ -118,11 +118,11 @@ void Physics2DServerWrapMT::init() {
}
}
-void Physics2DServerWrapMT::finish() {
+void PhysicsServer2DWrapMT::finish() {
if (thread) {
- command_queue.push(this, &Physics2DServerWrapMT::thread_exit);
+ command_queue.push(this, &PhysicsServer2DWrapMT::thread_exit);
Thread::wait_to_finish(thread);
memdelete(thread);
@@ -145,7 +145,7 @@ void Physics2DServerWrapMT::finish() {
body_free_cached_ids();
}
-Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool p_create_thread) :
+PhysicsServer2DWrapMT::PhysicsServer2DWrapMT(PhysicsServer2D *p_contained, bool p_create_thread) :
command_queue(p_create_thread) {
physics_2d_server = p_contained;
@@ -166,7 +166,7 @@ Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool
first_frame = true;
}
-Physics2DServerWrapMT::~Physics2DServerWrapMT() {
+PhysicsServer2DWrapMT::~PhysicsServer2DWrapMT() {
memdelete(physics_2d_server);
//finish();
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_server_2d_wrap_mt.h
index 4d5e317c8c..8196ede069 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.h
+++ b/servers/physics_2d/physics_server_2d_wrap_mt.h
@@ -34,7 +34,7 @@
#include "core/command_queue_mt.h"
#include "core/os/thread.h"
#include "core/project_settings.h"
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
#ifdef DEBUG_SYNC
#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));
@@ -42,9 +42,9 @@
#define SYNC_DEBUG
#endif
-class Physics2DServerWrapMT : public Physics2DServer {
+class PhysicsServer2DWrapMT : public PhysicsServer2D {
- mutable Physics2DServer *physics_2d_server;
+ mutable PhysicsServer2D *physics_2d_server;
mutable CommandQueueMT command_queue;
@@ -71,8 +71,8 @@ class Physics2DServerWrapMT : public Physics2DServer {
int pool_max_size;
public:
-#define ServerName Physics2DServer
-#define ServerNameWrapMT Physics2DServerWrapMT
+#define ServerName PhysicsServer2D
+#define ServerNameWrapMT PhysicsServer2DWrapMT
#define server_name physics_2d_server
#include "servers/server_wrap_mt_common.h"
@@ -110,7 +110,7 @@ public:
FUNC2RC(real_t, space_get_param, RID, SpaceParameter);
// this function only works on physics process, errors and returns null otherwise
- Physics2DDirectSpaceState *space_get_direct_state(RID p_space) {
+ PhysicsDirectSpaceState2D *space_get_direct_state(RID p_space) {
ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), NULL);
return physics_2d_server->space_get_direct_state(p_space);
@@ -268,7 +268,7 @@ public:
}
// this function only works on physics process, errors and returns null otherwise
- Physics2DDirectBodyState *body_get_direct_state(RID p_body) {
+ PhysicsDirectBodyState2D *body_get_direct_state(RID p_body) {
ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), NULL);
return physics_2d_server->body_get_direct_state(p_body);
@@ -320,19 +320,19 @@ public:
return physics_2d_server->get_process_info(p_info);
}
- Physics2DServerWrapMT(Physics2DServer *p_contained, bool p_create_thread);
- ~Physics2DServerWrapMT();
+ PhysicsServer2DWrapMT(PhysicsServer2D *p_contained, bool p_create_thread);
+ ~PhysicsServer2DWrapMT();
template <class T>
- static Physics2DServer *init_server() {
+ static PhysicsServer2D *init_server() {
int tm = GLOBAL_DEF("physics/2d/thread_model", 1);
if (tm == 0) // single unsafe
return memnew(T);
else if (tm == 1) // single safe
- return memnew(Physics2DServerWrapMT(memnew(T), false));
+ return memnew(PhysicsServer2DWrapMT(memnew(T), false));
else // multi threaded
- return memnew(Physics2DServerWrapMT(memnew(T), true));
+ return memnew(PhysicsServer2DWrapMT(memnew(T), true));
}
#undef ServerNameWrapMT
diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h
index fa56f2a250..48f3bea1e1 100644
--- a/servers/physics_2d/shape_2d_sw.h
+++ b/servers/physics_2d/shape_2d_sw.h
@@ -31,7 +31,7 @@
#ifndef SHAPE_2D_2DSW_H
#define SHAPE_2D_2DSW_H
-#include "servers/physics_2d_server.h"
+#include "servers/physics_server_2d.h"
#define _SEGMENT_IS_VALID_SUPPORT_THRESHOLD 0.99998
/*
@@ -72,7 +72,7 @@ public:
_FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; }
_FORCE_INLINE_ RID get_self() const { return self; }
- virtual Physics2DServer::ShapeType get_type() const = 0;
+ virtual PhysicsServer2D::ShapeType get_type() const = 0;
_FORCE_INLINE_ Rect2 get_aabb() const { return aabb; }
_FORCE_INLINE_ bool is_configured() const { return configured; }
@@ -165,7 +165,7 @@ public:
_FORCE_INLINE_ Vector2 get_normal() const { return normal; }
_FORCE_INLINE_ real_t get_d() const { return d; }
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_LINE; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_LINE; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal, p_transform, r_min, r_max); }
virtual void get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const;
@@ -203,7 +203,7 @@ public:
_FORCE_INLINE_ real_t get_length() const { return length; }
_FORCE_INLINE_ bool get_slips_on_slope() const { return slips_on_slope; }
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_RAY; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_RAY; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal, p_transform, r_min, r_max); }
virtual void get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const;
@@ -242,7 +242,7 @@ public:
_FORCE_INLINE_ const Vector2 &get_b() const { return b; }
_FORCE_INLINE_ const Vector2 &get_normal() const { return n; }
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_SEGMENT; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_SEGMENT; }
_FORCE_INLINE_ Vector2 get_xformed_normal(const Transform2D &p_xform) const {
@@ -285,7 +285,7 @@ class CircleShape2DSW : public Shape2DSW {
public:
_FORCE_INLINE_ const real_t &get_radius() const { return radius; }
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CIRCLE; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_CIRCLE; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal, p_transform, r_min, r_max); }
virtual void get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const;
@@ -319,7 +319,7 @@ class RectangleShape2DSW : public Shape2DSW {
public:
_FORCE_INLINE_ const Vector2 &get_half_extents() const { return half_extents; }
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_RECTANGLE; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_RECTANGLE; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal, p_transform, r_min, r_max); }
virtual void get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const;
@@ -395,7 +395,7 @@ public:
_FORCE_INLINE_ const real_t &get_radius() const { return radius; }
_FORCE_INLINE_ const real_t &get_height() const { return height; }
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CAPSULE; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_CAPSULE; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal, p_transform, r_min, r_max); }
virtual void get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const;
@@ -452,7 +452,7 @@ public:
return (p_xform.xform(b) - p_xform.xform(a)).normalized().tangent();
}
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CONVEX_POLYGON; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_CONVEX_POLYGON; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal, p_transform, r_min, r_max); }
virtual void get_supports(const Vector2 &p_normal, Vector2 *r_supports, int &r_amount) const;
@@ -531,7 +531,7 @@ class ConcavePolygonShape2DSW : public ConcaveShape2DSW {
int _generate_bvh(BVH *p_bvh, int p_len, int p_depth);
public:
- virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CONCAVE_POLYGON; }
+ virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_CONCAVE_POLYGON; }
virtual void project_rangev(const Vector2 &p_normal, const Transform2D &p_transform, real_t &r_min, real_t &r_max) const { /*project_range(p_normal,p_transform,r_min,r_max);*/
}
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index 2009cb823d..72f3e8d1b4 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -33,7 +33,7 @@
#include "collision_solver_2d_sw.h"
#include "core/os/os.h"
#include "core/pair.h"
-#include "physics_2d_server_sw.h"
+#include "physics_server_2d_sw.h"
_FORCE_INLINE_ static bool _can_collide_with(CollisionObject2DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
if (!(p_object->get_collision_layer() & p_collision_mask)) {
@@ -198,7 +198,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Trans
if (p_result_max <= 0)
return 0;
- Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.getornull(p_shape);
+ Shape2DSW *shape = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
Rect2 aabb = p_xform.xform(shape->get_aabb());
@@ -240,7 +240,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Trans
bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform2D &p_xform, const Vector2 &p_motion, real_t p_margin, real_t &p_closest_safe, real_t &p_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
- Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.getornull(p_shape);
+ Shape2DSW *shape = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, false);
Rect2 aabb = p_xform.xform(shape->get_aabb());
@@ -313,7 +313,7 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D &
if (p_result_max <= 0)
return 0;
- Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.getornull(p_shape);
+ Shape2DSW *shape = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
Rect2 aabb = p_shape_xform.xform(shape->get_aabb());
@@ -325,14 +325,14 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D &
bool collided = false;
r_result_count = 0;
- Physics2DServerSW::CollCbkData cbk;
+ PhysicsServer2DSW::CollCbkData cbk;
cbk.max = p_result_max;
cbk.amount = 0;
cbk.passed = 0;
cbk.ptr = r_results;
- CollisionSolver2DSW::CallbackResult cbkres = Physics2DServerSW::_shape_col_cbk;
+ CollisionSolver2DSW::CallbackResult cbkres = PhysicsServer2DSW::_shape_col_cbk;
- Physics2DServerSW::CollCbkData *cbkptr = &cbk;
+ PhysicsServer2DSW::CollCbkData *cbkptr = &cbk;
for (int i = 0; i < amount; i++) {
@@ -404,7 +404,7 @@ static void _rest_cbk_result(const Vector2 &p_point_A, const Vector2 &p_point_B,
bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, real_t p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
- Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.getornull(p_shape);
+ Shape2DSW *shape = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
Rect2 aabb = p_shape_xform.xform(shape->get_aabb());
@@ -503,7 +503,7 @@ int Space2DSW::_cull_aabb_for_body(Body2DSW *p_body, const Rect2 &p_aabb) {
return amount;
}
-int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, Physics2DServer::SeparationResult *r_results, int p_result_max, real_t p_margin) {
+int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, PhysicsServer2D::SeparationResult *r_results, int p_result_max, real_t p_margin) {
Rect2 body_aabb;
@@ -514,7 +514,7 @@ int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_t
if (p_body->is_shape_set_as_disabled(i))
continue;
- if (p_body->get_shape(i)->get_type() != Physics2DServer::SHAPE_RAY)
+ if (p_body->get_shape(i)->get_type() != PhysicsServer2D::SHAPE_RAY)
continue;
if (!shapes_found) {
@@ -548,10 +548,10 @@ int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_t
const int max_results = 32;
int recover_attempts = 4;
Vector2 sr[max_results * 2];
- Physics2DServerSW::CollCbkData cbk;
+ PhysicsServer2DSW::CollCbkData cbk;
cbk.max = max_results;
- Physics2DServerSW::CollCbkData *cbkptr = &cbk;
- CollisionSolver2DSW::CallbackResult cbkres = Physics2DServerSW::_shape_col_cbk;
+ PhysicsServer2DSW::CollCbkData *cbkptr = &cbk;
+ CollisionSolver2DSW::CallbackResult cbkres = PhysicsServer2DSW::_shape_col_cbk;
do {
@@ -567,7 +567,7 @@ int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_t
Shape2DSW *body_shape = p_body->get_shape(j);
- if (body_shape->get_type() != Physics2DServer::SHAPE_RAY)
+ if (body_shape->get_type() != PhysicsServer2D::SHAPE_RAY)
continue;
Transform2D body_shape_xform = body_transform * p_body->get_shape_transform(j);
@@ -584,7 +584,7 @@ int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_t
if (CollisionObject2DSW::TYPE_BODY == col_obj->get_type()) {
const Body2DSW *b = static_cast<const Body2DSW *>(col_obj);
- if (p_infinite_inertia && Physics2DServer::BODY_MODE_STATIC != b->get_mode() && Physics2DServer::BODY_MODE_KINEMATIC != b->get_mode()) {
+ if (p_infinite_inertia && PhysicsServer2D::BODY_MODE_STATIC != b->get_mode() && PhysicsServer2D::BODY_MODE_KINEMATIC != b->get_mode()) {
continue;
}
}
@@ -632,7 +632,7 @@ int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_t
if (ray_index != -1) {
- Physics2DServer::SeparationResult &result = r_results[ray_index];
+ PhysicsServer2D::SeparationResult &result = r_results[ray_index];
for (int k = 0; k < cbk.amount; k++) {
Vector2 a = sr[k * 2 + 0];
@@ -687,7 +687,7 @@ int Space2DSW::test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_t
return rays_found;
}
-bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin, Physics2DServer::MotionResult *r_result, bool p_exclude_raycast_shapes) {
+bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin, PhysicsServer2D::MotionResult *r_result, bool p_exclude_raycast_shapes) {
//give me back regular physics engine logic
//this is madness
@@ -709,7 +709,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (p_body->is_shape_set_as_disabled(i))
continue;
- if (p_exclude_raycast_shapes && p_body->get_shape(i)->get_type() == Physics2DServer::SHAPE_RAY)
+ if (p_exclude_raycast_shapes && p_body->get_shape(i)->get_type() == PhysicsServer2D::SHAPE_RAY)
continue;
if (!shapes_found) {
@@ -722,7 +722,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (!shapes_found) {
if (r_result) {
- *r_result = Physics2DServer::MotionResult();
+ *r_result = PhysicsServer2D::MotionResult();
r_result->motion = p_motion;
}
return false;
@@ -749,7 +749,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
do {
- Physics2DServerSW::CollCbkData cbk;
+ PhysicsServer2DSW::CollCbkData cbk;
cbk.max = max_results;
cbk.amount = 0;
cbk.passed = 0;
@@ -757,8 +757,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
cbk.invalid_by_dir = 0;
excluded_shape_pair_count = 0; //last step is the one valid
- Physics2DServerSW::CollCbkData *cbkptr = &cbk;
- CollisionSolver2DSW::CallbackResult cbkres = Physics2DServerSW::_shape_col_cbk;
+ PhysicsServer2DSW::CollCbkData *cbkptr = &cbk;
+ CollisionSolver2DSW::CallbackResult cbkres = PhysicsServer2DSW::_shape_col_cbk;
bool collided = false;
@@ -769,7 +769,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
continue;
Shape2DSW *body_shape = p_body->get_shape(j);
- if (p_exclude_raycast_shapes && body_shape->get_type() == Physics2DServer::SHAPE_RAY) {
+ if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer2D::SHAPE_RAY) {
continue;
}
@@ -781,7 +781,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (CollisionObject2DSW::TYPE_BODY == col_obj->get_type()) {
const Body2DSW *b = static_cast<const Body2DSW *>(col_obj);
- if (p_infinite_inertia && Physics2DServer::BODY_MODE_STATIC != b->get_mode() && Physics2DServer::BODY_MODE_KINEMATIC != b->get_mode()) {
+ if (p_infinite_inertia && PhysicsServer2D::BODY_MODE_STATIC != b->get_mode() && PhysicsServer2D::BODY_MODE_KINEMATIC != b->get_mode()) {
continue;
}
}
@@ -798,7 +798,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (col_obj->get_type() == CollisionObject2DSW::TYPE_BODY) {
const Body2DSW *b = static_cast<const Body2DSW *>(col_obj);
- if (b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC || b->get_mode() == Physics2DServer::BODY_MODE_RIGID) {
+ if (b->get_mode() == PhysicsServer2D::BODY_MODE_KINEMATIC || b->get_mode() == PhysicsServer2D::BODY_MODE_RIGID) {
//fix for moving platforms (kinematic and dynamic), margin is increased by how much it moved in the given direction
Vector2 lv = b->get_linear_velocity();
//compute displacement from linear velocity
@@ -884,7 +884,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
continue;
Shape2DSW *body_shape = p_body->get_shape(body_shape_idx);
- if (p_exclude_raycast_shapes && body_shape->get_type() == Physics2DServer::SHAPE_RAY) {
+ if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer2D::SHAPE_RAY) {
continue;
}
@@ -903,7 +903,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (CollisionObject2DSW::TYPE_BODY == col_obj->get_type()) {
const Body2DSW *b = static_cast<const Body2DSW *>(col_obj);
- if (p_infinite_inertia && Physics2DServer::BODY_MODE_STATIC != b->get_mode() && Physics2DServer::BODY_MODE_KINEMATIC != b->get_mode()) {
+ if (p_infinite_inertia && PhysicsServer2D::BODY_MODE_STATIC != b->get_mode() && PhysicsServer2D::BODY_MODE_KINEMATIC != b->get_mode()) {
continue;
}
}
@@ -964,7 +964,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (col_obj->is_shape_set_as_one_way_collision(col_shape_idx)) {
Vector2 cd[2];
- Physics2DServerSW::CollCbkData cbk;
+ PhysicsServer2DSW::CollCbkData cbk;
cbk.max = 1;
cbk.amount = 0;
cbk.passed = 0;
@@ -974,7 +974,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
cbk.valid_depth = 10e20;
Vector2 sep = mnormal; //important optimization for this to work fast enough
- bool collided = CollisionSolver2DSW::solve(body_shape, body_shape_xform, p_motion * (hi + contact_max_allowed_penetration), col_obj->get_shape(col_shape_idx), col_obj_shape_xform, Vector2(), Physics2DServerSW::_shape_col_cbk, &cbk, &sep, 0);
+ bool collided = CollisionSolver2DSW::solve(body_shape, body_shape_xform, p_motion * (hi + contact_max_allowed_penetration), col_obj->get_shape(col_shape_idx), col_obj_shape_xform, Vector2(), PhysicsServer2DSW::_shape_col_cbk, &cbk, &sep, 0);
if (!collided || cbk.amount == 0) {
continue;
}
@@ -1034,7 +1034,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
Transform2D body_shape_xform = ugt * p_body->get_shape_transform(j);
Shape2DSW *body_shape = p_body->get_shape(j);
- if (p_exclude_raycast_shapes && body_shape->get_type() == Physics2DServer::SHAPE_RAY) {
+ if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer2D::SHAPE_RAY) {
continue;
}
@@ -1049,7 +1049,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
if (CollisionObject2DSW::TYPE_BODY == col_obj->get_type()) {
const Body2DSW *b = static_cast<const Body2DSW *>(col_obj);
- if (p_infinite_inertia && Physics2DServer::BODY_MODE_STATIC != b->get_mode() && Physics2DServer::BODY_MODE_KINEMATIC != b->get_mode()) {
+ if (p_infinite_inertia && PhysicsServer2D::BODY_MODE_STATIC != b->get_mode() && PhysicsServer2D::BODY_MODE_KINEMATIC != b->get_mode()) {
continue;
}
}
@@ -1277,33 +1277,33 @@ void Space2DSW::update() {
broadphase->update();
}
-void Space2DSW::set_param(Physics2DServer::SpaceParameter p_param, real_t p_value) {
+void Space2DSW::set_param(PhysicsServer2D::SpaceParameter p_param, real_t p_value) {
switch (p_param) {
- case Physics2DServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: contact_recycle_radius = p_value; break;
- case Physics2DServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: contact_max_separation = p_value; break;
- case Physics2DServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: contact_max_allowed_penetration = p_value; break;
- case Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
- case Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
- case Physics2DServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: body_time_to_sleep = p_value; break;
- case Physics2DServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; break;
- case Physics2DServer::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: test_motion_min_contact_depth = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: contact_recycle_radius = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_CONTACT_MAX_SEPARATION: contact_max_separation = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: contact_max_allowed_penetration = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_BODY_TIME_TO_SLEEP: body_time_to_sleep = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; break;
+ case PhysicsServer2D::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: test_motion_min_contact_depth = p_value; break;
}
}
-real_t Space2DSW::get_param(Physics2DServer::SpaceParameter p_param) const {
+real_t Space2DSW::get_param(PhysicsServer2D::SpaceParameter p_param) const {
switch (p_param) {
- case Physics2DServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: return contact_recycle_radius;
- case Physics2DServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: return contact_max_separation;
- case Physics2DServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: return contact_max_allowed_penetration;
- case Physics2DServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: return body_linear_velocity_sleep_threshold;
- case Physics2DServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: return body_angular_velocity_sleep_threshold;
- case Physics2DServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: return body_time_to_sleep;
- case Physics2DServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias;
- case Physics2DServer::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: return test_motion_min_contact_depth;
+ case PhysicsServer2D::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: return contact_recycle_radius;
+ case PhysicsServer2D::SPACE_PARAM_CONTACT_MAX_SEPARATION: return contact_max_separation;
+ case PhysicsServer2D::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: return contact_max_allowed_penetration;
+ case PhysicsServer2D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: return body_linear_velocity_sleep_threshold;
+ case PhysicsServer2D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: return body_angular_velocity_sleep_threshold;
+ case PhysicsServer2D::SPACE_PARAM_BODY_TIME_TO_SLEEP: return body_time_to_sleep;
+ case PhysicsServer2D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias;
+ case PhysicsServer2D::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: return test_motion_min_contact_depth;
}
return 0;
}
diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h
index 919c65d849..f4971635b9 100644
--- a/servers/physics_2d/space_2d_sw.h
+++ b/servers/physics_2d/space_2d_sw.h
@@ -41,9 +41,9 @@
#include "core/project_settings.h"
#include "core/typedefs.h"
-class Physics2DDirectSpaceStateSW : public Physics2DDirectSpaceState {
+class Physics2DDirectSpaceStateSW : public PhysicsDirectSpaceState2D {
- GDCLASS(Physics2DDirectSpaceStateSW, Physics2DDirectSpaceState);
+ GDCLASS(Physics2DDirectSpaceStateSW, PhysicsDirectSpaceState2D);
int _intersect_point_impl(const Vector2 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_pick_point, bool p_filter_by_canvas = false, ObjectID p_canvas_instance_id = ObjectID());
@@ -175,8 +175,8 @@ public:
void lock();
void unlock();
- void set_param(Physics2DServer::SpaceParameter p_param, real_t p_value);
- real_t get_param(Physics2DServer::SpaceParameter p_param) const;
+ void set_param(PhysicsServer2D::SpaceParameter p_param, real_t p_value);
+ real_t get_param(PhysicsServer2D::SpaceParameter p_param) const;
void set_island_count(int p_island_count) { island_count = p_island_count; }
int get_island_count() const { return island_count; }
@@ -186,8 +186,8 @@ public:
int get_collision_pairs() const { return collision_pairs; }
- bool test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin, Physics2DServer::MotionResult *r_result, bool p_exclude_raycast_shapes = true);
- int test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, Physics2DServer::SeparationResult *r_results, int p_result_max, real_t p_margin);
+ bool test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, real_t p_margin, PhysicsServer2D::MotionResult *r_result, bool p_exclude_raycast_shapes = true);
+ int test_body_ray_separation(Body2DSW *p_body, const Transform2D &p_transform, bool p_infinite_inertia, Vector2 &r_recover_motion, PhysicsServer2D::SeparationResult *r_results, int p_result_max, real_t p_margin);
void set_debug_contacts(int p_amount) { contact_debug.resize(p_amount); }
_FORCE_INLINE_ bool is_debugging_contacts() const { return !contact_debug.empty(); }
diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp
index 21f18229e7..198fccdb80 100644
--- a/servers/physics_2d/step_2d_sw.cpp
+++ b/servers/physics_2d/step_2d_sw.cpp
@@ -50,7 +50,7 @@ void Step2DSW::_populate_island(Body2DSW *p_body, Body2DSW **p_island, Constrain
if (i == E->get())
continue;
Body2DSW *b = c->get_body_ptr()[i];
- if (b->get_island_step() == _step || b->get_mode() == Physics2DServer::BODY_MODE_STATIC || b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC)
+ if (b->get_island_step() == _step || b->get_mode() == PhysicsServer2D::BODY_MODE_STATIC || b->get_mode() == PhysicsServer2D::BODY_MODE_KINEMATIC)
continue; //no go
_populate_island(c->get_body_ptr()[i], p_island, p_constraint_island);
}
@@ -101,7 +101,7 @@ void Step2DSW::_check_suspend(Body2DSW *p_island, real_t p_delta) {
Body2DSW *b = p_island;
while (b) {
- if (b->get_mode() == Physics2DServer::BODY_MODE_STATIC || b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (b->get_mode() == PhysicsServer2D::BODY_MODE_STATIC || b->get_mode() == PhysicsServer2D::BODY_MODE_KINEMATIC) {
b = b->get_island_next();
continue; //ignore for static
}
@@ -117,7 +117,7 @@ void Step2DSW::_check_suspend(Body2DSW *p_island, real_t p_delta) {
b = p_island;
while (b) {
- if (b->get_mode() == Physics2DServer::BODY_MODE_STATIC || b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC) {
+ if (b->get_mode() == PhysicsServer2D::BODY_MODE_STATIC || b->get_mode() == PhysicsServer2D::BODY_MODE_KINEMATIC) {
b = b->get_island_next();
continue; //ignore for static
}
diff --git a/servers/physics/SCsub b/servers/physics_3d/SCsub
index c5cc889112..c5cc889112 100644
--- a/servers/physics/SCsub
+++ b/servers/physics_3d/SCsub
diff --git a/servers/physics/area_sw.cpp b/servers/physics_3d/area_3d_sw.cpp
index 4b54a56253..99d4d2ec1b 100644
--- a/servers/physics/area_sw.cpp
+++ b/servers/physics_3d/area_3d_sw.cpp
@@ -28,30 +28,30 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "area_sw.h"
-#include "body_sw.h"
-#include "space_sw.h"
+#include "area_3d_sw.h"
+#include "body_3d_sw.h"
+#include "space_3d_sw.h"
-AreaSW::BodyKey::BodyKey(BodySW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
+Area3DSW::BodyKey::BodyKey(Body3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
rid = p_body->get_self();
instance_id = p_body->get_instance_id();
body_shape = p_body_shape;
area_shape = p_area_shape;
}
-AreaSW::BodyKey::BodyKey(AreaSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
+Area3DSW::BodyKey::BodyKey(Area3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
rid = p_body->get_self();
instance_id = p_body->get_instance_id();
body_shape = p_body_shape;
area_shape = p_area_shape;
}
-void AreaSW::_shapes_changed() {
+void Area3DSW::_shapes_changed() {
if (!moved_list.in_list() && get_space())
get_space()->area_add_to_moved_list(&moved_list);
}
-void AreaSW::set_transform(const Transform &p_transform) {
+void Area3DSW::set_transform(const Transform &p_transform) {
if (!moved_list.in_list() && get_space())
get_space()->area_add_to_moved_list(&moved_list);
@@ -60,7 +60,7 @@ void AreaSW::set_transform(const Transform &p_transform) {
_set_inv_transform(p_transform.affine_inverse());
}
-void AreaSW::set_space(SpaceSW *p_space) {
+void Area3DSW::set_space(Space3DSW *p_space) {
if (get_space()) {
if (monitor_query_list.in_list())
@@ -75,7 +75,7 @@ void AreaSW::set_space(SpaceSW *p_space) {
_set_space(p_space);
}
-void AreaSW::set_monitor_callback(ObjectID p_id, const StringName &p_method) {
+void Area3DSW::set_monitor_callback(ObjectID p_id, const StringName &p_method) {
if (p_id == monitor_callback_id) {
monitor_callback_method = p_method;
@@ -96,7 +96,7 @@ void AreaSW::set_monitor_callback(ObjectID p_id, const StringName &p_method) {
get_space()->area_add_to_moved_list(&moved_list);
}
-void AreaSW::set_area_monitor_callback(ObjectID p_id, const StringName &p_method) {
+void Area3DSW::set_area_monitor_callback(ObjectID p_id, const StringName &p_method) {
if (p_id == area_monitor_callback_id) {
area_monitor_callback_method = p_method;
@@ -117,46 +117,46 @@ void AreaSW::set_area_monitor_callback(ObjectID p_id, const StringName &p_method
get_space()->area_add_to_moved_list(&moved_list);
}
-void AreaSW::set_space_override_mode(PhysicsServer::AreaSpaceOverrideMode p_mode) {
- bool do_override = p_mode != PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED;
- if (do_override == (space_override_mode != PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED))
+void Area3DSW::set_space_override_mode(PhysicsServer3D::AreaSpaceOverrideMode p_mode) {
+ bool do_override = p_mode != PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED;
+ if (do_override == (space_override_mode != PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED))
return;
_unregister_shapes();
space_override_mode = p_mode;
_shape_changed();
}
-void AreaSW::set_param(PhysicsServer::AreaParameter p_param, const Variant &p_value) {
+void Area3DSW::set_param(PhysicsServer3D::AreaParameter p_param, const Variant &p_value) {
switch (p_param) {
- case PhysicsServer::AREA_PARAM_GRAVITY: gravity = p_value; break;
- case PhysicsServer::AREA_PARAM_GRAVITY_VECTOR: gravity_vector = p_value; break;
- case PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT: gravity_is_point = p_value; break;
- case PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE: gravity_distance_scale = p_value; break;
- case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION: point_attenuation = p_value; break;
- case PhysicsServer::AREA_PARAM_LINEAR_DAMP: linear_damp = p_value; break;
- case PhysicsServer::AREA_PARAM_ANGULAR_DAMP: angular_damp = p_value; break;
- case PhysicsServer::AREA_PARAM_PRIORITY: priority = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY: gravity = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR: gravity_vector = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT: gravity_is_point = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE: gravity_distance_scale = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_ATTENUATION: point_attenuation = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_LINEAR_DAMP: linear_damp = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP: angular_damp = p_value; break;
+ case PhysicsServer3D::AREA_PARAM_PRIORITY: priority = p_value; break;
}
}
-Variant AreaSW::get_param(PhysicsServer::AreaParameter p_param) const {
+Variant Area3DSW::get_param(PhysicsServer3D::AreaParameter p_param) const {
switch (p_param) {
- case PhysicsServer::AREA_PARAM_GRAVITY: return gravity;
- case PhysicsServer::AREA_PARAM_GRAVITY_VECTOR: return gravity_vector;
- case PhysicsServer::AREA_PARAM_GRAVITY_IS_POINT: return gravity_is_point;
- case PhysicsServer::AREA_PARAM_GRAVITY_DISTANCE_SCALE: return gravity_distance_scale;
- case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION: return point_attenuation;
- case PhysicsServer::AREA_PARAM_LINEAR_DAMP: return linear_damp;
- case PhysicsServer::AREA_PARAM_ANGULAR_DAMP: return angular_damp;
- case PhysicsServer::AREA_PARAM_PRIORITY: return priority;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY: return gravity;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_VECTOR: return gravity_vector;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_IS_POINT: return gravity_is_point;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_DISTANCE_SCALE: return gravity_distance_scale;
+ case PhysicsServer3D::AREA_PARAM_GRAVITY_POINT_ATTENUATION: return point_attenuation;
+ case PhysicsServer3D::AREA_PARAM_LINEAR_DAMP: return linear_damp;
+ case PhysicsServer3D::AREA_PARAM_ANGULAR_DAMP: return angular_damp;
+ case PhysicsServer3D::AREA_PARAM_PRIORITY: return priority;
}
return Variant();
}
-void AreaSW::_queue_monitor_update() {
+void Area3DSW::_queue_monitor_update() {
ERR_FAIL_COND(!get_space());
@@ -164,7 +164,7 @@ void AreaSW::_queue_monitor_update() {
get_space()->area_add_to_monitor_query_list(&monitor_query_list);
}
-void AreaSW::set_monitorable(bool p_monitorable) {
+void Area3DSW::set_monitorable(bool p_monitorable) {
if (monitorable == p_monitorable)
return;
@@ -173,7 +173,7 @@ void AreaSW::set_monitorable(bool p_monitorable) {
_set_static(!monitorable);
}
-void AreaSW::call_queries() {
+void Area3DSW::call_queries() {
if (monitor_callback_id.is_valid() && !monitored_bodies.empty()) {
@@ -194,7 +194,7 @@ void AreaSW::call_queries() {
if (E->get().state == 0)
continue; //nothing happened
- res[0] = E->get().state > 0 ? PhysicsServer::AREA_BODY_ADDED : PhysicsServer::AREA_BODY_REMOVED;
+ res[0] = E->get().state > 0 ? PhysicsServer3D::AREA_BODY_ADDED : PhysicsServer3D::AREA_BODY_REMOVED;
res[1] = E->key().rid;
res[2] = E->key().instance_id;
res[3] = E->key().body_shape;
@@ -226,7 +226,7 @@ void AreaSW::call_queries() {
if (E->get().state == 0)
continue; //nothing happened
- res[0] = E->get().state > 0 ? PhysicsServer::AREA_BODY_ADDED : PhysicsServer::AREA_BODY_REMOVED;
+ res[0] = E->get().state > 0 ? PhysicsServer3D::AREA_BODY_ADDED : PhysicsServer3D::AREA_BODY_REMOVED;
res[1] = E->key().rid;
res[2] = E->key().instance_id;
res[3] = E->key().body_shape;
@@ -241,13 +241,13 @@ void AreaSW::call_queries() {
//get_space()->area_remove_from_monitor_query_list(&monitor_query_list);
}
-AreaSW::AreaSW() :
- CollisionObjectSW(TYPE_AREA),
+Area3DSW::Area3DSW() :
+ CollisionObject3DSW(TYPE_AREA),
monitor_query_list(this),
moved_list(this) {
_set_static(true); //areas are never active
- space_override_mode = PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED;
+ space_override_mode = PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED;
gravity = 9.80665;
gravity_vector = Vector3(0, -1, 0);
gravity_is_point = false;
@@ -260,5 +260,5 @@ AreaSW::AreaSW() :
monitorable = false;
}
-AreaSW::~AreaSW() {
+Area3DSW::~Area3DSW() {
}
diff --git a/servers/physics/area_sw.h b/servers/physics_3d/area_3d_sw.h
index 4da2b00d20..bc57790206 100644
--- a/servers/physics/area_sw.h
+++ b/servers/physics_3d/area_3d_sw.h
@@ -31,18 +31,18 @@
#ifndef AREA_SW_H
#define AREA_SW_H
-#include "collision_object_sw.h"
+#include "collision_object_3d_sw.h"
#include "core/self_list.h"
-#include "servers/physics_server.h"
-//#include "servers/physics/query_sw.h"
+#include "servers/physics_server_3d.h"
+//#include "servers/physics_3d/query_sw.h"
-class SpaceSW;
-class BodySW;
-class ConstraintSW;
+class Space3DSW;
+class Body3DSW;
+class Constraint3DSW;
-class AreaSW : public CollisionObjectSW {
+class Area3DSW : public CollisionObject3DSW {
- PhysicsServer::AreaSpaceOverrideMode space_override_mode;
+ PhysicsServer3D::AreaSpaceOverrideMode space_override_mode;
real_t gravity;
Vector3 gravity_vector;
bool gravity_is_point;
@@ -59,8 +59,8 @@ class AreaSW : public CollisionObjectSW {
ObjectID area_monitor_callback_id;
StringName area_monitor_callback_method;
- SelfList<AreaSW> monitor_query_list;
- SelfList<AreaSW> moved_list;
+ SelfList<Area3DSW> monitor_query_list;
+ SelfList<Area3DSW> moved_list;
struct BodyKey {
@@ -83,8 +83,8 @@ class AreaSW : public CollisionObjectSW {
}
_FORCE_INLINE_ BodyKey() {}
- BodyKey(BodySW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
- BodyKey(AreaSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
+ BodyKey(Body3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
+ BodyKey(Area3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
};
struct BodyState {
@@ -101,7 +101,7 @@ class AreaSW : public CollisionObjectSW {
//virtual void shape_changed_notify(ShapeSW *p_shape);
//virtual void shape_deleted_notify(ShapeSW *p_shape);
- Set<ConstraintSW *> constraints;
+ Set<Constraint3DSW *> constraints;
virtual void _shapes_changed();
void _queue_monitor_update();
@@ -116,17 +116,17 @@ public:
void set_area_monitor_callback(ObjectID p_id, const StringName &p_method);
_FORCE_INLINE_ bool has_area_monitor_callback() const { return area_monitor_callback_id.is_valid(); }
- _FORCE_INLINE_ void add_body_to_query(BodySW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
- _FORCE_INLINE_ void remove_body_from_query(BodySW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
+ _FORCE_INLINE_ void add_body_to_query(Body3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
+ _FORCE_INLINE_ void remove_body_from_query(Body3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
- _FORCE_INLINE_ void add_area_to_query(AreaSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape);
- _FORCE_INLINE_ void remove_area_from_query(AreaSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape);
+ _FORCE_INLINE_ void add_area_to_query(Area3DSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape);
+ _FORCE_INLINE_ void remove_area_from_query(Area3DSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape);
- void set_param(PhysicsServer::AreaParameter p_param, const Variant &p_value);
- Variant get_param(PhysicsServer::AreaParameter p_param) const;
+ void set_param(PhysicsServer3D::AreaParameter p_param, const Variant &p_value);
+ Variant get_param(PhysicsServer3D::AreaParameter p_param) const;
- void set_space_override_mode(PhysicsServer::AreaSpaceOverrideMode p_mode);
- PhysicsServer::AreaSpaceOverrideMode get_space_override_mode() const { return space_override_mode; }
+ void set_space_override_mode(PhysicsServer3D::AreaSpaceOverrideMode p_mode);
+ PhysicsServer3D::AreaSpaceOverrideMode get_space_override_mode() const { return space_override_mode; }
_FORCE_INLINE_ void set_gravity(real_t p_gravity) { gravity = p_gravity; }
_FORCE_INLINE_ real_t get_gravity() const { return gravity; }
@@ -152,9 +152,9 @@ public:
_FORCE_INLINE_ void set_priority(int p_priority) { priority = p_priority; }
_FORCE_INLINE_ int get_priority() const { return priority; }
- _FORCE_INLINE_ void add_constraint(ConstraintSW *p_constraint) { constraints.insert(p_constraint); }
- _FORCE_INLINE_ void remove_constraint(ConstraintSW *p_constraint) { constraints.erase(p_constraint); }
- _FORCE_INLINE_ const Set<ConstraintSW *> &get_constraints() const { return constraints; }
+ _FORCE_INLINE_ void add_constraint(Constraint3DSW *p_constraint) { constraints.insert(p_constraint); }
+ _FORCE_INLINE_ void remove_constraint(Constraint3DSW *p_constraint) { constraints.erase(p_constraint); }
+ _FORCE_INLINE_ const Set<Constraint3DSW *> &get_constraints() const { return constraints; }
_FORCE_INLINE_ void clear_constraints() { constraints.clear(); }
void set_monitorable(bool p_monitorable);
@@ -162,22 +162,22 @@ public:
void set_transform(const Transform &p_transform);
- void set_space(SpaceSW *p_space);
+ void set_space(Space3DSW *p_space);
void call_queries();
- AreaSW();
- ~AreaSW();
+ Area3DSW();
+ ~Area3DSW();
};
-void AreaSW::add_body_to_query(BodySW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
+void Area3DSW::add_body_to_query(Body3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
BodyKey bk(p_body, p_body_shape, p_area_shape);
monitored_bodies[bk].inc();
if (!monitor_query_list.in_list())
_queue_monitor_update();
}
-void AreaSW::remove_body_from_query(BodySW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
+void Area3DSW::remove_body_from_query(Body3DSW *p_body, uint32_t p_body_shape, uint32_t p_area_shape) {
BodyKey bk(p_body, p_body_shape, p_area_shape);
monitored_bodies[bk].dec();
@@ -185,14 +185,14 @@ void AreaSW::remove_body_from_query(BodySW *p_body, uint32_t p_body_shape, uint3
_queue_monitor_update();
}
-void AreaSW::add_area_to_query(AreaSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape) {
+void Area3DSW::add_area_to_query(Area3DSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape) {
BodyKey bk(p_area, p_area_shape, p_self_shape);
monitored_areas[bk].inc();
if (!monitor_query_list.in_list())
_queue_monitor_update();
}
-void AreaSW::remove_area_from_query(AreaSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape) {
+void Area3DSW::remove_area_from_query(Area3DSW *p_area, uint32_t p_area_shape, uint32_t p_self_shape) {
BodyKey bk(p_area, p_area_shape, p_self_shape);
monitored_areas[bk].dec();
diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics_3d/area_pair_3d_sw.cpp
index 966a440930..3300e9dede 100644
--- a/servers/physics/area_pair_sw.cpp
+++ b/servers/physics_3d/area_pair_3d_sw.cpp
@@ -28,16 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "area_pair_sw.h"
-#include "collision_solver_sw.h"
+#include "area_pair_3d_sw.h"
+#include "collision_solver_3d_sw.h"
-bool AreaPairSW::setup(real_t p_step) {
+bool AreaPair3DSW::setup(real_t p_step) {
bool result = false;
if (area->is_shape_set_as_disabled(area_shape) || body->is_shape_set_as_disabled(body_shape)) {
result = false;
- } else if (area->test_collision_mask(body) && CollisionSolverSW::solve_static(body->get_shape(body_shape), body->get_transform() * body->get_shape_transform(body_shape), area->get_shape(area_shape), area->get_transform() * area->get_shape_transform(area_shape), NULL, this)) {
+ } else if (area->test_collision_mask(body) && CollisionSolver3DSW::solve_static(body->get_shape(body_shape), body->get_transform() * body->get_shape_transform(body_shape), area->get_shape(area_shape), area->get_transform() * area->get_shape_transform(area_shape), NULL, this)) {
result = true;
}
@@ -45,14 +45,14 @@ bool AreaPairSW::setup(real_t p_step) {
if (result) {
- if (area->get_space_override_mode() != PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED)
+ if (area->get_space_override_mode() != PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED)
body->add_area(area);
if (area->has_monitor_callback())
area->add_body_to_query(body, body_shape, area_shape);
} else {
- if (area->get_space_override_mode() != PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED)
+ if (area->get_space_override_mode() != PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED)
body->remove_area(area);
if (area->has_monitor_callback())
area->remove_body_from_query(body, body_shape, area_shape);
@@ -64,10 +64,10 @@ bool AreaPairSW::setup(real_t p_step) {
return false; //never do any post solving
}
-void AreaPairSW::solve(real_t p_step) {
+void AreaPair3DSW::solve(real_t p_step) {
}
-AreaPairSW::AreaPairSW(BodySW *p_body, int p_body_shape, AreaSW *p_area, int p_area_shape) {
+AreaPair3DSW::AreaPair3DSW(Body3DSW *p_body, int p_body_shape, Area3DSW *p_area, int p_area_shape) {
body = p_body;
area = p_area;
@@ -76,15 +76,15 @@ AreaPairSW::AreaPairSW(BodySW *p_body, int p_body_shape, AreaSW *p_area, int p_a
colliding = false;
body->add_constraint(this, 0);
area->add_constraint(this);
- if (p_body->get_mode() == PhysicsServer::BODY_MODE_KINEMATIC)
+ if (p_body->get_mode() == PhysicsServer3D::BODY_MODE_KINEMATIC)
p_body->set_active(true);
}
-AreaPairSW::~AreaPairSW() {
+AreaPair3DSW::~AreaPair3DSW() {
if (colliding) {
- if (area->get_space_override_mode() != PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED)
+ if (area->get_space_override_mode() != PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED)
body->remove_area(area);
if (area->has_monitor_callback())
area->remove_body_from_query(body, body_shape, area_shape);
@@ -95,12 +95,12 @@ AreaPairSW::~AreaPairSW() {
////////////////////////////////////////////////////
-bool Area2PairSW::setup(real_t p_step) {
+bool Area2Pair3DSW::setup(real_t p_step) {
bool result = false;
if (area_a->is_shape_set_as_disabled(shape_a) || area_b->is_shape_set_as_disabled(shape_b)) {
result = false;
- } else if (area_a->test_collision_mask(area_b) && CollisionSolverSW::solve_static(area_a->get_shape(shape_a), area_a->get_transform() * area_a->get_shape_transform(shape_a), area_b->get_shape(shape_b), area_b->get_transform() * area_b->get_shape_transform(shape_b), NULL, this)) {
+ } else if (area_a->test_collision_mask(area_b) && CollisionSolver3DSW::solve_static(area_a->get_shape(shape_a), area_a->get_transform() * area_a->get_shape_transform(shape_a), area_b->get_shape(shape_b), area_b->get_transform() * area_b->get_shape_transform(shape_b), NULL, this)) {
result = true;
}
@@ -129,10 +129,10 @@ bool Area2PairSW::setup(real_t p_step) {
return false; //never do any post solving
}
-void Area2PairSW::solve(real_t p_step) {
+void Area2Pair3DSW::solve(real_t p_step) {
}
-Area2PairSW::Area2PairSW(AreaSW *p_area_a, int p_shape_a, AreaSW *p_area_b, int p_shape_b) {
+Area2Pair3DSW::Area2Pair3DSW(Area3DSW *p_area_a, int p_shape_a, Area3DSW *p_area_b, int p_shape_b) {
area_a = p_area_a;
area_b = p_area_b;
@@ -143,7 +143,7 @@ Area2PairSW::Area2PairSW(AreaSW *p_area_a, int p_shape_a, AreaSW *p_area_b, int
area_b->add_constraint(this);
}
-Area2PairSW::~Area2PairSW() {
+Area2Pair3DSW::~Area2Pair3DSW() {
if (colliding) {
diff --git a/servers/physics/area_pair_sw.h b/servers/physics_3d/area_pair_3d_sw.h
index 97a37ebf90..6f7e1ee3b5 100644
--- a/servers/physics/area_pair_sw.h
+++ b/servers/physics_3d/area_pair_3d_sw.h
@@ -31,14 +31,14 @@
#ifndef AREA_PAIR_SW_H
#define AREA_PAIR_SW_H
-#include "area_sw.h"
-#include "body_sw.h"
-#include "constraint_sw.h"
+#include "area_3d_sw.h"
+#include "body_3d_sw.h"
+#include "constraint_3d_sw.h"
-class AreaPairSW : public ConstraintSW {
+class AreaPair3DSW : public Constraint3DSW {
- BodySW *body;
- AreaSW *area;
+ Body3DSW *body;
+ Area3DSW *area;
int body_shape;
int area_shape;
bool colliding;
@@ -47,14 +47,14 @@ public:
bool setup(real_t p_step);
void solve(real_t p_step);
- AreaPairSW(BodySW *p_body, int p_body_shape, AreaSW *p_area, int p_area_shape);
- ~AreaPairSW();
+ AreaPair3DSW(Body3DSW *p_body, int p_body_shape, Area3DSW *p_area, int p_area_shape);
+ ~AreaPair3DSW();
};
-class Area2PairSW : public ConstraintSW {
+class Area2Pair3DSW : public Constraint3DSW {
- AreaSW *area_a;
- AreaSW *area_b;
+ Area3DSW *area_a;
+ Area3DSW *area_b;
int shape_a;
int shape_b;
bool colliding;
@@ -63,8 +63,8 @@ public:
bool setup(real_t p_step);
void solve(real_t p_step);
- Area2PairSW(AreaSW *p_area_a, int p_shape_a, AreaSW *p_area_b, int p_shape_b);
- ~Area2PairSW();
+ Area2Pair3DSW(Area3DSW *p_area_a, int p_shape_a, Area3DSW *p_area_b, int p_shape_b);
+ ~Area2Pair3DSW();
};
#endif // AREA_PAIR__SW_H
diff --git a/servers/physics/body_sw.cpp b/servers/physics_3d/body_3d_sw.cpp
index 8819941f04..dcdc373dc9 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics_3d/body_3d_sw.cpp
@@ -28,17 +28,17 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "body_sw.h"
-#include "area_sw.h"
-#include "space_sw.h"
+#include "body_3d_sw.h"
+#include "area_3d_sw.h"
+#include "space_3d_sw.h"
-void BodySW::_update_inertia() {
+void Body3DSW::_update_inertia() {
if (get_space() && !inertia_update_list.in_list())
get_space()->body_add_to_inertia_update_list(&inertia_update_list);
}
-void BodySW::_update_transform_dependant() {
+void Body3DSW::_update_transform_dependant() {
center_of_mass = get_transform().basis.xform(center_of_mass_local);
principal_inertia_axes = get_transform().basis * principal_inertia_axes_local;
@@ -51,13 +51,13 @@ void BodySW::_update_transform_dependant() {
_inv_inertia_tensor = tb * diag * tbt;
}
-void BodySW::update_inertias() {
+void Body3DSW::update_inertias() {
//update shapes and motions
switch (mode) {
- case PhysicsServer::BODY_MODE_RIGID: {
+ case PhysicsServer3D::BODY_MODE_RIGID: {
//update tensor for all shapes, not the best way but should be somehow OK. (inspired from bullet)
real_t total_area = 0;
@@ -91,7 +91,7 @@ void BodySW::update_inertias() {
continue;
}
- const ShapeSW *shape = get_shape(i);
+ const Shape3DSW *shape = get_shape(i);
real_t area = get_shape_area(i);
@@ -119,13 +119,13 @@ void BodySW::update_inertias() {
} break;
- case PhysicsServer::BODY_MODE_KINEMATIC:
- case PhysicsServer::BODY_MODE_STATIC: {
+ case PhysicsServer3D::BODY_MODE_KINEMATIC:
+ case PhysicsServer3D::BODY_MODE_STATIC: {
_inv_inertia_tensor.set_zero();
_inv_mass = 0;
} break;
- case PhysicsServer::BODY_MODE_CHARACTER: {
+ case PhysicsServer3D::BODY_MODE_CHARACTER: {
_inv_inertia_tensor.set_zero();
_inv_mass = 1.0 / mass;
@@ -138,7 +138,7 @@ void BodySW::update_inertias() {
_update_transform_dependant();
}
-void BodySW::set_active(bool p_active) {
+void Body3DSW::set_active(bool p_active) {
if (active == p_active)
return;
@@ -148,7 +148,7 @@ void BodySW::set_active(bool p_active) {
if (get_space())
get_space()->body_remove_from_active_list(&active_list);
} else {
- if (mode == PhysicsServer::BODY_MODE_STATIC)
+ if (mode == PhysicsServer3D::BODY_MODE_STATIC)
return; //static bodies can't become active
if (get_space())
get_space()->body_add_to_active_list(&active_list);
@@ -168,31 +168,31 @@ void BodySW::set_active(bool p_active) {
*/
}
-void BodySW::set_param(PhysicsServer::BodyParameter p_param, real_t p_value) {
+void Body3DSW::set_param(PhysicsServer3D::BodyParameter p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::BODY_PARAM_BOUNCE: {
+ case PhysicsServer3D::BODY_PARAM_BOUNCE: {
bounce = p_value;
} break;
- case PhysicsServer::BODY_PARAM_FRICTION: {
+ case PhysicsServer3D::BODY_PARAM_FRICTION: {
friction = p_value;
} break;
- case PhysicsServer::BODY_PARAM_MASS: {
+ case PhysicsServer3D::BODY_PARAM_MASS: {
ERR_FAIL_COND(p_value <= 0);
mass = p_value;
_update_inertia();
} break;
- case PhysicsServer::BODY_PARAM_GRAVITY_SCALE: {
+ case PhysicsServer3D::BODY_PARAM_GRAVITY_SCALE: {
gravity_scale = p_value;
} break;
- case PhysicsServer::BODY_PARAM_LINEAR_DAMP: {
+ case PhysicsServer3D::BODY_PARAM_LINEAR_DAMP: {
linear_damp = p_value;
} break;
- case PhysicsServer::BODY_PARAM_ANGULAR_DAMP: {
+ case PhysicsServer3D::BODY_PARAM_ANGULAR_DAMP: {
angular_damp = p_value;
} break;
@@ -201,28 +201,28 @@ void BodySW::set_param(PhysicsServer::BodyParameter p_param, real_t p_value) {
}
}
-real_t BodySW::get_param(PhysicsServer::BodyParameter p_param) const {
+real_t Body3DSW::get_param(PhysicsServer3D::BodyParameter p_param) const {
switch (p_param) {
- case PhysicsServer::BODY_PARAM_BOUNCE: {
+ case PhysicsServer3D::BODY_PARAM_BOUNCE: {
return bounce;
} break;
- case PhysicsServer::BODY_PARAM_FRICTION: {
+ case PhysicsServer3D::BODY_PARAM_FRICTION: {
return friction;
} break;
- case PhysicsServer::BODY_PARAM_MASS: {
+ case PhysicsServer3D::BODY_PARAM_MASS: {
return mass;
} break;
- case PhysicsServer::BODY_PARAM_GRAVITY_SCALE: {
+ case PhysicsServer3D::BODY_PARAM_GRAVITY_SCALE: {
return gravity_scale;
} break;
- case PhysicsServer::BODY_PARAM_LINEAR_DAMP: {
+ case PhysicsServer3D::BODY_PARAM_LINEAR_DAMP: {
return linear_damp;
} break;
- case PhysicsServer::BODY_PARAM_ANGULAR_DAMP: {
+ case PhysicsServer3D::BODY_PARAM_ANGULAR_DAMP: {
return angular_damp;
} break;
@@ -234,36 +234,36 @@ real_t BodySW::get_param(PhysicsServer::BodyParameter p_param) const {
return 0;
}
-void BodySW::set_mode(PhysicsServer::BodyMode p_mode) {
+void Body3DSW::set_mode(PhysicsServer3D::BodyMode p_mode) {
- PhysicsServer::BodyMode prev = mode;
+ PhysicsServer3D::BodyMode prev = mode;
mode = p_mode;
switch (p_mode) {
//CLEAR UP EVERYTHING IN CASE IT NOT WORKS!
- case PhysicsServer::BODY_MODE_STATIC:
- case PhysicsServer::BODY_MODE_KINEMATIC: {
+ case PhysicsServer3D::BODY_MODE_STATIC:
+ case PhysicsServer3D::BODY_MODE_KINEMATIC: {
_set_inv_transform(get_transform().affine_inverse());
_inv_mass = 0;
- _set_static(p_mode == PhysicsServer::BODY_MODE_STATIC);
- //set_active(p_mode==PhysicsServer::BODY_MODE_KINEMATIC);
- set_active(p_mode == PhysicsServer::BODY_MODE_KINEMATIC && contacts.size());
+ _set_static(p_mode == PhysicsServer3D::BODY_MODE_STATIC);
+ //set_active(p_mode==PhysicsServer3D::BODY_MODE_KINEMATIC);
+ set_active(p_mode == PhysicsServer3D::BODY_MODE_KINEMATIC && contacts.size());
linear_velocity = Vector3();
angular_velocity = Vector3();
- if (mode == PhysicsServer::BODY_MODE_KINEMATIC && prev != mode) {
+ if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC && prev != mode) {
first_time_kinematic = true;
}
} break;
- case PhysicsServer::BODY_MODE_RIGID: {
+ case PhysicsServer3D::BODY_MODE_RIGID: {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_set_static(false);
set_active(true);
} break;
- case PhysicsServer::BODY_MODE_CHARACTER: {
+ case PhysicsServer3D::BODY_MODE_CHARACTER: {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_set_static(false);
@@ -278,22 +278,22 @@ void BodySW::set_mode(PhysicsServer::BodyMode p_mode) {
_update_queries();
*/
}
-PhysicsServer::BodyMode BodySW::get_mode() const {
+PhysicsServer3D::BodyMode Body3DSW::get_mode() const {
return mode;
}
-void BodySW::_shapes_changed() {
+void Body3DSW::_shapes_changed() {
_update_inertia();
}
-void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant &p_variant) {
+void Body3DSW::set_state(PhysicsServer3D::BodyState p_state, const Variant &p_variant) {
switch (p_state) {
- case PhysicsServer::BODY_STATE_TRANSFORM: {
+ case PhysicsServer3D::BODY_STATE_TRANSFORM: {
- if (mode == PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC) {
new_transform = p_variant;
//wakeup_neighbours();
set_active(true);
@@ -303,7 +303,7 @@ void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant &p_varian
first_time_kinematic = false;
}
- } else if (mode == PhysicsServer::BODY_MODE_STATIC) {
+ } else if (mode == PhysicsServer3D::BODY_MODE_STATIC) {
_set_transform(p_variant);
_set_inv_transform(get_transform().affine_inverse());
wakeup_neighbours();
@@ -319,27 +319,27 @@ void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant &p_varian
wakeup();
} break;
- case PhysicsServer::BODY_STATE_LINEAR_VELOCITY: {
+ case PhysicsServer3D::BODY_STATE_LINEAR_VELOCITY: {
/*
- if (mode==PhysicsServer::BODY_MODE_STATIC)
+ if (mode==PhysicsServer3D::BODY_MODE_STATIC)
break;
*/
linear_velocity = p_variant;
wakeup();
} break;
- case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY: {
+ case PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY: {
/*
- if (mode!=PhysicsServer::BODY_MODE_RIGID)
+ if (mode!=PhysicsServer3D::BODY_MODE_RIGID)
break;
*/
angular_velocity = p_variant;
wakeup();
} break;
- case PhysicsServer::BODY_STATE_SLEEPING: {
+ case PhysicsServer3D::BODY_STATE_SLEEPING: {
//?
- if (mode == PhysicsServer::BODY_MODE_STATIC || mode == PhysicsServer::BODY_MODE_KINEMATIC)
+ if (mode == PhysicsServer3D::BODY_MODE_STATIC || mode == PhysicsServer3D::BODY_MODE_KINEMATIC)
break;
bool do_sleep = p_variant;
if (do_sleep) {
@@ -352,30 +352,30 @@ void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant &p_varian
set_active(true);
}
} break;
- case PhysicsServer::BODY_STATE_CAN_SLEEP: {
+ case PhysicsServer3D::BODY_STATE_CAN_SLEEP: {
can_sleep = p_variant;
- if (mode == PhysicsServer::BODY_MODE_RIGID && !active && !can_sleep)
+ if (mode == PhysicsServer3D::BODY_MODE_RIGID && !active && !can_sleep)
set_active(true);
} break;
}
}
-Variant BodySW::get_state(PhysicsServer::BodyState p_state) const {
+Variant Body3DSW::get_state(PhysicsServer3D::BodyState p_state) const {
switch (p_state) {
- case PhysicsServer::BODY_STATE_TRANSFORM: {
+ case PhysicsServer3D::BODY_STATE_TRANSFORM: {
return get_transform();
} break;
- case PhysicsServer::BODY_STATE_LINEAR_VELOCITY: {
+ case PhysicsServer3D::BODY_STATE_LINEAR_VELOCITY: {
return linear_velocity;
} break;
- case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY: {
+ case PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY: {
return angular_velocity;
} break;
- case PhysicsServer::BODY_STATE_SLEEPING: {
+ case PhysicsServer3D::BODY_STATE_SLEEPING: {
return !is_active();
} break;
- case PhysicsServer::BODY_STATE_CAN_SLEEP: {
+ case PhysicsServer3D::BODY_STATE_CAN_SLEEP: {
return can_sleep;
} break;
}
@@ -383,7 +383,7 @@ Variant BodySW::get_state(PhysicsServer::BodyState p_state) const {
return Variant();
}
-void BodySW::set_space(SpaceSW *p_space) {
+void Body3DSW::set_space(Space3DSW *p_space) {
if (get_space()) {
@@ -414,7 +414,7 @@ void BodySW::set_space(SpaceSW *p_space) {
first_integration = true;
}
-void BodySW::_compute_area_gravity_and_dampenings(const AreaSW *p_area) {
+void Body3DSW::_compute_area_gravity_and_dampenings(const Area3DSW *p_area) {
if (p_area->is_gravity_point()) {
if (p_area->get_gravity_distance_scale() > 0) {
@@ -431,7 +431,7 @@ void BodySW::_compute_area_gravity_and_dampenings(const AreaSW *p_area) {
area_angular_damp += p_area->get_angular_damp();
}
-void BodySW::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock) {
+void Body3DSW::set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool lock) {
if (lock) {
locked_axis |= p_axis;
} else {
@@ -439,16 +439,16 @@ void BodySW::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock) {
}
}
-bool BodySW::is_axis_locked(PhysicsServer::BodyAxis p_axis) const {
+bool Body3DSW::is_axis_locked(PhysicsServer3D::BodyAxis p_axis) const {
return locked_axis & p_axis;
}
-void BodySW::integrate_forces(real_t p_step) {
+void Body3DSW::integrate_forces(real_t p_step) {
- if (mode == PhysicsServer::BODY_MODE_STATIC)
+ if (mode == PhysicsServer3D::BODY_MODE_STATIC)
return;
- AreaSW *def_area = get_space()->get_default_area();
+ Area3DSW *def_area = get_space()->get_default_area();
// AreaSW *damp_area = def_area;
ERR_FAIL_COND(!def_area);
@@ -463,20 +463,20 @@ void BodySW::integrate_forces(real_t p_step) {
const AreaCMP *aa = &areas[0];
// damp_area = aa[ac-1].area;
for (int i = ac - 1; i >= 0 && !stopped; i--) {
- PhysicsServer::AreaSpaceOverrideMode mode = aa[i].area->get_space_override_mode();
+ PhysicsServer3D::AreaSpaceOverrideMode mode = aa[i].area->get_space_override_mode();
switch (mode) {
- case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE:
- case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE: {
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_COMBINE:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_COMBINE_REPLACE: {
_compute_area_gravity_and_dampenings(aa[i].area);
- stopped = mode == PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE;
+ stopped = mode == PhysicsServer3D::AREA_SPACE_OVERRIDE_COMBINE_REPLACE;
} break;
- case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE:
- case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE_COMBINE: {
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_REPLACE:
+ case PhysicsServer3D::AREA_SPACE_OVERRIDE_REPLACE_COMBINE: {
gravity = Vector3(0, 0, 0);
area_angular_damp = 0;
area_linear_damp = 0;
_compute_area_gravity_and_dampenings(aa[i].area);
- stopped = mode == PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE;
+ stopped = mode == PhysicsServer3D::AREA_SPACE_OVERRIDE_REPLACE;
} break;
default: {
}
@@ -508,7 +508,7 @@ void BodySW::integrate_forces(real_t p_step) {
Vector3 motion;
bool do_motion = false;
- if (mode == PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC) {
//compute motion, angular and etc. velocities from prev transform
linear_velocity = (new_transform.origin - get_transform().origin) / p_step;
@@ -573,9 +573,9 @@ void BodySW::integrate_forces(real_t p_step) {
contact_count = 0;
}
-void BodySW::integrate_velocities(real_t p_step) {
+void Body3DSW::integrate_velocities(real_t p_step) {
- if (mode == PhysicsServer::BODY_MODE_STATIC)
+ if (mode == PhysicsServer3D::BODY_MODE_STATIC)
return;
if (fi_callback)
@@ -583,7 +583,7 @@ void BodySW::integrate_velocities(real_t p_step) {
//apply axis lock linear
for (int i = 0; i < 3; i++) {
- if (is_axis_locked((PhysicsServer::BodyAxis)(1 << i))) {
+ if (is_axis_locked((PhysicsServer3D::BodyAxis)(1 << i))) {
linear_velocity[i] = 0;
biased_linear_velocity[i] = 0;
new_transform.origin[i] = get_transform().origin[i];
@@ -591,13 +591,13 @@ void BodySW::integrate_velocities(real_t p_step) {
}
//apply axis lock angular
for (int i = 0; i < 3; i++) {
- if (is_axis_locked((PhysicsServer::BodyAxis)(1 << (i + 3)))) {
+ if (is_axis_locked((PhysicsServer3D::BodyAxis)(1 << (i + 3)))) {
angular_velocity[i] = 0;
biased_angular_velocity[i] = 0;
}
}
- if (mode == PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC) {
_set_transform(new_transform, false);
_set_inv_transform(new_transform.affine_inverse());
@@ -675,20 +675,20 @@ void BodySW::simulate_motion(const Transform& p_xform,real_t p_step) {
}
*/
-void BodySW::wakeup_neighbours() {
+void Body3DSW::wakeup_neighbours() {
- for (Map<ConstraintSW *, int>::Element *E = constraint_map.front(); E; E = E->next()) {
+ for (Map<Constraint3DSW *, int>::Element *E = constraint_map.front(); E; E = E->next()) {
- const ConstraintSW *c = E->key();
- BodySW **n = c->get_body_ptr();
+ const Constraint3DSW *c = E->key();
+ Body3DSW **n = c->get_body_ptr();
int bc = c->get_body_count();
for (int i = 0; i < bc; i++) {
if (i == E->get())
continue;
- BodySW *b = n[i];
- if (b->mode != PhysicsServer::BODY_MODE_RIGID)
+ Body3DSW *b = n[i];
+ if (b->mode != PhysicsServer3D::BODY_MODE_RIGID)
continue;
if (!b->is_active())
@@ -697,11 +697,11 @@ void BodySW::wakeup_neighbours() {
}
}
-void BodySW::call_queries() {
+void Body3DSW::call_queries() {
if (fi_callback) {
- PhysicsDirectBodyStateSW *dbs = PhysicsDirectBodyStateSW::singleton;
+ PhysicsDirectBodyState3DSW *dbs = PhysicsDirectBodyState3DSW::singleton;
dbs->body = this;
Variant v = dbs;
@@ -720,11 +720,11 @@ void BodySW::call_queries() {
}
}
-bool BodySW::sleep_test(real_t p_step) {
+bool Body3DSW::sleep_test(real_t p_step) {
- if (mode == PhysicsServer::BODY_MODE_STATIC || mode == PhysicsServer::BODY_MODE_KINEMATIC)
+ if (mode == PhysicsServer3D::BODY_MODE_STATIC || mode == PhysicsServer3D::BODY_MODE_KINEMATIC)
return true; //
- else if (mode == PhysicsServer::BODY_MODE_CHARACTER)
+ else if (mode == PhysicsServer3D::BODY_MODE_CHARACTER)
return !active; // characters don't sleep unless asked to sleep
else if (!can_sleep)
return false;
@@ -741,7 +741,7 @@ bool BodySW::sleep_test(real_t p_step) {
}
}
-void BodySW::set_force_integration_callback(ObjectID p_id, const StringName &p_method, const Variant &p_udata) {
+void Body3DSW::set_force_integration_callback(ObjectID p_id, const StringName &p_method, const Variant &p_udata) {
if (fi_callback) {
@@ -758,18 +758,18 @@ void BodySW::set_force_integration_callback(ObjectID p_id, const StringName &p_m
}
}
-void BodySW::set_kinematic_margin(real_t p_margin) {
+void Body3DSW::set_kinematic_margin(real_t p_margin) {
kinematic_safe_margin = p_margin;
}
-BodySW::BodySW() :
- CollisionObjectSW(TYPE_BODY),
+Body3DSW::Body3DSW() :
+ CollisionObject3DSW(TYPE_BODY),
locked_axis(0),
active_list(this),
inertia_update_list(this),
direct_state_query_list(this) {
- mode = PhysicsServer::BODY_MODE_RIGID;
+ mode = PhysicsServer3D::BODY_MODE_RIGID;
active = true;
mass = 1;
@@ -800,15 +800,15 @@ BodySW::BodySW() :
fi_callback = NULL;
}
-BodySW::~BodySW() {
+Body3DSW::~Body3DSW() {
if (fi_callback)
memdelete(fi_callback);
}
-PhysicsDirectBodyStateSW *PhysicsDirectBodyStateSW::singleton = NULL;
+PhysicsDirectBodyState3DSW *PhysicsDirectBodyState3DSW::singleton = NULL;
-PhysicsDirectSpaceState *PhysicsDirectBodyStateSW::get_space_state() {
+PhysicsDirectSpaceState3D *PhysicsDirectBodyState3DSW::get_space_state() {
return body->get_space()->get_direct_state();
}
diff --git a/servers/physics/body_sw.h b/servers/physics_3d/body_3d_sw.h
index d712b09878..7020805af0 100644
--- a/servers/physics/body_sw.h
+++ b/servers/physics_3d/body_3d_sw.h
@@ -31,15 +31,15 @@
#ifndef BODY_SW_H
#define BODY_SW_H
-#include "area_sw.h"
-#include "collision_object_sw.h"
+#include "area_3d_sw.h"
+#include "collision_object_3d_sw.h"
#include "core/vset.h"
-class ConstraintSW;
+class Constraint3DSW;
-class BodySW : public CollisionObjectSW {
+class Body3DSW : public CollisionObject3DSW {
- PhysicsServer::BodyMode mode;
+ PhysicsServer3D::BodyMode mode;
Vector3 linear_velocity;
Vector3 angular_velocity;
@@ -79,9 +79,9 @@ class BodySW : public CollisionObjectSW {
real_t area_angular_damp;
real_t area_linear_damp;
- SelfList<BodySW> active_list;
- SelfList<BodySW> inertia_update_list;
- SelfList<BodySW> direct_state_query_list;
+ SelfList<Body3DSW> active_list;
+ SelfList<Body3DSW> inertia_update_list;
+ SelfList<Body3DSW> direct_state_query_list;
VSet<RID> exceptions;
bool omit_force_integration;
@@ -96,16 +96,16 @@ class BodySW : public CollisionObjectSW {
virtual void _shapes_changed();
Transform new_transform;
- Map<ConstraintSW *, int> constraint_map;
+ Map<Constraint3DSW *, int> constraint_map;
struct AreaCMP {
- AreaSW *area;
+ Area3DSW *area;
int refCount;
_FORCE_INLINE_ bool operator==(const AreaCMP &p_cmp) const { return area->get_self() == p_cmp.area->get_self(); }
_FORCE_INLINE_ bool operator<(const AreaCMP &p_cmp) const { return area->get_priority() < p_cmp.area->get_priority(); }
_FORCE_INLINE_ AreaCMP() {}
- _FORCE_INLINE_ AreaCMP(AreaSW *p_area) {
+ _FORCE_INLINE_ AreaCMP(Area3DSW *p_area) {
area = p_area;
refCount = 1;
}
@@ -139,14 +139,14 @@ class BodySW : public CollisionObjectSW {
ForceIntegrationCallback *fi_callback;
uint64_t island_step;
- BodySW *island_next;
- BodySW *island_list_next;
+ Body3DSW *island_next;
+ Body3DSW *island_list_next;
- _FORCE_INLINE_ void _compute_area_gravity_and_dampenings(const AreaSW *p_area);
+ _FORCE_INLINE_ void _compute_area_gravity_and_dampenings(const Area3DSW *p_area);
_FORCE_INLINE_ void _update_transform_dependant();
- friend class PhysicsDirectBodyStateSW; // i give up, too many functions to expose
+ friend class PhysicsDirectBodyState3DSW; // i give up, too many functions to expose
public:
void set_force_integration_callback(ObjectID p_id, const StringName &p_method, const Variant &p_udata = Variant());
@@ -154,7 +154,7 @@ public:
void set_kinematic_margin(real_t p_margin);
_FORCE_INLINE_ real_t get_kinematic_margin() { return kinematic_safe_margin; }
- _FORCE_INLINE_ void add_area(AreaSW *p_area) {
+ _FORCE_INLINE_ void add_area(Area3DSW *p_area) {
int index = areas.find(AreaCMP(p_area));
if (index > -1) {
areas.write[index].refCount += 1;
@@ -163,7 +163,7 @@ public:
}
}
- _FORCE_INLINE_ void remove_area(AreaSW *p_area) {
+ _FORCE_INLINE_ void remove_area(Area3DSW *p_area) {
int index = areas.find(AreaCMP(p_area));
if (index > -1) {
areas.write[index].refCount -= 1;
@@ -175,7 +175,7 @@ public:
_FORCE_INLINE_ void set_max_contacts_reported(int p_size) {
contacts.resize(p_size);
contact_count = 0;
- if (mode == PhysicsServer::BODY_MODE_KINEMATIC && p_size) set_active(true);
+ if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC && p_size) set_active(true);
}
_FORCE_INLINE_ int get_max_contacts_reported() const { return contacts.size(); }
@@ -190,15 +190,15 @@ public:
_FORCE_INLINE_ uint64_t get_island_step() const { return island_step; }
_FORCE_INLINE_ void set_island_step(uint64_t p_step) { island_step = p_step; }
- _FORCE_INLINE_ BodySW *get_island_next() const { return island_next; }
- _FORCE_INLINE_ void set_island_next(BodySW *p_next) { island_next = p_next; }
+ _FORCE_INLINE_ Body3DSW *get_island_next() const { return island_next; }
+ _FORCE_INLINE_ void set_island_next(Body3DSW *p_next) { island_next = p_next; }
- _FORCE_INLINE_ BodySW *get_island_list_next() const { return island_list_next; }
- _FORCE_INLINE_ void set_island_list_next(BodySW *p_next) { island_list_next = p_next; }
+ _FORCE_INLINE_ Body3DSW *get_island_list_next() const { return island_list_next; }
+ _FORCE_INLINE_ void set_island_list_next(Body3DSW *p_next) { island_list_next = p_next; }
- _FORCE_INLINE_ void add_constraint(ConstraintSW *p_constraint, int p_pos) { constraint_map[p_constraint] = p_pos; }
- _FORCE_INLINE_ void remove_constraint(ConstraintSW *p_constraint) { constraint_map.erase(p_constraint); }
- const Map<ConstraintSW *, int> &get_constraint_map() const { return constraint_map; }
+ _FORCE_INLINE_ void add_constraint(Constraint3DSW *p_constraint, int p_pos) { constraint_map[p_constraint] = p_pos; }
+ _FORCE_INLINE_ void remove_constraint(Constraint3DSW *p_constraint) { constraint_map.erase(p_constraint); }
+ const Map<Constraint3DSW *, int> &get_constraint_map() const { return constraint_map; }
_FORCE_INLINE_ void clear_constraint_map() { constraint_map.clear(); }
_FORCE_INLINE_ void set_omit_force_integration(bool p_omit_force_integration) { omit_force_integration = p_omit_force_integration; }
@@ -268,19 +268,19 @@ public:
_FORCE_INLINE_ bool is_active() const { return active; }
_FORCE_INLINE_ void wakeup() {
- if ((!get_space()) || mode == PhysicsServer::BODY_MODE_STATIC || mode == PhysicsServer::BODY_MODE_KINEMATIC)
+ if ((!get_space()) || mode == PhysicsServer3D::BODY_MODE_STATIC || mode == PhysicsServer3D::BODY_MODE_KINEMATIC)
return;
set_active(true);
}
- void set_param(PhysicsServer::BodyParameter p_param, real_t);
- real_t get_param(PhysicsServer::BodyParameter p_param) const;
+ void set_param(PhysicsServer3D::BodyParameter p_param, real_t);
+ real_t get_param(PhysicsServer3D::BodyParameter p_param) const;
- void set_mode(PhysicsServer::BodyMode p_mode);
- PhysicsServer::BodyMode get_mode() const;
+ void set_mode(PhysicsServer3D::BodyMode p_mode);
+ PhysicsServer3D::BodyMode get_mode() const;
- void set_state(PhysicsServer::BodyState p_state, const Variant &p_variant);
- Variant get_state(PhysicsServer::BodyState p_state) const;
+ void set_state(PhysicsServer3D::BodyState p_state, const Variant &p_variant);
+ Variant get_state(PhysicsServer3D::BodyState p_state) const;
void set_applied_force(const Vector3 &p_force) { applied_force = p_force; }
Vector3 get_applied_force() const { return applied_force; }
@@ -291,7 +291,7 @@ public:
_FORCE_INLINE_ void set_continuous_collision_detection(bool p_enable) { continuous_cd = p_enable; }
_FORCE_INLINE_ bool is_continuous_collision_detection_enabled() const { return continuous_cd; }
- void set_space(SpaceSW *p_space);
+ void set_space(Space3DSW *p_space);
void update_inertias();
@@ -302,8 +302,8 @@ public:
_FORCE_INLINE_ Vector3 get_gravity() const { return gravity; }
_FORCE_INLINE_ real_t get_bounce() const { return bounce; }
- void set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock);
- bool is_axis_locked(PhysicsServer::BodyAxis p_axis) const;
+ void set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool lock);
+ bool is_axis_locked(PhysicsServer3D::BodyAxis p_axis) const;
void integrate_forces(real_t p_step);
void integrate_velocities(real_t p_step);
@@ -335,13 +335,13 @@ public:
bool sleep_test(real_t p_step);
- BodySW();
- ~BodySW();
+ Body3DSW();
+ ~Body3DSW();
};
//add contact inline
-void BodySW::add_contact(const Vector3 &p_local_pos, const Vector3 &p_local_normal, real_t p_depth, int p_local_shape, const Vector3 &p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID &p_collider, const Vector3 &p_collider_velocity_at_pos) {
+void Body3DSW::add_contact(const Vector3 &p_local_pos, const Vector3 &p_local_normal, real_t p_depth, int p_local_shape, const Vector3 &p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID &p_collider, const Vector3 &p_collider_velocity_at_pos) {
int c_max = contacts.size();
@@ -385,13 +385,13 @@ void BodySW::add_contact(const Vector3 &p_local_pos, const Vector3 &p_local_norm
c[idx].collider_velocity_at_pos = p_collider_velocity_at_pos;
}
-class PhysicsDirectBodyStateSW : public PhysicsDirectBodyState {
+class PhysicsDirectBodyState3DSW : public PhysicsDirectBodyState3D {
- GDCLASS(PhysicsDirectBodyStateSW, PhysicsDirectBodyState);
+ GDCLASS(PhysicsDirectBodyState3DSW, PhysicsDirectBodyState3D);
public:
- static PhysicsDirectBodyStateSW *singleton;
- BodySW *body;
+ static PhysicsDirectBodyState3DSW *singleton;
+ Body3DSW *body;
real_t step;
virtual Vector3 get_total_gravity() const { return body->gravity; } // get gravity vector working on this body space/area
@@ -411,7 +411,7 @@ public:
virtual void set_angular_velocity(const Vector3 &p_velocity) { body->set_angular_velocity(p_velocity); }
virtual Vector3 get_angular_velocity() const { return body->get_angular_velocity(); }
- virtual void set_transform(const Transform &p_transform) { body->set_state(PhysicsServer::BODY_STATE_TRANSFORM, p_transform); }
+ virtual void set_transform(const Transform &p_transform) { body->set_state(PhysicsServer3D::BODY_STATE_TRANSFORM, p_transform); }
virtual Transform get_transform() const { return body->get_transform(); }
virtual void add_central_force(const Vector3 &p_force) { body->add_central_force(p_force); }
@@ -463,10 +463,10 @@ public:
return body->contacts[p_contact_idx].collider_velocity_at_pos;
}
- virtual PhysicsDirectSpaceState *get_space_state();
+ virtual PhysicsDirectSpaceState3D *get_space_state();
virtual real_t get_step() const { return step; }
- PhysicsDirectBodyStateSW() {
+ PhysicsDirectBodyState3DSW() {
singleton = this;
body = NULL;
}
diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics_3d/body_pair_3d_sw.cpp
index 31fc1b07d9..9c3c847afe 100644
--- a/servers/physics/body_pair_sw.cpp
+++ b/servers/physics_3d/body_pair_3d_sw.cpp
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "body_pair_sw.h"
+#include "body_pair_3d_sw.h"
-#include "collision_solver_sw.h"
+#include "collision_solver_3d_sw.h"
#include "core/os/os.h"
-#include "space_sw.h"
+#include "space_3d_sw.h"
/*
#define NO_ACCUMULATE_IMPULSES
@@ -49,13 +49,13 @@
#define MIN_VELOCITY 0.0001
#define MAX_BIAS_ROTATION (Math_PI / 8)
-void BodyPairSW::_contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata) {
+void BodyPair3DSW::_contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata) {
- BodyPairSW *pair = (BodyPairSW *)p_userdata;
+ BodyPair3DSW *pair = (BodyPair3DSW *)p_userdata;
pair->contact_added_callback(p_point_A, p_point_B);
}
-void BodyPairSW::contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B) {
+void BodyPair3DSW::contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B) {
// check if we already have the contact
@@ -141,7 +141,7 @@ void BodyPairSW::contact_added_callback(const Vector3 &p_point_A, const Vector3
}
}
-void BodyPairSW::validate_contacts() {
+void BodyPair3DSW::validate_contacts() {
//make sure to erase contacts that are no longer valid
@@ -169,7 +169,7 @@ void BodyPairSW::validate_contacts() {
}
}
-bool BodyPairSW::_test_ccd(real_t p_step, BodySW *p_A, int p_shape_A, const Transform &p_xform_A, BodySW *p_B, int p_shape_B, const Transform &p_xform_B) {
+bool BodyPair3DSW::_test_ccd(real_t p_step, Body3DSW *p_A, int p_shape_A, const Transform &p_xform_A, Body3DSW *p_B, int p_shape_B, const Transform &p_xform_B) {
Vector3 motion = p_A->get_linear_velocity() * p_step;
real_t mlen = motion.length();
@@ -211,18 +211,18 @@ bool BodyPairSW::_test_ccd(real_t p_step, BodySW *p_A, int p_shape_A, const Tran
return true;
}
-real_t combine_bounce(BodySW *A, BodySW *B) {
+real_t combine_bounce(Body3DSW *A, Body3DSW *B) {
return CLAMP(A->get_bounce() + B->get_bounce(), 0, 1);
}
-real_t combine_friction(BodySW *A, BodySW *B) {
+real_t combine_friction(Body3DSW *A, Body3DSW *B) {
return ABS(MIN(A->get_friction(), B->get_friction()));
}
-bool BodyPairSW::setup(real_t p_step) {
+bool BodyPair3DSW::setup(real_t p_step) {
//cannot collide
- if (!A->test_collision_mask(B) || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC && A->get_max_contacts_reported() == 0 && B->get_max_contacts_reported() == 0)) {
+ if (!A->test_collision_mask(B) || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode() <= PhysicsServer3D::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer3D::BODY_MODE_KINEMATIC && A->get_max_contacts_reported() == 0 && B->get_max_contacts_reported() == 0)) {
collided = false;
return false;
}
@@ -244,21 +244,21 @@ bool BodyPairSW::setup(real_t p_step) {
xform_Bu.origin -= offset_A;
Transform xform_B = xform_Bu * B->get_shape_transform(shape_B);
- ShapeSW *shape_A_ptr = A->get_shape(shape_A);
- ShapeSW *shape_B_ptr = B->get_shape(shape_B);
+ Shape3DSW *shape_A_ptr = A->get_shape(shape_A);
+ Shape3DSW *shape_B_ptr = B->get_shape(shape_B);
- bool collided = CollisionSolverSW::solve_static(shape_A_ptr, xform_A, shape_B_ptr, xform_B, _contact_added_callback, this, &sep_axis);
+ bool collided = CollisionSolver3DSW::solve_static(shape_A_ptr, xform_A, shape_B_ptr, xform_B, _contact_added_callback, this, &sep_axis);
this->collided = collided;
if (!collided) {
//test ccd (currently just a raycast)
- if (A->is_continuous_collision_detection_enabled() && A->get_mode() > PhysicsServer::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (A->is_continuous_collision_detection_enabled() && A->get_mode() > PhysicsServer3D::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer3D::BODY_MODE_KINEMATIC) {
_test_ccd(p_step, A, shape_A, xform_A, B, shape_B, xform_B);
}
- if (B->is_continuous_collision_detection_enabled() && B->get_mode() > PhysicsServer::BODY_MODE_KINEMATIC && A->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (B->is_continuous_collision_detection_enabled() && B->get_mode() > PhysicsServer3D::BODY_MODE_KINEMATIC && A->get_mode() <= PhysicsServer3D::BODY_MODE_KINEMATIC) {
_test_ccd(p_step, B, shape_B, xform_B, A, shape_A, xform_A);
}
@@ -353,7 +353,7 @@ bool BodyPairSW::setup(real_t p_step) {
return true;
}
-void BodyPairSW::solve(real_t p_step) {
+void BodyPair3DSW::solve(real_t p_step) {
if (!collided)
return;
@@ -474,8 +474,8 @@ void BodyPairSW::solve(real_t p_step) {
}
}
-BodyPairSW::BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B) :
- ConstraintSW(_arr, 2) {
+BodyPair3DSW::BodyPair3DSW(Body3DSW *p_A, int p_shape_A, Body3DSW *p_B, int p_shape_B) :
+ Constraint3DSW(_arr, 2) {
A = p_A;
B = p_B;
@@ -488,7 +488,7 @@ BodyPairSW::BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B) :
collided = false;
}
-BodyPairSW::~BodyPairSW() {
+BodyPair3DSW::~BodyPair3DSW() {
A->remove_constraint(this);
B->remove_constraint(this);
diff --git a/servers/physics/body_pair_sw.h b/servers/physics_3d/body_pair_3d_sw.h
index 235aab23b5..61c219657c 100644
--- a/servers/physics/body_pair_sw.h
+++ b/servers/physics_3d/body_pair_3d_sw.h
@@ -31,10 +31,10 @@
#ifndef BODY_PAIR_SW_H
#define BODY_PAIR_SW_H
-#include "body_sw.h"
-#include "constraint_sw.h"
+#include "body_3d_sw.h"
+#include "constraint_3d_sw.h"
-class BodyPairSW : public ConstraintSW {
+class BodyPair3DSW : public Constraint3DSW {
enum {
MAX_CONTACTS = 4
@@ -42,11 +42,11 @@ class BodyPairSW : public ConstraintSW {
union {
struct {
- BodySW *A;
- BodySW *B;
+ Body3DSW *A;
+ Body3DSW *B;
};
- BodySW *_arr[2];
+ Body3DSW *_arr[2];
};
int shape_A;
@@ -82,16 +82,16 @@ class BodyPairSW : public ConstraintSW {
void contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B);
void validate_contacts();
- bool _test_ccd(real_t p_step, BodySW *p_A, int p_shape_A, const Transform &p_xform_A, BodySW *p_B, int p_shape_B, const Transform &p_xform_B);
+ bool _test_ccd(real_t p_step, Body3DSW *p_A, int p_shape_A, const Transform &p_xform_A, Body3DSW *p_B, int p_shape_B, const Transform &p_xform_B);
- SpaceSW *space;
+ Space3DSW *space;
public:
bool setup(real_t p_step);
void solve(real_t p_step);
- BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B);
- ~BodyPairSW();
+ BodyPair3DSW(Body3DSW *p_A, int p_shape_A, Body3DSW *p_B, int p_shape_B);
+ ~BodyPair3DSW();
};
#endif // BODY_PAIR__SW_H
diff --git a/servers/physics/broad_phase_basic.cpp b/servers/physics_3d/broad_phase_3d_basic.cpp
index f49bf9d4cc..bc0af98e4a 100644
--- a/servers/physics/broad_phase_basic.cpp
+++ b/servers/physics_3d/broad_phase_3d_basic.cpp
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "broad_phase_basic.h"
+#include "broad_phase_3d_basic.h"
#include "core/list.h"
#include "core/print_string.h"
-BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object, int p_subindex) {
+BroadPhase3DSW::ID BroadPhase3DBasic::create(CollisionObject3DSW *p_object, int p_subindex) {
ERR_FAIL_COND_V(p_object == NULL, 0);
@@ -47,19 +47,19 @@ BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object, int p_subi
return current;
}
-void BroadPhaseBasic::move(ID p_id, const AABB &p_aabb) {
+void BroadPhase3DBasic::move(ID p_id, const AABB &p_aabb) {
Map<ID, Element>::Element *E = element_map.find(p_id);
ERR_FAIL_COND(!E);
E->get().aabb = p_aabb;
}
-void BroadPhaseBasic::set_static(ID p_id, bool p_static) {
+void BroadPhase3DBasic::set_static(ID p_id, bool p_static) {
Map<ID, Element>::Element *E = element_map.find(p_id);
ERR_FAIL_COND(!E);
E->get()._static = p_static;
}
-void BroadPhaseBasic::remove(ID p_id) {
+void BroadPhase3DBasic::remove(ID p_id) {
Map<ID, Element>::Element *E = element_map.find(p_id);
ERR_FAIL_COND(!E);
@@ -85,26 +85,26 @@ void BroadPhaseBasic::remove(ID p_id) {
element_map.erase(E);
}
-CollisionObjectSW *BroadPhaseBasic::get_object(ID p_id) const {
+CollisionObject3DSW *BroadPhase3DBasic::get_object(ID p_id) const {
const Map<ID, Element>::Element *E = element_map.find(p_id);
ERR_FAIL_COND_V(!E, NULL);
return E->get().owner;
}
-bool BroadPhaseBasic::is_static(ID p_id) const {
+bool BroadPhase3DBasic::is_static(ID p_id) const {
const Map<ID, Element>::Element *E = element_map.find(p_id);
ERR_FAIL_COND_V(!E, false);
return E->get()._static;
}
-int BroadPhaseBasic::get_subindex(ID p_id) const {
+int BroadPhase3DBasic::get_subindex(ID p_id) const {
const Map<ID, Element>::Element *E = element_map.find(p_id);
ERR_FAIL_COND_V(!E, -1);
return E->get().subindex;
}
-int BroadPhaseBasic::cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+int BroadPhase3DBasic::cull_point(const Vector3 &p_point, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices) {
int rc = 0;
@@ -124,7 +124,7 @@ int BroadPhaseBasic::cull_point(const Vector3 &p_point, CollisionObjectSW **p_re
return rc;
}
-int BroadPhaseBasic::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+int BroadPhase3DBasic::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices) {
int rc = 0;
@@ -143,7 +143,7 @@ int BroadPhaseBasic::cull_segment(const Vector3 &p_from, const Vector3 &p_to, Co
return rc;
}
-int BroadPhaseBasic::cull_aabb(const AABB &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+int BroadPhase3DBasic::cull_aabb(const AABB &p_aabb, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices) {
int rc = 0;
@@ -163,18 +163,18 @@ int BroadPhaseBasic::cull_aabb(const AABB &p_aabb, CollisionObjectSW **p_results
return rc;
}
-void BroadPhaseBasic::set_pair_callback(PairCallback p_pair_callback, void *p_userdata) {
+void BroadPhase3DBasic::set_pair_callback(PairCallback p_pair_callback, void *p_userdata) {
pair_userdata = p_userdata;
pair_callback = p_pair_callback;
}
-void BroadPhaseBasic::set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata) {
+void BroadPhase3DBasic::set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata) {
unpair_userdata = p_userdata;
unpair_callback = p_unpair_callback;
}
-void BroadPhaseBasic::update() {
+void BroadPhase3DBasic::update() {
// recompute pairs
for (Map<ID, Element>::Element *I = element_map.front(); I; I = I->next()) {
@@ -210,12 +210,12 @@ void BroadPhaseBasic::update() {
}
}
-BroadPhaseSW *BroadPhaseBasic::_create() {
+BroadPhase3DSW *BroadPhase3DBasic::_create() {
- return memnew(BroadPhaseBasic);
+ return memnew(BroadPhase3DBasic);
}
-BroadPhaseBasic::BroadPhaseBasic() {
+BroadPhase3DBasic::BroadPhase3DBasic() {
current = 1;
unpair_callback = NULL;
diff --git a/servers/physics/broad_phase_basic.h b/servers/physics_3d/broad_phase_3d_basic.h
index 424889d8aa..00263dad0a 100644
--- a/servers/physics/broad_phase_basic.h
+++ b/servers/physics_3d/broad_phase_3d_basic.h
@@ -31,14 +31,14 @@
#ifndef BROAD_PHASE_BASIC_H
#define BROAD_PHASE_BASIC_H
-#include "broad_phase_sw.h"
+#include "broad_phase_3d_sw.h"
#include "core/map.h"
-class BroadPhaseBasic : public BroadPhaseSW {
+class BroadPhase3DBasic : public BroadPhase3DSW {
struct Element {
- CollisionObjectSW *owner;
+ CollisionObject3DSW *owner;
bool _static;
AABB aabb;
int subindex;
@@ -83,26 +83,26 @@ class BroadPhaseBasic : public BroadPhaseSW {
public:
// 0 is an invalid ID
- virtual ID create(CollisionObjectSW *p_object, int p_subindex = 0);
+ virtual ID create(CollisionObject3DSW *p_object, int p_subindex = 0);
virtual void move(ID p_id, const AABB &p_aabb);
virtual void set_static(ID p_id, bool p_static);
virtual void remove(ID p_id);
- virtual CollisionObjectSW *get_object(ID p_id) const;
+ virtual CollisionObject3DSW *get_object(ID p_id) const;
virtual bool is_static(ID p_id) const;
virtual int get_subindex(ID p_id) const;
- virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
- virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
- virtual int cull_aabb(const AABB &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
+ virtual int cull_point(const Vector3 &p_point, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL);
+ virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL);
+ virtual int cull_aabb(const AABB &p_aabb, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL);
virtual void set_pair_callback(PairCallback p_pair_callback, void *p_userdata);
virtual void set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata);
virtual void update();
- static BroadPhaseSW *_create();
- BroadPhaseBasic();
+ static BroadPhase3DSW *_create();
+ BroadPhase3DBasic();
};
#endif // BROAD_PHASE_BASIC_H
diff --git a/servers/physics/broad_phase_sw.cpp b/servers/physics_3d/broad_phase_3d_sw.cpp
index a6fc253b1b..b15b08ddfe 100644
--- a/servers/physics/broad_phase_sw.cpp
+++ b/servers/physics_3d/broad_phase_3d_sw.cpp
@@ -28,9 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "broad_phase_sw.h"
+#include "broad_phase_3d_sw.h"
-BroadPhaseSW::CreateFunction BroadPhaseSW::create_func = NULL;
+BroadPhase3DSW::CreateFunction BroadPhase3DSW::create_func = NULL;
-BroadPhaseSW::~BroadPhaseSW() {
+BroadPhase3DSW::~BroadPhase3DSW() {
}
diff --git a/servers/physics/broad_phase_sw.h b/servers/physics_3d/broad_phase_3d_sw.h
index e69a2d24ed..dd6984cbca 100644
--- a/servers/physics/broad_phase_sw.h
+++ b/servers/physics_3d/broad_phase_3d_sw.h
@@ -34,40 +34,40 @@
#include "core/math/aabb.h"
#include "core/math/math_funcs.h"
-class CollisionObjectSW;
+class CollisionObject3DSW;
-class BroadPhaseSW {
+class BroadPhase3DSW {
public:
- typedef BroadPhaseSW *(*CreateFunction)();
+ typedef BroadPhase3DSW *(*CreateFunction)();
static CreateFunction create_func;
typedef uint32_t ID;
- typedef void *(*PairCallback)(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_userdata);
- typedef void (*UnpairCallback)(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_data, void *p_userdata);
+ typedef void *(*PairCallback)(CollisionObject3DSW *A, int p_subindex_A, CollisionObject3DSW *B, int p_subindex_B, void *p_userdata);
+ typedef void (*UnpairCallback)(CollisionObject3DSW *A, int p_subindex_A, CollisionObject3DSW *B, int p_subindex_B, void *p_data, void *p_userdata);
// 0 is an invalid ID
- virtual ID create(CollisionObjectSW *p_object_, int p_subindex = 0) = 0;
+ virtual ID create(CollisionObject3DSW *p_object_, int p_subindex = 0) = 0;
virtual void move(ID p_id, const AABB &p_aabb) = 0;
virtual void set_static(ID p_id, bool p_static) = 0;
virtual void remove(ID p_id) = 0;
- virtual CollisionObjectSW *get_object(ID p_id) const = 0;
+ virtual CollisionObject3DSW *get_object(ID p_id) const = 0;
virtual bool is_static(ID p_id) const = 0;
virtual int get_subindex(ID p_id) const = 0;
- virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
- virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
- virtual int cull_aabb(const AABB &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
+ virtual int cull_point(const Vector3 &p_point, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
+ virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
+ virtual int cull_aabb(const AABB &p_aabb, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0;
virtual void set_pair_callback(PairCallback p_pair_callback, void *p_userdata) = 0;
virtual void set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata) = 0;
virtual void update() = 0;
- virtual ~BroadPhaseSW();
+ virtual ~BroadPhase3DSW();
};
#endif // BROAD_PHASE__SW_H
diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics_3d/broad_phase_octree.cpp
index a9aa662abf..50ac17e027 100644
--- a/servers/physics/broad_phase_octree.cpp
+++ b/servers/physics_3d/broad_phase_octree.cpp
@@ -29,9 +29,9 @@
/*************************************************************************/
#include "broad_phase_octree.h"
-#include "collision_object_sw.h"
+#include "collision_object_3d_sw.h"
-BroadPhaseSW::ID BroadPhaseOctree::create(CollisionObjectSW *p_object, int p_subindex) {
+BroadPhase3DSW::ID BroadPhaseOctree::create(CollisionObject3DSW *p_object, int p_subindex) {
ID oid = octree.create(p_object, AABB(), p_subindex, false, 1 << p_object->get_type(), 0);
return oid;
@@ -44,7 +44,7 @@ void BroadPhaseOctree::move(ID p_id, const AABB &p_aabb) {
void BroadPhaseOctree::set_static(ID p_id, bool p_static) {
- CollisionObjectSW *it = octree.get(p_id);
+ CollisionObject3DSW *it = octree.get(p_id);
octree.set_pairable(p_id, !p_static, 1 << it->get_type(), p_static ? 0 : 0xFFFFF); //pair everything, don't care 1?
}
void BroadPhaseOctree::remove(ID p_id) {
@@ -52,9 +52,9 @@ void BroadPhaseOctree::remove(ID p_id) {
octree.erase(p_id);
}
-CollisionObjectSW *BroadPhaseOctree::get_object(ID p_id) const {
+CollisionObject3DSW *BroadPhaseOctree::get_object(ID p_id) const {
- CollisionObjectSW *it = octree.get(p_id);
+ CollisionObject3DSW *it = octree.get(p_id);
ERR_FAIL_COND_V(!it, NULL);
return it;
}
@@ -67,22 +67,22 @@ int BroadPhaseOctree::get_subindex(ID p_id) const {
return octree.get_subindex(p_id);
}
-int BroadPhaseOctree::cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+int BroadPhaseOctree::cull_point(const Vector3 &p_point, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices) {
return octree.cull_point(p_point, p_results, p_max_results, p_result_indices);
}
-int BroadPhaseOctree::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+int BroadPhaseOctree::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices) {
return octree.cull_segment(p_from, p_to, p_results, p_max_results, p_result_indices);
}
-int BroadPhaseOctree::cull_aabb(const AABB &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) {
+int BroadPhaseOctree::cull_aabb(const AABB &p_aabb, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices) {
return octree.cull_aabb(p_aabb, p_results, p_max_results, p_result_indices);
}
-void *BroadPhaseOctree::_pair_callback(void *self, OctreeElementID p_A, CollisionObjectSW *p_object_A, int subindex_A, OctreeElementID p_B, CollisionObjectSW *p_object_B, int subindex_B) {
+void *BroadPhaseOctree::_pair_callback(void *self, OctreeElementID p_A, CollisionObject3DSW *p_object_A, int subindex_A, OctreeElementID p_B, CollisionObject3DSW *p_object_B, int subindex_B) {
BroadPhaseOctree *bpo = (BroadPhaseOctree *)(self);
if (!bpo->pair_callback)
@@ -91,7 +91,7 @@ void *BroadPhaseOctree::_pair_callback(void *self, OctreeElementID p_A, Collisio
return bpo->pair_callback(p_object_A, subindex_A, p_object_B, subindex_B, bpo->pair_userdata);
}
-void BroadPhaseOctree::_unpair_callback(void *self, OctreeElementID p_A, CollisionObjectSW *p_object_A, int subindex_A, OctreeElementID p_B, CollisionObjectSW *p_object_B, int subindex_B, void *pairdata) {
+void BroadPhaseOctree::_unpair_callback(void *self, OctreeElementID p_A, CollisionObject3DSW *p_object_A, int subindex_A, OctreeElementID p_B, CollisionObject3DSW *p_object_B, int subindex_B, void *pairdata) {
BroadPhaseOctree *bpo = (BroadPhaseOctree *)(self);
if (!bpo->unpair_callback)
@@ -115,7 +115,7 @@ void BroadPhaseOctree::update() {
// does.. not?
}
-BroadPhaseSW *BroadPhaseOctree::_create() {
+BroadPhase3DSW *BroadPhaseOctree::_create() {
return memnew(BroadPhaseOctree);
}
diff --git a/servers/physics/broad_phase_octree.h b/servers/physics_3d/broad_phase_octree.h
index e2a1d82b69..25cf5b32da 100644
--- a/servers/physics/broad_phase_octree.h
+++ b/servers/physics_3d/broad_phase_octree.h
@@ -31,15 +31,15 @@
#ifndef BROAD_PHASE_OCTREE_H
#define BROAD_PHASE_OCTREE_H
-#include "broad_phase_sw.h"
+#include "broad_phase_3d_sw.h"
#include "core/math/octree.h"
-class BroadPhaseOctree : public BroadPhaseSW {
+class BroadPhaseOctree : public BroadPhase3DSW {
- Octree<CollisionObjectSW, true> octree;
+ Octree<CollisionObject3DSW, true> octree;
- static void *_pair_callback(void *, OctreeElementID, CollisionObjectSW *, int, OctreeElementID, CollisionObjectSW *, int);
- static void _unpair_callback(void *, OctreeElementID, CollisionObjectSW *, int, OctreeElementID, CollisionObjectSW *, int, void *);
+ static void *_pair_callback(void *, OctreeElementID, CollisionObject3DSW *, int, OctreeElementID, CollisionObject3DSW *, int);
+ static void _unpair_callback(void *, OctreeElementID, CollisionObject3DSW *, int, OctreeElementID, CollisionObject3DSW *, int, void *);
PairCallback pair_callback;
void *pair_userdata;
@@ -48,25 +48,25 @@ class BroadPhaseOctree : public BroadPhaseSW {
public:
// 0 is an invalid ID
- virtual ID create(CollisionObjectSW *p_object, int p_subindex = 0);
+ virtual ID create(CollisionObject3DSW *p_object, int p_subindex = 0);
virtual void move(ID p_id, const AABB &p_aabb);
virtual void set_static(ID p_id, bool p_static);
virtual void remove(ID p_id);
- virtual CollisionObjectSW *get_object(ID p_id) const;
+ virtual CollisionObject3DSW *get_object(ID p_id) const;
virtual bool is_static(ID p_id) const;
virtual int get_subindex(ID p_id) const;
- virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
- virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
- virtual int cull_aabb(const AABB &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL);
+ virtual int cull_point(const Vector3 &p_point, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL);
+ virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL);
+ virtual int cull_aabb(const AABB &p_aabb, CollisionObject3DSW **p_results, int p_max_results, int *p_result_indices = NULL);
virtual void set_pair_callback(PairCallback p_pair_callback, void *p_userdata);
virtual void set_unpair_callback(UnpairCallback p_unpair_callback, void *p_userdata);
virtual void update();
- static BroadPhaseSW *_create();
+ static BroadPhase3DSW *_create();
BroadPhaseOctree();
};
diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics_3d/collision_object_3d_sw.cpp
index 3cabf75ab6..34e1c0f736 100644
--- a/servers/physics/collision_object_sw.cpp
+++ b/servers/physics_3d/collision_object_3d_sw.cpp
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "collision_object_sw.h"
-#include "servers/physics/physics_server_sw.h"
-#include "space_sw.h"
+#include "collision_object_3d_sw.h"
+#include "servers/physics_3d/physics_server_3d_sw.h"
+#include "space_3d_sw.h"
-void CollisionObjectSW::add_shape(ShapeSW *p_shape, const Transform &p_transform, bool p_disabled) {
+void CollisionObject3DSW::add_shape(Shape3DSW *p_shape, const Transform &p_transform, bool p_disabled) {
Shape s;
s.shape = p_shape;
@@ -44,13 +44,13 @@ void CollisionObjectSW::add_shape(ShapeSW *p_shape, const Transform &p_transform
p_shape->add_owner(this);
if (!pending_shape_update_list.in_list()) {
- PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer3DSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
}
//_update_shapes();
//_shapes_changed();
}
-void CollisionObjectSW::set_shape(int p_index, ShapeSW *p_shape) {
+void CollisionObject3DSW::set_shape(int p_index, Shape3DSW *p_shape) {
ERR_FAIL_INDEX(p_index, shapes.size());
shapes[p_index].shape->remove_owner(this);
@@ -58,32 +58,32 @@ void CollisionObjectSW::set_shape(int p_index, ShapeSW *p_shape) {
p_shape->add_owner(this);
if (!pending_shape_update_list.in_list()) {
- PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer3DSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
}
//_update_shapes();
//_shapes_changed();
}
-void CollisionObjectSW::set_shape_transform(int p_index, const Transform &p_transform) {
+void CollisionObject3DSW::set_shape_transform(int p_index, const Transform &p_transform) {
ERR_FAIL_INDEX(p_index, shapes.size());
shapes.write[p_index].xform = p_transform;
shapes.write[p_index].xform_inv = p_transform.affine_inverse();
if (!pending_shape_update_list.in_list()) {
- PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer3DSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
}
//_update_shapes();
//_shapes_changed();
}
-void CollisionObjectSW::set_shape_as_disabled(int p_idx, bool p_enable) {
+void CollisionObject3DSW::set_shape_as_disabled(int p_idx, bool p_enable) {
shapes.write[p_idx].disabled = p_enable;
if (!pending_shape_update_list.in_list()) {
- PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer3DSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
}
}
-void CollisionObjectSW::remove_shape(ShapeSW *p_shape) {
+void CollisionObject3DSW::remove_shape(Shape3DSW *p_shape) {
//remove a shape, all the times it appears
for (int i = 0; i < shapes.size(); i++) {
@@ -95,7 +95,7 @@ void CollisionObjectSW::remove_shape(ShapeSW *p_shape) {
}
}
-void CollisionObjectSW::remove_shape(int p_index) {
+void CollisionObject3DSW::remove_shape(int p_index) {
//remove anything from shape to be erased to end, so subindices don't change
ERR_FAIL_INDEX(p_index, shapes.size());
@@ -111,13 +111,13 @@ void CollisionObjectSW::remove_shape(int p_index) {
shapes.remove(p_index);
if (!pending_shape_update_list.in_list()) {
- PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
+ PhysicsServer3DSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
}
//_update_shapes();
//_shapes_changed();
}
-void CollisionObjectSW::_set_static(bool p_static) {
+void CollisionObject3DSW::_set_static(bool p_static) {
if (_static == p_static)
return;
_static = p_static;
@@ -132,7 +132,7 @@ void CollisionObjectSW::_set_static(bool p_static) {
}
}
-void CollisionObjectSW::_unregister_shapes() {
+void CollisionObject3DSW::_unregister_shapes() {
for (int i = 0; i < shapes.size(); i++) {
@@ -144,7 +144,7 @@ void CollisionObjectSW::_unregister_shapes() {
}
}
-void CollisionObjectSW::_update_shapes() {
+void CollisionObject3DSW::_update_shapes() {
if (!space)
return;
@@ -171,7 +171,7 @@ void CollisionObjectSW::_update_shapes() {
}
}
-void CollisionObjectSW::_update_shapes_with_motion(const Vector3 &p_motion) {
+void CollisionObject3DSW::_update_shapes_with_motion(const Vector3 &p_motion) {
if (!space)
return;
@@ -195,7 +195,7 @@ void CollisionObjectSW::_update_shapes_with_motion(const Vector3 &p_motion) {
}
}
-void CollisionObjectSW::_set_space(SpaceSW *p_space) {
+void CollisionObject3DSW::_set_space(Space3DSW *p_space) {
if (space) {
@@ -220,13 +220,13 @@ void CollisionObjectSW::_set_space(SpaceSW *p_space) {
}
}
-void CollisionObjectSW::_shape_changed() {
+void CollisionObject3DSW::_shape_changed() {
_update_shapes();
_shapes_changed();
}
-CollisionObjectSW::CollisionObjectSW(Type p_type) :
+CollisionObject3DSW::CollisionObject3DSW(Type p_type) :
pending_shape_update_list(this) {
_static = true;
diff --git a/servers/physics/collision_object_sw.h b/servers/physics_3d/collision_object_3d_sw.h
index 7c0e66ff90..582d447189 100644
--- a/servers/physics/collision_object_sw.h
+++ b/servers/physics_3d/collision_object_3d_sw.h
@@ -31,10 +31,10 @@
#ifndef COLLISION_OBJECT_SW_H
#define COLLISION_OBJECT_SW_H
-#include "broad_phase_sw.h"
+#include "broad_phase_3d_sw.h"
#include "core/self_list.h"
-#include "servers/physics_server.h"
-#include "shape_sw.h"
+#include "servers/physics_server_3d.h"
+#include "shape_3d_sw.h"
#ifdef DEBUG_ENABLED
#define MAX_OBJECT_DISTANCE 3.1622776601683791e+18
@@ -42,9 +42,9 @@
#define MAX_OBJECT_DISTANCE_X2 (MAX_OBJECT_DISTANCE * MAX_OBJECT_DISTANCE)
#endif
-class SpaceSW;
+class Space3DSW;
-class CollisionObjectSW : public ShapeOwnerSW {
+class CollisionObject3DSW : public ShapeOwner3DSW {
public:
enum Type {
TYPE_AREA,
@@ -62,22 +62,22 @@ private:
Transform xform;
Transform xform_inv;
- BroadPhaseSW::ID bpid;
+ BroadPhase3DSW::ID bpid;
AABB aabb_cache; //for rayqueries
real_t area_cache;
- ShapeSW *shape;
+ Shape3DSW *shape;
bool disabled;
Shape() { disabled = false; }
};
Vector<Shape> shapes;
- SpaceSW *space;
+ Space3DSW *space;
Transform transform;
Transform inv_transform;
bool _static;
- SelfList<CollisionObjectSW> pending_shape_update_list;
+ SelfList<CollisionObject3DSW> pending_shape_update_list;
void _update_shapes();
@@ -98,11 +98,11 @@ protected:
void _set_static(bool p_static);
virtual void _shapes_changed() = 0;
- void _set_space(SpaceSW *p_space);
+ void _set_space(Space3DSW *p_space);
bool ray_pickable;
- CollisionObjectSW(Type p_type);
+ CollisionObject3DSW(Type p_type);
public:
_FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; }
@@ -114,15 +114,15 @@ public:
void _shape_changed();
_FORCE_INLINE_ Type get_type() const { return type; }
- void add_shape(ShapeSW *p_shape, const Transform &p_transform = Transform(), bool p_disabled = false);
- void set_shape(int p_index, ShapeSW *p_shape);
+ void add_shape(Shape3DSW *p_shape, const Transform &p_transform = Transform(), bool p_disabled = false);
+ void set_shape(int p_index, Shape3DSW *p_shape);
void set_shape_transform(int p_index, const Transform &p_transform);
_FORCE_INLINE_ int get_shape_count() const { return shapes.size(); }
_FORCE_INLINE_ bool is_shape_disabled(int p_index) const {
CRASH_BAD_INDEX(p_index, shapes.size());
return shapes[p_index].disabled;
}
- _FORCE_INLINE_ ShapeSW *get_shape(int p_index) const { return shapes[p_index].shape; }
+ _FORCE_INLINE_ Shape3DSW *get_shape(int p_index) const { return shapes[p_index].shape; }
_FORCE_INLINE_ const Transform &get_shape_transform(int p_index) const { return shapes[p_index].xform; }
_FORCE_INLINE_ const Transform &get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; }
_FORCE_INLINE_ const AABB &get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; }
@@ -130,7 +130,7 @@ public:
_FORCE_INLINE_ Transform get_transform() const { return transform; }
_FORCE_INLINE_ Transform get_inv_transform() const { return inv_transform; }
- _FORCE_INLINE_ SpaceSW *get_space() const { return space; }
+ _FORCE_INLINE_ Space3DSW *get_space() const { return space; }
_FORCE_INLINE_ void set_ray_pickable(bool p_enable) { ray_pickable = p_enable; }
_FORCE_INLINE_ bool is_ray_pickable() const { return ray_pickable; }
@@ -147,18 +147,18 @@ public:
_FORCE_INLINE_ void set_collision_mask(uint32_t p_mask) { collision_mask = p_mask; }
_FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; }
- _FORCE_INLINE_ bool test_collision_mask(CollisionObjectSW *p_other) const {
+ _FORCE_INLINE_ bool test_collision_mask(CollisionObject3DSW *p_other) const {
return collision_layer & p_other->collision_mask || p_other->collision_layer & collision_mask;
}
- void remove_shape(ShapeSW *p_shape);
+ void remove_shape(Shape3DSW *p_shape);
void remove_shape(int p_index);
- virtual void set_space(SpaceSW *p_space) = 0;
+ virtual void set_space(Space3DSW *p_space) = 0;
_FORCE_INLINE_ bool is_static() const { return _static; }
- virtual ~CollisionObjectSW() {}
+ virtual ~CollisionObject3DSW() {}
};
#endif // COLLISION_OBJECT_SW_H
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics_3d/collision_solver_3d_sat.cpp
index 0e0dfd3cf2..ae205ceb48 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics_3d/collision_solver_3d_sat.cpp
@@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "collision_solver_sat.h"
+#include "collision_solver_3d_sat.h"
#include "core/math/geometry.h"
#define _EDGE_IS_VALID_SUPPORT_THRESHOLD 0.02
struct _CollectorCallback {
- CollisionSolverSW::CallbackResult callback;
+ CollisionSolver3DSW::CallbackResult callback;
void *userdata;
bool swap;
bool collided;
@@ -426,15 +426,15 @@ public:
/****** SAT TESTS *******/
-typedef void (*CollisionFunc)(const ShapeSW *, const Transform &, const ShapeSW *, const Transform &, _CollectorCallback *p_callback, real_t, real_t);
+typedef void (*CollisionFunc)(const Shape3DSW *, const Transform &, const Shape3DSW *, const Transform &, _CollectorCallback *p_callback, real_t, real_t);
template <bool withMargin>
-static void _collision_sphere_sphere(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_sphere_sphere(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW *>(p_a);
- const SphereShapeSW *sphere_B = static_cast<const SphereShapeSW *>(p_b);
+ const SphereShape3DSW *sphere_A = static_cast<const SphereShape3DSW *>(p_a);
+ const SphereShape3DSW *sphere_B = static_cast<const SphereShape3DSW *>(p_b);
- SeparatorAxisTest<SphereShapeSW, SphereShapeSW, withMargin> separator(sphere_A, p_transform_a, sphere_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<SphereShape3DSW, SphereShape3DSW, withMargin> separator(sphere_A, p_transform_a, sphere_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
// previous axis
@@ -448,12 +448,12 @@ static void _collision_sphere_sphere(const ShapeSW *p_a, const Transform &p_tran
}
template <bool withMargin>
-static void _collision_sphere_box(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_sphere_box(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW *>(p_a);
- const BoxShapeSW *box_B = static_cast<const BoxShapeSW *>(p_b);
+ const SphereShape3DSW *sphere_A = static_cast<const SphereShape3DSW *>(p_a);
+ const BoxShape3DSW *box_B = static_cast<const BoxShape3DSW *>(p_b);
- SeparatorAxisTest<SphereShapeSW, BoxShapeSW, withMargin> separator(sphere_A, p_transform_a, box_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<SphereShape3DSW, BoxShape3DSW, withMargin> separator(sphere_A, p_transform_a, box_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -498,12 +498,12 @@ static void _collision_sphere_box(const ShapeSW *p_a, const Transform &p_transfo
}
template <bool withMargin>
-static void _collision_sphere_capsule(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_sphere_capsule(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW *>(p_a);
- const CapsuleShapeSW *capsule_B = static_cast<const CapsuleShapeSW *>(p_b);
+ const SphereShape3DSW *sphere_A = static_cast<const SphereShape3DSW *>(p_a);
+ const CapsuleShape3DSW *capsule_B = static_cast<const CapsuleShape3DSW *>(p_b);
- SeparatorAxisTest<SphereShapeSW, CapsuleShapeSW, withMargin> separator(sphere_A, p_transform_a, capsule_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<SphereShape3DSW, CapsuleShape3DSW, withMargin> separator(sphere_A, p_transform_a, capsule_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -537,16 +537,16 @@ static void _collision_sphere_capsule(const ShapeSW *p_a, const Transform &p_tra
}
template <bool withMargin>
-static void _collision_sphere_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_sphere_cylinder(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
}
template <bool withMargin>
-static void _collision_sphere_convex_polygon(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_sphere_convex_polygon(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW *>(p_a);
- const ConvexPolygonShapeSW *convex_polygon_B = static_cast<const ConvexPolygonShapeSW *>(p_b);
+ const SphereShape3DSW *sphere_A = static_cast<const SphereShape3DSW *>(p_a);
+ const ConvexPolygonShape3DSW *convex_polygon_B = static_cast<const ConvexPolygonShape3DSW *>(p_b);
- SeparatorAxisTest<SphereShapeSW, ConvexPolygonShapeSW, withMargin> separator(sphere_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<SphereShape3DSW, ConvexPolygonShape3DSW, withMargin> separator(sphere_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -601,12 +601,12 @@ static void _collision_sphere_convex_polygon(const ShapeSW *p_a, const Transform
}
template <bool withMargin>
-static void _collision_sphere_face(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_sphere_face(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW *>(p_a);
- const FaceShapeSW *face_B = static_cast<const FaceShapeSW *>(p_b);
+ const SphereShape3DSW *sphere_A = static_cast<const SphereShape3DSW *>(p_a);
+ const FaceShape3DSW *face_B = static_cast<const FaceShape3DSW *>(p_b);
- SeparatorAxisTest<SphereShapeSW, FaceShapeSW, withMargin> separator(sphere_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<SphereShape3DSW, FaceShape3DSW, withMargin> separator(sphere_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
Vector3 vertex[3] = {
p_transform_b.xform(face_B->vertex[0]),
@@ -639,12 +639,12 @@ static void _collision_sphere_face(const ShapeSW *p_a, const Transform &p_transf
}
template <bool withMargin>
-static void _collision_box_box(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_box_box(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const BoxShapeSW *box_A = static_cast<const BoxShapeSW *>(p_a);
- const BoxShapeSW *box_B = static_cast<const BoxShapeSW *>(p_b);
+ const BoxShape3DSW *box_A = static_cast<const BoxShape3DSW *>(p_a);
+ const BoxShape3DSW *box_B = static_cast<const BoxShape3DSW *>(p_b);
- SeparatorAxisTest<BoxShapeSW, BoxShapeSW, withMargin> separator(box_A, p_transform_a, box_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<BoxShape3DSW, BoxShape3DSW, withMargin> separator(box_A, p_transform_a, box_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -737,12 +737,12 @@ static void _collision_box_box(const ShapeSW *p_a, const Transform &p_transform_
}
template <bool withMargin>
-static void _collision_box_capsule(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_box_capsule(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const BoxShapeSW *box_A = static_cast<const BoxShapeSW *>(p_a);
- const CapsuleShapeSW *capsule_B = static_cast<const CapsuleShapeSW *>(p_b);
+ const BoxShape3DSW *box_A = static_cast<const BoxShape3DSW *>(p_a);
+ const CapsuleShape3DSW *capsule_B = static_cast<const CapsuleShape3DSW *>(p_b);
- SeparatorAxisTest<BoxShapeSW, CapsuleShapeSW, withMargin> separator(box_A, p_transform_a, capsule_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<BoxShape3DSW, CapsuleShape3DSW, withMargin> separator(box_A, p_transform_a, capsule_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -832,16 +832,16 @@ static void _collision_box_capsule(const ShapeSW *p_a, const Transform &p_transf
}
template <bool withMargin>
-static void _collision_box_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_box_cylinder(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
}
template <bool withMargin>
-static void _collision_box_convex_polygon(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_box_convex_polygon(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const BoxShapeSW *box_A = static_cast<const BoxShapeSW *>(p_a);
- const ConvexPolygonShapeSW *convex_polygon_B = static_cast<const ConvexPolygonShapeSW *>(p_b);
+ const BoxShape3DSW *box_A = static_cast<const BoxShape3DSW *>(p_a);
+ const ConvexPolygonShape3DSW *convex_polygon_B = static_cast<const ConvexPolygonShape3DSW *>(p_b);
- SeparatorAxisTest<BoxShapeSW, ConvexPolygonShapeSW, withMargin> separator(box_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<BoxShape3DSW, ConvexPolygonShape3DSW, withMargin> separator(box_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -953,12 +953,12 @@ static void _collision_box_convex_polygon(const ShapeSW *p_a, const Transform &p
}
template <bool withMargin>
-static void _collision_box_face(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_box_face(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const BoxShapeSW *box_A = static_cast<const BoxShapeSW *>(p_a);
- const FaceShapeSW *face_B = static_cast<const FaceShapeSW *>(p_b);
+ const BoxShape3DSW *box_A = static_cast<const BoxShape3DSW *>(p_a);
+ const FaceShape3DSW *face_B = static_cast<const FaceShape3DSW *>(p_b);
- SeparatorAxisTest<BoxShapeSW, FaceShapeSW, withMargin> separator(box_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<BoxShape3DSW, FaceShape3DSW, withMargin> separator(box_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
Vector3 vertex[3] = {
p_transform_b.xform(face_B->vertex[0]),
@@ -1057,12 +1057,12 @@ static void _collision_box_face(const ShapeSW *p_a, const Transform &p_transform
}
template <bool withMargin>
-static void _collision_capsule_capsule(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_capsule_capsule(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const CapsuleShapeSW *capsule_A = static_cast<const CapsuleShapeSW *>(p_a);
- const CapsuleShapeSW *capsule_B = static_cast<const CapsuleShapeSW *>(p_b);
+ const CapsuleShape3DSW *capsule_A = static_cast<const CapsuleShape3DSW *>(p_a);
+ const CapsuleShape3DSW *capsule_B = static_cast<const CapsuleShape3DSW *>(p_b);
- SeparatorAxisTest<CapsuleShapeSW, CapsuleShapeSW, withMargin> separator(capsule_A, p_transform_a, capsule_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<CapsuleShape3DSW, CapsuleShape3DSW, withMargin> separator(capsule_A, p_transform_a, capsule_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -1112,16 +1112,16 @@ static void _collision_capsule_capsule(const ShapeSW *p_a, const Transform &p_tr
}
template <bool withMargin>
-static void _collision_capsule_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_capsule_cylinder(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
}
template <bool withMargin>
-static void _collision_capsule_convex_polygon(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_capsule_convex_polygon(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const CapsuleShapeSW *capsule_A = static_cast<const CapsuleShapeSW *>(p_a);
- const ConvexPolygonShapeSW *convex_polygon_B = static_cast<const ConvexPolygonShapeSW *>(p_b);
+ const CapsuleShape3DSW *capsule_A = static_cast<const CapsuleShape3DSW *>(p_a);
+ const ConvexPolygonShape3DSW *convex_polygon_B = static_cast<const ConvexPolygonShape3DSW *>(p_b);
- SeparatorAxisTest<CapsuleShapeSW, ConvexPolygonShapeSW, withMargin> separator(capsule_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<CapsuleShape3DSW, ConvexPolygonShape3DSW, withMargin> separator(capsule_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -1181,12 +1181,12 @@ static void _collision_capsule_convex_polygon(const ShapeSW *p_a, const Transfor
}
template <bool withMargin>
-static void _collision_capsule_face(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_capsule_face(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const CapsuleShapeSW *capsule_A = static_cast<const CapsuleShapeSW *>(p_a);
- const FaceShapeSW *face_B = static_cast<const FaceShapeSW *>(p_b);
+ const CapsuleShape3DSW *capsule_A = static_cast<const CapsuleShape3DSW *>(p_a);
+ const FaceShape3DSW *face_B = static_cast<const FaceShape3DSW *>(p_b);
- SeparatorAxisTest<CapsuleShapeSW, FaceShapeSW, withMargin> separator(capsule_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<CapsuleShape3DSW, FaceShape3DSW, withMargin> separator(capsule_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
Vector3 vertex[3] = {
p_transform_b.xform(face_B->vertex[0]),
@@ -1236,24 +1236,24 @@ static void _collision_capsule_face(const ShapeSW *p_a, const Transform &p_trans
}
template <bool withMargin>
-static void _collision_cylinder_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_cylinder_cylinder(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
}
template <bool withMargin>
-static void _collision_cylinder_convex_polygon(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_cylinder_convex_polygon(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
}
template <bool withMargin>
-static void _collision_cylinder_face(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_cylinder_face(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
}
template <bool withMargin>
-static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_convex_polygon_convex_polygon(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const ConvexPolygonShapeSW *convex_polygon_A = static_cast<const ConvexPolygonShapeSW *>(p_a);
- const ConvexPolygonShapeSW *convex_polygon_B = static_cast<const ConvexPolygonShapeSW *>(p_b);
+ const ConvexPolygonShape3DSW *convex_polygon_A = static_cast<const ConvexPolygonShape3DSW *>(p_a);
+ const ConvexPolygonShape3DSW *convex_polygon_B = static_cast<const ConvexPolygonShape3DSW *>(p_b);
- SeparatorAxisTest<ConvexPolygonShapeSW, ConvexPolygonShapeSW, withMargin> separator(convex_polygon_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<ConvexPolygonShape3DSW, ConvexPolygonShape3DSW, withMargin> separator(convex_polygon_A, p_transform_a, convex_polygon_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
if (!separator.test_previous_axis())
return;
@@ -1362,12 +1362,12 @@ static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a, const T
}
template <bool withMargin>
-static void _collision_convex_polygon_face(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
+static void _collision_convex_polygon_face(const Shape3DSW *p_a, const Transform &p_transform_a, const Shape3DSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
- const ConvexPolygonShapeSW *convex_polygon_A = static_cast<const ConvexPolygonShapeSW *>(p_a);
- const FaceShapeSW *face_B = static_cast<const FaceShapeSW *>(p_b);
+ const ConvexPolygonShape3DSW *convex_polygon_A = static_cast<const ConvexPolygonShape3DSW *>(p_a);
+ const FaceShape3DSW *face_B = static_cast<const FaceShape3DSW *>(p_b);
- SeparatorAxisTest<ConvexPolygonShapeSW, FaceShapeSW, withMargin> separator(convex_polygon_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
+ SeparatorAxisTest<ConvexPolygonShape3DSW, FaceShape3DSW, withMargin> separator(convex_polygon_A, p_transform_a, face_B, p_transform_b, p_collector, p_margin_a, p_margin_b);
const Geometry::MeshData &mesh = convex_polygon_A->get_mesh();
@@ -1462,18 +1462,18 @@ static void _collision_convex_polygon_face(const ShapeSW *p_a, const Transform &
separator.generate_contacts();
}
-bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CollisionSolverSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap, Vector3 *r_prev_axis, real_t p_margin_a, real_t p_margin_b) {
+bool sat_calculate_penetration(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CollisionSolver3DSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap, Vector3 *r_prev_axis, real_t p_margin_a, real_t p_margin_b) {
- PhysicsServer::ShapeType type_A = p_shape_A->get_type();
+ PhysicsServer3D::ShapeType type_A = p_shape_A->get_type();
- ERR_FAIL_COND_V(type_A == PhysicsServer::SHAPE_PLANE, false);
- ERR_FAIL_COND_V(type_A == PhysicsServer::SHAPE_RAY, false);
+ ERR_FAIL_COND_V(type_A == PhysicsServer3D::SHAPE_PLANE, false);
+ ERR_FAIL_COND_V(type_A == PhysicsServer3D::SHAPE_RAY, false);
ERR_FAIL_COND_V(p_shape_A->is_concave(), false);
- PhysicsServer::ShapeType type_B = p_shape_B->get_type();
+ PhysicsServer3D::ShapeType type_B = p_shape_B->get_type();
- ERR_FAIL_COND_V(type_B == PhysicsServer::SHAPE_PLANE, false);
- ERR_FAIL_COND_V(type_B == PhysicsServer::SHAPE_RAY, false);
+ ERR_FAIL_COND_V(type_B == PhysicsServer3D::SHAPE_PLANE, false);
+ ERR_FAIL_COND_V(type_B == PhysicsServer3D::SHAPE_RAY, false);
ERR_FAIL_COND_V(p_shape_B->is_concave(), false);
static const CollisionFunc collision_table[6][6] = {
@@ -1561,8 +1561,8 @@ bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform &p_tran
callback.collided = false;
callback.prev_axis = r_prev_axis;
- const ShapeSW *A = p_shape_A;
- const ShapeSW *B = p_shape_B;
+ const Shape3DSW *A = p_shape_A;
+ const Shape3DSW *B = p_shape_B;
const Transform *transform_A = &p_transform_A;
const Transform *transform_B = &p_transform_B;
real_t margin_A = p_margin_a;
diff --git a/servers/physics/collision_solver_sat.h b/servers/physics_3d/collision_solver_3d_sat.h
index 31895231f0..ed564395ab 100644
--- a/servers/physics/collision_solver_sat.h
+++ b/servers/physics_3d/collision_solver_3d_sat.h
@@ -31,8 +31,8 @@
#ifndef COLLISION_SOLVER_SAT_H
#define COLLISION_SOLVER_SAT_H
-#include "collision_solver_sw.h"
+#include "collision_solver_3d_sw.h"
-bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CollisionSolverSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap = false, Vector3 *r_prev_axis = NULL, real_t p_margin_a = 0, real_t p_margin_b = 0);
+bool sat_calculate_penetration(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CollisionSolver3DSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap = false, Vector3 *r_prev_axis = NULL, real_t p_margin_a = 0, real_t p_margin_b = 0);
#endif // COLLISION_SOLVER_SAT_H
diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics_3d/collision_solver_3d_sw.cpp
index ce24ba6bca..34ea836cd0 100644
--- a/servers/physics/collision_solver_sw.cpp
+++ b/servers/physics_3d/collision_solver_3d_sw.cpp
@@ -28,18 +28,18 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "collision_solver_sw.h"
-#include "collision_solver_sat.h"
+#include "collision_solver_3d_sw.h"
+#include "collision_solver_3d_sat.h"
#include "gjk_epa.h"
#define collision_solver sat_calculate_penetration
//#define collision_solver gjk_epa_calculate_penetration
-bool CollisionSolverSW::solve_static_plane(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result) {
+bool CollisionSolver3DSW::solve_static_plane(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result) {
- const PlaneShapeSW *plane = static_cast<const PlaneShapeSW *>(p_shape_A);
- if (p_shape_B->get_type() == PhysicsServer::SHAPE_PLANE)
+ const PlaneShape3DSW *plane = static_cast<const PlaneShape3DSW *>(p_shape_A);
+ if (p_shape_B->get_type() == PhysicsServer3D::SHAPE_PLANE)
return false;
Plane p = p_transform_A.xform(plane->get_plane());
@@ -71,9 +71,9 @@ bool CollisionSolverSW::solve_static_plane(const ShapeSW *p_shape_A, const Trans
return found;
}
-bool CollisionSolverSW::solve_ray(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result) {
+bool CollisionSolver3DSW::solve_ray(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result) {
- const RayShapeSW *ray = static_cast<const RayShapeSW *>(p_shape_A);
+ const RayShape3DSW *ray = static_cast<const RayShape3DSW *>(p_shape_A);
Vector3 from = p_transform_A.origin;
Vector3 to = from + p_transform_A.basis.get_axis(2) * ray->get_length();
@@ -106,9 +106,9 @@ bool CollisionSolverSW::solve_ray(const ShapeSW *p_shape_A, const Transform &p_t
struct _ConcaveCollisionInfo {
const Transform *transform_A;
- const ShapeSW *shape_A;
+ const Shape3DSW *shape_A;
const Transform *transform_B;
- CollisionSolverSW::CallbackResult result_callback;
+ CollisionSolver3DSW::CallbackResult result_callback;
void *userdata;
bool swap_result;
bool collided;
@@ -120,7 +120,7 @@ struct _ConcaveCollisionInfo {
Vector3 close_A, close_B;
};
-void CollisionSolverSW::concave_callback(void *p_userdata, ShapeSW *p_convex) {
+void CollisionSolver3DSW::concave_callback(void *p_userdata, Shape3DSW *p_convex) {
_ConcaveCollisionInfo &cinfo = *(_ConcaveCollisionInfo *)(p_userdata);
cinfo.aabb_tests++;
@@ -133,9 +133,9 @@ void CollisionSolverSW::concave_callback(void *p_userdata, ShapeSW *p_convex) {
cinfo.collisions++;
}
-bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result, real_t p_margin_A, real_t p_margin_B) {
+bool CollisionSolver3DSW::solve_concave(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result, real_t p_margin_A, real_t p_margin_B) {
- const ConcaveShapeSW *concave_B = static_cast<const ConcaveShapeSW *>(p_shape_B);
+ const ConcaveShape3DSW *concave_B = static_cast<const ConcaveShape3DSW *>(p_shape_B);
_ConcaveCollisionInfo cinfo;
cinfo.transform_A = &p_transform_A;
@@ -179,10 +179,10 @@ bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A, const Transform
return cinfo.collided;
}
-bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, Vector3 *r_sep_axis, real_t p_margin_A, real_t p_margin_B) {
+bool CollisionSolver3DSW::solve_static(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, Vector3 *r_sep_axis, real_t p_margin_A, real_t p_margin_B) {
- PhysicsServer::ShapeType type_A = p_shape_A->get_type();
- PhysicsServer::ShapeType type_B = p_shape_B->get_type();
+ PhysicsServer3D::ShapeType type_A = p_shape_A->get_type();
+ PhysicsServer3D::ShapeType type_B = p_shape_B->get_type();
bool concave_A = p_shape_A->is_concave();
bool concave_B = p_shape_B->is_concave();
@@ -194,11 +194,11 @@ bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A, const Transform &
swap = true;
}
- if (type_A == PhysicsServer::SHAPE_PLANE) {
+ if (type_A == PhysicsServer3D::SHAPE_PLANE) {
- if (type_B == PhysicsServer::SHAPE_PLANE)
+ if (type_B == PhysicsServer3D::SHAPE_PLANE)
return false;
- if (type_B == PhysicsServer::SHAPE_RAY) {
+ if (type_B == PhysicsServer3D::SHAPE_RAY) {
return false;
}
@@ -208,9 +208,9 @@ bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A, const Transform &
return solve_static_plane(p_shape_A, p_transform_A, p_shape_B, p_transform_B, p_result_callback, p_userdata, false);
}
- } else if (type_A == PhysicsServer::SHAPE_RAY) {
+ } else if (type_A == PhysicsServer3D::SHAPE_RAY) {
- if (type_B == PhysicsServer::SHAPE_RAY)
+ if (type_B == PhysicsServer3D::SHAPE_RAY)
return false;
if (swap) {
@@ -235,7 +235,7 @@ bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A, const Transform &
}
}
-void CollisionSolverSW::concave_distance_callback(void *p_userdata, ShapeSW *p_convex) {
+void CollisionSolver3DSW::concave_distance_callback(void *p_userdata, Shape3DSW *p_convex) {
_ConcaveCollisionInfo &cinfo = *(_ConcaveCollisionInfo *)(p_userdata);
cinfo.aabb_tests++;
@@ -257,10 +257,10 @@ void CollisionSolverSW::concave_distance_callback(void *p_userdata, ShapeSW *p_c
cinfo.collisions++;
}
-bool CollisionSolverSW::solve_distance_plane(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B) {
+bool CollisionSolver3DSW::solve_distance_plane(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B) {
- const PlaneShapeSW *plane = static_cast<const PlaneShapeSW *>(p_shape_A);
- if (p_shape_B->get_type() == PhysicsServer::SHAPE_PLANE)
+ const PlaneShape3DSW *plane = static_cast<const PlaneShape3DSW *>(p_shape_A);
+ if (p_shape_B->get_type() == PhysicsServer3D::SHAPE_PLANE)
return false;
Plane p = p_transform_A.xform(plane->get_plane());
@@ -292,12 +292,12 @@ bool CollisionSolverSW::solve_distance_plane(const ShapeSW *p_shape_A, const Tra
return collided;
}
-bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B, const AABB &p_concave_hint, Vector3 *r_sep_axis) {
+bool CollisionSolver3DSW::solve_distance(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B, const AABB &p_concave_hint, Vector3 *r_sep_axis) {
if (p_shape_A->is_concave())
return false;
- if (p_shape_B->get_type() == PhysicsServer::SHAPE_PLANE) {
+ if (p_shape_B->get_type() == PhysicsServer3D::SHAPE_PLANE) {
Vector3 a, b;
bool col = solve_distance_plane(p_shape_B, p_transform_B, p_shape_A, p_transform_A, a, b);
@@ -310,7 +310,7 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A, const Transform
if (p_shape_A->is_concave())
return false;
- const ConcaveShapeSW *concave_B = static_cast<const ConcaveShapeSW *>(p_shape_B);
+ const ConcaveShape3DSW *concave_B = static_cast<const ConcaveShape3DSW *>(p_shape_B);
_ConcaveCollisionInfo cinfo;
cinfo.transform_A = &p_transform_A;
diff --git a/servers/physics/collision_solver_sw.h b/servers/physics_3d/collision_solver_3d_sw.h
index d4dc1ac2a2..5f60d94e7f 100644
--- a/servers/physics/collision_solver_sw.h
+++ b/servers/physics_3d/collision_solver_3d_sw.h
@@ -31,23 +31,23 @@
#ifndef COLLISION_SOLVER_SW_H
#define COLLISION_SOLVER_SW_H
-#include "shape_sw.h"
+#include "shape_3d_sw.h"
-class CollisionSolverSW {
+class CollisionSolver3DSW {
public:
typedef void (*CallbackResult)(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata);
private:
- static void concave_callback(void *p_userdata, ShapeSW *p_convex);
- static bool solve_static_plane(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result);
- static bool solve_ray(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result);
- static bool solve_concave(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result, real_t p_margin_A = 0, real_t p_margin_B = 0);
- static void concave_distance_callback(void *p_userdata, ShapeSW *p_convex);
- static bool solve_distance_plane(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B);
+ static void concave_callback(void *p_userdata, Shape3DSW *p_convex);
+ static bool solve_static_plane(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result);
+ static bool solve_ray(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result);
+ static bool solve_concave(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, bool p_swap_result, real_t p_margin_A = 0, real_t p_margin_B = 0);
+ static void concave_distance_callback(void *p_userdata, Shape3DSW *p_convex);
+ static bool solve_distance_plane(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B);
public:
- static bool solve_static(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, Vector3 *r_sep_axis = NULL, real_t p_margin_A = 0, real_t p_margin_B = 0);
- static bool solve_distance(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B, const AABB &p_concave_hint, Vector3 *r_sep_axis = NULL);
+ static bool solve_static(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CallbackResult p_result_callback, void *p_userdata, Vector3 *r_sep_axis = NULL, real_t p_margin_A = 0, real_t p_margin_B = 0);
+ static bool solve_distance(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_point_A, Vector3 &r_point_B, const AABB &p_concave_hint, Vector3 *r_sep_axis = NULL);
};
#endif // COLLISION_SOLVER__SW_H
diff --git a/servers/physics/constraint_sw.h b/servers/physics_3d/constraint_3d_sw.h
index 22f31b411b..23bc5d3b32 100644
--- a/servers/physics/constraint_sw.h
+++ b/servers/physics_3d/constraint_3d_sw.h
@@ -31,22 +31,22 @@
#ifndef CONSTRAINT_SW_H
#define CONSTRAINT_SW_H
-#include "body_sw.h"
+#include "body_3d_sw.h"
-class ConstraintSW {
+class Constraint3DSW {
- BodySW **_body_ptr;
+ Body3DSW **_body_ptr;
int _body_count;
uint64_t island_step;
- ConstraintSW *island_next;
- ConstraintSW *island_list_next;
+ Constraint3DSW *island_next;
+ Constraint3DSW *island_list_next;
int priority;
bool disabled_collisions_between_bodies;
RID self;
protected:
- ConstraintSW(BodySW **p_body_ptr = NULL, int p_body_count = 0) {
+ Constraint3DSW(Body3DSW **p_body_ptr = NULL, int p_body_count = 0) {
_body_ptr = p_body_ptr;
_body_count = p_body_count;
island_step = 0;
@@ -61,13 +61,13 @@ public:
_FORCE_INLINE_ uint64_t get_island_step() const { return island_step; }
_FORCE_INLINE_ void set_island_step(uint64_t p_step) { island_step = p_step; }
- _FORCE_INLINE_ ConstraintSW *get_island_next() const { return island_next; }
- _FORCE_INLINE_ void set_island_next(ConstraintSW *p_next) { island_next = p_next; }
+ _FORCE_INLINE_ Constraint3DSW *get_island_next() const { return island_next; }
+ _FORCE_INLINE_ void set_island_next(Constraint3DSW *p_next) { island_next = p_next; }
- _FORCE_INLINE_ ConstraintSW *get_island_list_next() const { return island_list_next; }
- _FORCE_INLINE_ void set_island_list_next(ConstraintSW *p_next) { island_list_next = p_next; }
+ _FORCE_INLINE_ Constraint3DSW *get_island_list_next() const { return island_list_next; }
+ _FORCE_INLINE_ void set_island_list_next(Constraint3DSW *p_next) { island_list_next = p_next; }
- _FORCE_INLINE_ BodySW **get_body_ptr() const { return _body_ptr; }
+ _FORCE_INLINE_ Body3DSW **get_body_ptr() const { return _body_ptr; }
_FORCE_INLINE_ int get_body_count() const { return _body_count; }
_FORCE_INLINE_ void set_priority(int p_priority) { priority = p_priority; }
@@ -79,7 +79,7 @@ public:
virtual bool setup(real_t p_step) = 0;
virtual void solve(real_t p_step) = 0;
- virtual ~ConstraintSW() {}
+ virtual ~Constraint3DSW() {}
};
#endif // CONSTRAINT__SW_H
diff --git a/servers/physics/gjk_epa.cpp b/servers/physics_3d/gjk_epa.cpp
index abf0c0dc15..bd0d429e7b 100644
--- a/servers/physics/gjk_epa.cpp
+++ b/servers/physics_3d/gjk_epa.cpp
@@ -103,7 +103,7 @@ typedef unsigned char U1;
// MinkowskiDiff
struct MinkowskiDiff {
- const ShapeSW* m_shapes[2];
+ const Shape3DSW* m_shapes[2];
Transform transform_A;
Transform transform_B;
@@ -783,8 +783,8 @@ struct GJK
};
//
- static void Initialize( const ShapeSW* shape0,const Transform& wtrs0,
- const ShapeSW* shape1,const Transform& wtrs1,
+ static void Initialize( const Shape3DSW* shape0,const Transform& wtrs0,
+ const Shape3DSW* shape1,const Transform& wtrs1,
sResults& results,
tShape& shape,
bool withmargins)
@@ -810,9 +810,9 @@ struct GJK
//
//
-bool Distance( const ShapeSW* shape0,
+bool Distance( const Shape3DSW* shape0,
const Transform& wtrs0,
- const ShapeSW* shape1,
+ const Shape3DSW* shape1,
const Transform& wtrs1,
const Vector3& guess,
sResults& results)
@@ -848,9 +848,9 @@ bool Distance( const ShapeSW* shape0,
}
//
-bool Penetration( const ShapeSW* shape0,
+bool Penetration( const Shape3DSW* shape0,
const Transform& wtrs0,
- const ShapeSW* shape1,
+ const Shape3DSW* shape1,
const Transform& wtrs1,
const Vector3& guess,
sResults& results
@@ -914,7 +914,7 @@ bool Penetration( const ShapeSW* shape0,
/* clang-format on */
-bool gjk_epa_calculate_distance(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B) {
+bool gjk_epa_calculate_distance(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B) {
GjkEpa2::sResults res;
@@ -928,7 +928,7 @@ bool gjk_epa_calculate_distance(const ShapeSW *p_shape_A, const Transform &p_tra
return false;
}
-bool gjk_epa_calculate_penetration(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CollisionSolverSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap) {
+bool gjk_epa_calculate_penetration(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CollisionSolver3DSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap) {
GjkEpa2::sResults res;
diff --git a/servers/physics/gjk_epa.h b/servers/physics_3d/gjk_epa.h
index 38c616cde0..dec0f269e1 100644
--- a/servers/physics/gjk_epa.h
+++ b/servers/physics_3d/gjk_epa.h
@@ -31,10 +31,10 @@
#ifndef GJK_EPA_H
#define GJK_EPA_H
-#include "collision_solver_sw.h"
-#include "shape_sw.h"
+#include "collision_solver_3d_sw.h"
+#include "shape_3d_sw.h"
-bool gjk_epa_calculate_penetration(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CollisionSolverSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap = false);
-bool gjk_epa_calculate_distance(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B);
+bool gjk_epa_calculate_penetration(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, CollisionSolver3DSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap = false);
+bool gjk_epa_calculate_distance(const Shape3DSW *p_shape_A, const Transform &p_transform_A, const Shape3DSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B);
#endif
diff --git a/servers/physics/joints/SCsub b/servers/physics_3d/joints/SCsub
index d730144861..d730144861 100644
--- a/servers/physics/joints/SCsub
+++ b/servers/physics_3d/joints/SCsub
diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp
index 58f66f7ea2..782e8322fe 100644
--- a/servers/physics/joints/cone_twist_joint_sw.cpp
+++ b/servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp
@@ -49,7 +49,7 @@ subject to the following restrictions:
Written by: Marcus Hennix
*/
-#include "cone_twist_joint_sw.h"
+#include "cone_twist_joint_3d_sw.h"
static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) {
@@ -85,8 +85,8 @@ static _FORCE_INLINE_ real_t atan2fast(real_t y, real_t x) {
return (y < 0.0f) ? -angle : angle;
}
-ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame) :
- JointSW(_arr, 2) {
+ConeTwistJoint3DSW::ConeTwistJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &rbAFrame, const Transform &rbBFrame) :
+ Joint3DSW(_arr, 2) {
A = rbA;
B = rbB;
@@ -110,7 +110,7 @@ ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rb
m_appliedImpulse = 0;
}
-bool ConeTwistJointSW::setup(real_t p_timestep) {
+bool ConeTwistJoint3DSW::setup(real_t p_timestep) {
m_appliedImpulse = real_t(0.);
//set bias, sign, clear accumulator
@@ -136,7 +136,7 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
plane_space(normal[0], normal[1], normal[2]);
for (int i = 0; i < 3; i++) {
- memnew_placement(&m_jac[i], JacobianEntrySW(
+ memnew_placement(&m_jac[i], JacobianEntry3DSW(
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
@@ -237,7 +237,7 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
return true;
}
-void ConeTwistJointSW::solve(real_t p_timestep) {
+void ConeTwistJoint3DSW::solve(real_t p_timestep) {
Vector3 pivotAInW = A->get_transform().xform(m_rbAFrame.origin);
Vector3 pivotBInW = B->get_transform().xform(m_rbBFrame.origin);
@@ -308,58 +308,58 @@ void ConeTwistJointSW::solve(real_t p_timestep) {
}
}
-void ConeTwistJointSW::set_param(PhysicsServer::ConeTwistJointParam p_param, real_t p_value) {
+void ConeTwistJoint3DSW::set_param(PhysicsServer3D::ConeTwistJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN: {
m_swingSpan1 = p_value;
m_swingSpan2 = p_value;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN: {
m_twistSpan = p_value;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_BIAS: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_BIAS: {
m_biasFactor = p_value;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_SOFTNESS: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS: {
m_limitSoftness = p_value;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION: {
m_relaxationFactor = p_value;
} break;
- case PhysicsServer::CONE_TWIST_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::CONE_TWIST_MAX: break; // Can't happen, but silences warning
}
}
-real_t ConeTwistJointSW::get_param(PhysicsServer::ConeTwistJointParam p_param) const {
+real_t ConeTwistJoint3DSW::get_param(PhysicsServer3D::ConeTwistJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN: {
return m_swingSpan1;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN: {
return m_twistSpan;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_BIAS: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_BIAS: {
return m_biasFactor;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_SOFTNESS: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS: {
return m_limitSoftness;
} break;
- case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: {
+ case PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION: {
return m_relaxationFactor;
} break;
- case PhysicsServer::CONE_TWIST_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::CONE_TWIST_MAX: break; // Can't happen, but silences warning
}
return 0;
diff --git a/servers/physics/joints/cone_twist_joint_sw.h b/servers/physics_3d/joints/cone_twist_joint_3d_sw.h
index 857aaa0d86..5521419e89 100644
--- a/servers/physics/joints/cone_twist_joint_sw.h
+++ b/servers/physics_3d/joints/cone_twist_joint_3d_sw.h
@@ -52,25 +52,25 @@ Written by: Marcus Hennix
#ifndef CONE_TWIST_JOINT_SW_H
#define CONE_TWIST_JOINT_SW_H
-#include "servers/physics/joints/jacobian_entry_sw.h"
-#include "servers/physics/joints_sw.h"
+#include "servers/physics_3d/joints/jacobian_entry_3d_sw.h"
+#include "servers/physics_3d/joints_3d_sw.h"
///ConeTwistJointSW can be used to simulate ragdoll joints (upper arm, leg etc)
-class ConeTwistJointSW : public JointSW {
+class ConeTwistJoint3DSW : public Joint3DSW {
#ifdef IN_PARALLELL_SOLVER
public:
#endif
union {
struct {
- BodySW *A;
- BodySW *B;
+ Body3DSW *A;
+ Body3DSW *B;
};
- BodySW *_arr[2];
+ Body3DSW *_arr[2];
};
- JacobianEntrySW m_jac[3]; //3 orthogonal linear constraints
+ JacobianEntry3DSW m_jac[3]; //3 orthogonal linear constraints
real_t m_appliedImpulse;
Transform m_rbAFrame;
@@ -102,12 +102,12 @@ public:
bool m_solveSwingLimit;
public:
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_CONE_TWIST; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_CONE_TWIST; }
virtual bool setup(real_t p_timestep);
virtual void solve(real_t p_timestep);
- ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame);
+ ConeTwistJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &rbAFrame, const Transform &rbBFrame);
void setAngularOnly(bool angularOnly) {
m_angularOnly = angularOnly;
@@ -135,8 +135,8 @@ public:
return m_twistLimitSign;
}
- void set_param(PhysicsServer::ConeTwistJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::ConeTwistJointParam p_param) const;
+ void set_param(PhysicsServer3D::ConeTwistJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::ConeTwistJointParam p_param) const;
};
#endif // CONE_TWIST_JOINT_SW_H
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp
index 8f0ccab7f7..d28fafdb00 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.cpp
+++ b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp
@@ -54,13 +54,13 @@ email: projectileman@yahoo.com
http://gimpact.sf.net
*/
-#include "generic_6dof_joint_sw.h"
+#include "generic_6dof_joint_3d_sw.h"
#define GENERIC_D6_DISABLE_WARMSTARTING 1
//////////////////////////// G6DOFRotationalLimitMotorSW ////////////////////////////////////
-int G6DOFRotationalLimitMotorSW::testLimitValue(real_t test_value) {
+int G6DOFRotationalLimitMotor3DSW::testLimitValue(real_t test_value) {
if (m_loLimit > m_hiLimit) {
m_currentLimit = 0; //Free from violation
return 0;
@@ -80,9 +80,9 @@ int G6DOFRotationalLimitMotorSW::testLimitValue(real_t test_value) {
return 0;
}
-real_t G6DOFRotationalLimitMotorSW::solveAngularLimits(
+real_t G6DOFRotationalLimitMotor3DSW::solveAngularLimits(
real_t timeStep, Vector3 &axis, real_t jacDiagABInv,
- BodySW *body0, BodySW *body1) {
+ Body3DSW *body0, Body3DSW *body1) {
if (!needApplyTorques()) return 0.0f;
real_t target_velocity = m_targetVelocity;
@@ -145,11 +145,11 @@ real_t G6DOFRotationalLimitMotorSW::solveAngularLimits(
//////////////////////////// End G6DOFRotationalLimitMotorSW ////////////////////////////////////
//////////////////////////// G6DOFTranslationalLimitMotorSW ////////////////////////////////////
-real_t G6DOFTranslationalLimitMotorSW::solveLinearAxis(
+real_t G6DOFTranslationalLimitMotor3DSW::solveLinearAxis(
real_t timeStep,
real_t jacDiagABInv,
- BodySW *body1, const Vector3 &pointInA,
- BodySW *body2, const Vector3 &pointInB,
+ Body3DSW *body1, const Vector3 &pointInA,
+ Body3DSW *body2, const Vector3 &pointInB,
int limit_index,
const Vector3 &axis_normal_on_a,
const Vector3 &anchorPos) {
@@ -209,8 +209,8 @@ real_t G6DOFTranslationalLimitMotorSW::solveLinearAxis(
//////////////////////////// G6DOFTranslationalLimitMotorSW ////////////////////////////////////
-Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) :
- JointSW(_arr, 2),
+Generic6DOFJoint3DSW::Generic6DOFJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) :
+ Joint3DSW(_arr, 2),
m_frameInA(frameInA),
m_frameInB(frameInB),
m_useLinearReferenceFrameA(useLinearReferenceFrameA) {
@@ -220,7 +220,7 @@ Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform
B->add_constraint(this, 1);
}
-void Generic6DOFJointSW::calculateAngleInfo() {
+void Generic6DOFJoint3DSW::calculateAngleInfo() {
Basis relative_frame = m_calculatedTransformB.basis.inverse() * m_calculatedTransformA.basis;
m_calculatedAxisAngleDiff = relative_frame.get_euler_xyz();
@@ -261,17 +261,17 @@ void Generic6DOFJointSW::calculateAngleInfo() {
*/
}
-void Generic6DOFJointSW::calculateTransforms() {
+void Generic6DOFJoint3DSW::calculateTransforms() {
m_calculatedTransformA = A->get_transform() * m_frameInA;
m_calculatedTransformB = B->get_transform() * m_frameInB;
calculateAngleInfo();
}
-void Generic6DOFJointSW::buildLinearJacobian(
- JacobianEntrySW &jacLinear, const Vector3 &normalWorld,
+void Generic6DOFJoint3DSW::buildLinearJacobian(
+ JacobianEntry3DSW &jacLinear, const Vector3 &normalWorld,
const Vector3 &pivotAInW, const Vector3 &pivotBInW) {
- memnew_placement(&jacLinear, JacobianEntrySW(
+ memnew_placement(&jacLinear, JacobianEntry3DSW(
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
@@ -283,16 +283,16 @@ void Generic6DOFJointSW::buildLinearJacobian(
B->get_inv_mass()));
}
-void Generic6DOFJointSW::buildAngularJacobian(
- JacobianEntrySW &jacAngular, const Vector3 &jointAxisW) {
- memnew_placement(&jacAngular, JacobianEntrySW(jointAxisW,
+void Generic6DOFJoint3DSW::buildAngularJacobian(
+ JacobianEntry3DSW &jacAngular, const Vector3 &jointAxisW) {
+ memnew_placement(&jacAngular, JacobianEntry3DSW(jointAxisW,
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
A->get_inv_inertia(),
B->get_inv_inertia()));
}
-bool Generic6DOFJointSW::testAngularLimitMotor(int axis_index) {
+bool Generic6DOFJoint3DSW::testAngularLimitMotor(int axis_index) {
real_t angle = m_calculatedAxisAngleDiff[axis_index];
//test limits
@@ -300,7 +300,7 @@ bool Generic6DOFJointSW::testAngularLimitMotor(int axis_index) {
return m_angularLimits[axis_index].needApplyTorques();
}
-bool Generic6DOFJointSW::setup(real_t p_timestep) {
+bool Generic6DOFJoint3DSW::setup(real_t p_timestep) {
// Clear accumulated impulses for the next simulation step
m_linearLimits.m_accumulatedImpulse = Vector3(real_t(0.), real_t(0.), real_t(0.));
@@ -349,7 +349,7 @@ bool Generic6DOFJointSW::setup(real_t p_timestep) {
return true;
}
-void Generic6DOFJointSW::solve(real_t p_timestep) {
+void Generic6DOFJoint3DSW::solve(real_t p_timestep) {
m_timeStep = p_timestep;
//calculateTransforms();
@@ -397,19 +397,19 @@ void Generic6DOFJointSW::solve(real_t p_timestep) {
}
}
-void Generic6DOFJointSW::updateRHS(real_t timeStep) {
+void Generic6DOFJoint3DSW::updateRHS(real_t timeStep) {
(void)timeStep;
}
-Vector3 Generic6DOFJointSW::getAxis(int axis_index) const {
+Vector3 Generic6DOFJoint3DSW::getAxis(int axis_index) const {
return m_calculatedAxis[axis_index];
}
-real_t Generic6DOFJointSW::getAngle(int axis_index) const {
+real_t Generic6DOFJoint3DSW::getAngle(int axis_index) const {
return m_calculatedAxisAngleDiff[axis_index];
}
-void Generic6DOFJointSW::calcAnchorPos(void) {
+void Generic6DOFJoint3DSW::calcAnchorPos(void) {
real_t imA = A->get_inv_mass();
real_t imB = B->get_inv_mass();
real_t weight;
@@ -423,263 +423,263 @@ void Generic6DOFJointSW::calcAnchorPos(void) {
m_AnchorPos = pA * weight + pB * (real_t(1.0) - weight);
} // Generic6DOFJointSW::calcAnchorPos()
-void Generic6DOFJointSW::set_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value) {
+void Generic6DOFJoint3DSW::set_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value) {
ERR_FAIL_INDEX(p_axis, 3);
switch (p_param) {
- case PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT: {
m_linearLimits.m_lowerLimit[p_axis] = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT: {
m_linearLimits.m_upperLimit[p_axis] = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: {
m_linearLimits.m_limitSoftness[p_axis] = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION: {
m_linearLimits.m_restitution[p_axis] = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING: {
m_linearLimits.m_damping[p_axis] = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT: {
m_angularLimits[p_axis].m_loLimit = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT: {
m_angularLimits[p_axis].m_hiLimit = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: {
m_angularLimits[p_axis].m_limitSoftness = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING: {
m_angularLimits[p_axis].m_damping = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION: {
m_angularLimits[p_axis].m_bounce = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_FORCE_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_FORCE_LIMIT: {
m_angularLimits[p_axis].m_maxLimitForce = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_ERP: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP: {
m_angularLimits[p_axis].m_ERP = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY: {
m_angularLimits[p_axis].m_targetVelocity = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT: {
m_angularLimits[p_axis].m_maxLimitForce = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::G6DOF_JOINT_MAX: break; // Can't happen, but silences warning
}
}
-real_t Generic6DOFJointSW::get_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param) const {
+real_t Generic6DOFJoint3DSW::get_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const {
ERR_FAIL_INDEX_V(p_axis, 3, 0);
switch (p_param) {
- case PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT: {
return m_linearLimits.m_lowerLimit[p_axis];
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT: {
return m_linearLimits.m_upperLimit[p_axis];
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: {
return m_linearLimits.m_limitSoftness[p_axis];
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION: {
return m_linearLimits.m_restitution[p_axis];
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING: {
return m_linearLimits.m_damping[p_axis];
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT: {
return m_angularLimits[p_axis].m_loLimit;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT: {
return m_angularLimits[p_axis].m_hiLimit;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: {
return m_angularLimits[p_axis].m_limitSoftness;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING: {
return m_angularLimits[p_axis].m_damping;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION: {
return m_angularLimits[p_axis].m_bounce;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_FORCE_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_FORCE_LIMIT: {
return m_angularLimits[p_axis].m_maxLimitForce;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_ERP: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP: {
return m_angularLimits[p_axis].m_ERP;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY: {
return m_angularLimits[p_axis].m_targetVelocity;
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT: {
return m_angularLimits[p_axis].m_maxMotorForce;
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT: {
+ case PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_DAMPING: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: {
+ case PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::G6DOF_JOINT_MAX: break; // Can't happen, but silences warning
}
return 0;
}
-void Generic6DOFJointSW::set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag, bool p_value) {
+void Generic6DOFJoint3DSW::set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value) {
ERR_FAIL_INDEX(p_axis, 3);
switch (p_flag) {
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT: {
m_linearLimits.enable_limit[p_axis] = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: {
m_angularLimits[p_axis].m_enableLimit = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR: {
m_angularLimits[p_axis].m_enableMotor = p_value;
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
}
}
-bool Generic6DOFJointSW::get_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag) const {
+bool Generic6DOFJoint3DSW::get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const {
ERR_FAIL_INDEX_V(p_axis, 3, 0);
switch (p_flag) {
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT: {
return m_linearLimits.enable_limit[p_axis];
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: {
return m_angularLimits[p_axis].m_enableLimit;
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR: {
return m_angularLimits[p_axis].m_enableMotor;
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: {
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: {
// Not implemented in GodotPhysics backend
} break;
- case PhysicsServer::G6DOF_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::G6DOF_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
}
return 0;
diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.h
index 07626ffa97..ba6e6ffb01 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.h
+++ b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.h
@@ -35,8 +35,8 @@ Adapted to Godot from the Bullet library.
#ifndef GENERIC_6DOF_JOINT_SW_H
#define GENERIC_6DOF_JOINT_SW_H
-#include "servers/physics/joints/jacobian_entry_sw.h"
-#include "servers/physics/joints_sw.h"
+#include "servers/physics_3d/joints/jacobian_entry_3d_sw.h"
+#include "servers/physics_3d/joints_3d_sw.h"
/*
Bullet Continuous Collision Detection and Physics Library
@@ -61,7 +61,7 @@ http://gimpact.sf.net
*/
//! Rotation Limit structure for generic joints
-class G6DOFRotationalLimitMotorSW {
+class G6DOFRotationalLimitMotor3DSW {
public:
//! limit_parameters
//!@{
@@ -86,7 +86,7 @@ public:
real_t m_accumulatedImpulse;
//!@}
- G6DOFRotationalLimitMotorSW() {
+ G6DOFRotationalLimitMotor3DSW() {
m_accumulatedImpulse = 0.f;
m_targetVelocity = 0;
m_maxMotorForce = 0.1f;
@@ -103,7 +103,7 @@ public:
m_enableLimit = false;
}
- G6DOFRotationalLimitMotorSW(const G6DOFRotationalLimitMotorSW &limot) {
+ G6DOFRotationalLimitMotor3DSW(const G6DOFRotationalLimitMotor3DSW &limot) {
m_targetVelocity = limot.m_targetVelocity;
m_maxMotorForce = limot.m_maxMotorForce;
m_limitSoftness = limot.m_limitSoftness;
@@ -133,10 +133,10 @@ public:
int testLimitValue(real_t test_value);
//! apply the correction impulses for two bodies
- real_t solveAngularLimits(real_t timeStep, Vector3 &axis, real_t jacDiagABInv, BodySW *body0, BodySW *body1);
+ real_t solveAngularLimits(real_t timeStep, Vector3 &axis, real_t jacDiagABInv, Body3DSW *body0, Body3DSW *body1);
};
-class G6DOFTranslationalLimitMotorSW {
+class G6DOFTranslationalLimitMotor3DSW {
public:
Vector3 m_lowerLimit; //!< the constraint lower limits
Vector3 m_upperLimit; //!< the constraint upper limits
@@ -149,7 +149,7 @@ public:
//!@}
bool enable_limit[3];
- G6DOFTranslationalLimitMotorSW() {
+ G6DOFTranslationalLimitMotor3DSW() {
m_lowerLimit = Vector3(0.f, 0.f, 0.f);
m_upperLimit = Vector3(0.f, 0.f, 0.f);
m_accumulatedImpulse = Vector3(0.f, 0.f, 0.f);
@@ -163,7 +163,7 @@ public:
enable_limit[2] = true;
}
- G6DOFTranslationalLimitMotorSW(const G6DOFTranslationalLimitMotorSW &other) {
+ G6DOFTranslationalLimitMotor3DSW(const G6DOFTranslationalLimitMotor3DSW &other) {
m_lowerLimit = other.m_lowerLimit;
m_upperLimit = other.m_upperLimit;
m_accumulatedImpulse = other.m_accumulatedImpulse;
@@ -187,22 +187,22 @@ public:
real_t solveLinearAxis(
real_t timeStep,
real_t jacDiagABInv,
- BodySW *body1, const Vector3 &pointInA,
- BodySW *body2, const Vector3 &pointInB,
+ Body3DSW *body1, const Vector3 &pointInA,
+ Body3DSW *body2, const Vector3 &pointInB,
int limit_index,
const Vector3 &axis_normal_on_a,
const Vector3 &anchorPos);
};
-class Generic6DOFJointSW : public JointSW {
+class Generic6DOFJoint3DSW : public Joint3DSW {
protected:
union {
struct {
- BodySW *A;
- BodySW *B;
+ Body3DSW *A;
+ Body3DSW *B;
};
- BodySW *_arr[2];
+ Body3DSW *_arr[2];
};
//! relative_frames
@@ -213,18 +213,18 @@ protected:
//! Jacobians
//!@{
- JacobianEntrySW m_jacLinear[3]; //!< 3 orthogonal linear constraints
- JacobianEntrySW m_jacAng[3]; //!< 3 orthogonal angular constraints
+ JacobianEntry3DSW m_jacLinear[3]; //!< 3 orthogonal linear constraints
+ JacobianEntry3DSW m_jacAng[3]; //!< 3 orthogonal angular constraints
//!@}
//! Linear_Limit_parameters
//!@{
- G6DOFTranslationalLimitMotorSW m_linearLimits;
+ G6DOFTranslationalLimitMotor3DSW m_linearLimits;
//!@}
//! hinge_parameters
//!@{
- G6DOFRotationalLimitMotorSW m_angularLimits[3];
+ G6DOFRotationalLimitMotor3DSW m_angularLimits[3];
//!@}
protected:
@@ -242,25 +242,25 @@ protected:
//!@}
- Generic6DOFJointSW &operator=(Generic6DOFJointSW &other) {
+ Generic6DOFJoint3DSW &operator=(Generic6DOFJoint3DSW &other) {
ERR_PRINT("pito");
(void)other;
return *this;
}
void buildLinearJacobian(
- JacobianEntrySW &jacLinear, const Vector3 &normalWorld,
+ JacobianEntry3DSW &jacLinear, const Vector3 &normalWorld,
const Vector3 &pivotAInW, const Vector3 &pivotBInW);
- void buildAngularJacobian(JacobianEntrySW &jacAngular, const Vector3 &jointAxisW);
+ void buildAngularJacobian(JacobianEntry3DSW &jacAngular, const Vector3 &jointAxisW);
//! calcs the euler angles between the two bodies.
void calculateAngleInfo();
public:
- Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA);
+ Generic6DOFJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA);
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_6DOF; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_6DOF; }
virtual bool setup(real_t p_timestep);
virtual void solve(real_t p_timestep);
@@ -348,12 +348,12 @@ public:
}
//! Retrieves the angular limit informacion
- G6DOFRotationalLimitMotorSW *getRotationalLimitMotor(int index) {
+ G6DOFRotationalLimitMotor3DSW *getRotationalLimitMotor(int index) {
return &m_angularLimits[index];
}
//! Retrieves the limit informacion
- G6DOFTranslationalLimitMotorSW *getTranslationalLimitMotor() {
+ G6DOFTranslationalLimitMotor3DSW *getTranslationalLimitMotor() {
return &m_linearLimits;
}
@@ -382,20 +382,20 @@ public:
return m_angularLimits[limitIndex - 3].isLimited();
}
- const BodySW *getRigidBodyA() const {
+ const Body3DSW *getRigidBodyA() const {
return A;
}
- const BodySW *getRigidBodyB() const {
+ const Body3DSW *getRigidBodyB() const {
return B;
}
virtual void calcAnchorPos(void); // overridable
- void set_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value);
- real_t get_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param) const;
+ void set_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value);
+ real_t get_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const;
- void set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag, bool p_value);
- bool get_flag(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisFlag p_flag) const;
+ void set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value);
+ bool get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const;
};
#endif // GENERIC_6DOF_JOINT_SW_H
diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics_3d/joints/hinge_joint_3d_sw.cpp
index 1ad3e738ba..57605aac7b 100644
--- a/servers/physics/joints/hinge_joint_sw.cpp
+++ b/servers/physics_3d/joints/hinge_joint_3d_sw.cpp
@@ -47,7 +47,7 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
-#include "hinge_joint_sw.h"
+#include "hinge_joint_3d_sw.h"
static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) {
@@ -68,8 +68,8 @@ static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) {
}
}
-HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, const Transform &frameB) :
- JointSW(_arr, 2) {
+HingeJoint3DSW::HingeJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &frameA, const Transform &frameB) :
+ Joint3DSW(_arr, 2) {
A = rbA;
B = rbB;
@@ -100,9 +100,9 @@ HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, co
B->add_constraint(this, 1);
}
-HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB,
+HingeJoint3DSW::HingeJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB,
const Vector3 &axisInA, const Vector3 &axisInB) :
- JointSW(_arr, 2) {
+ Joint3DSW(_arr, 2) {
A = rbA;
B = rbB;
@@ -157,7 +157,7 @@ HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Vector3 &pivotInA, co
B->add_constraint(this, 1);
}
-bool HingeJointSW::setup(real_t p_step) {
+bool HingeJoint3DSW::setup(real_t p_step) {
m_appliedImpulse = real_t(0.);
@@ -176,7 +176,7 @@ bool HingeJointSW::setup(real_t p_step) {
plane_space(normal[0], normal[1], normal[2]);
for (int i = 0; i < 3; i++) {
- memnew_placement(&m_jac[i], JacobianEntrySW(
+ memnew_placement(&m_jac[i], JacobianEntry3DSW(
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
@@ -202,19 +202,19 @@ bool HingeJointSW::setup(real_t p_step) {
Vector3 jointAxis1 = A->get_transform().basis.xform(jointAxis1local);
Vector3 hingeAxisWorld = A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(2));
- memnew_placement(&m_jacAng[0], JacobianEntrySW(jointAxis0,
+ memnew_placement(&m_jacAng[0], JacobianEntry3DSW(jointAxis0,
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
A->get_inv_inertia(),
B->get_inv_inertia()));
- memnew_placement(&m_jacAng[1], JacobianEntrySW(jointAxis1,
+ memnew_placement(&m_jacAng[1], JacobianEntry3DSW(jointAxis1,
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
A->get_inv_inertia(),
B->get_inv_inertia()));
- memnew_placement(&m_jacAng[2], JacobianEntrySW(hingeAxisWorld,
+ memnew_placement(&m_jacAng[2], JacobianEntry3DSW(hingeAxisWorld,
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
A->get_inv_inertia(),
@@ -253,7 +253,7 @@ bool HingeJointSW::setup(real_t p_step) {
return true;
}
-void HingeJointSW::solve(real_t p_step) {
+void HingeJoint3DSW::solve(real_t p_step) {
Vector3 pivotAInW = A->get_transform().xform(m_rbAFrame.origin);
Vector3 pivotBInW = B->get_transform().xform(m_rbBFrame.origin);
@@ -388,7 +388,7 @@ static _FORCE_INLINE_ real_t atan2fast(real_t y, real_t x) {
return (y < 0.0f) ? -angle : angle;
}
-real_t HingeJointSW::get_hinge_angle() {
+real_t HingeJoint3DSW::get_hinge_angle() {
const Vector3 refAxis0 = A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(0));
const Vector3 refAxis1 = A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(1));
const Vector3 swingAxis = B->get_transform().basis.xform(m_rbBFrame.basis.get_axis(1));
@@ -396,54 +396,54 @@ real_t HingeJointSW::get_hinge_angle() {
return atan2fast(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
}
-void HingeJointSW::set_param(PhysicsServer::HingeJointParam p_param, real_t p_value) {
+void HingeJoint3DSW::set_param(PhysicsServer3D::HingeJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::HINGE_JOINT_BIAS: tau = p_value; break;
- case PhysicsServer::HINGE_JOINT_LIMIT_UPPER: m_upperLimit = p_value; break;
- case PhysicsServer::HINGE_JOINT_LIMIT_LOWER: m_lowerLimit = p_value; break;
- case PhysicsServer::HINGE_JOINT_LIMIT_BIAS: m_biasFactor = p_value; break;
- case PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS: m_limitSoftness = p_value; break;
- case PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION: m_relaxationFactor = p_value; break;
- case PhysicsServer::HINGE_JOINT_MOTOR_TARGET_VELOCITY: m_motorTargetVelocity = p_value; break;
- case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: m_maxMotorImpulse = p_value; break;
- case PhysicsServer::HINGE_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::HINGE_JOINT_BIAS: tau = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER: m_upperLimit = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER: m_lowerLimit = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS: m_biasFactor = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS: m_limitSoftness = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION: m_relaxationFactor = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_TARGET_VELOCITY: m_motorTargetVelocity = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_MAX_IMPULSE: m_maxMotorImpulse = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_MAX: break; // Can't happen, but silences warning
}
}
-real_t HingeJointSW::get_param(PhysicsServer::HingeJointParam p_param) const {
+real_t HingeJoint3DSW::get_param(PhysicsServer3D::HingeJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::HINGE_JOINT_BIAS: return tau;
- case PhysicsServer::HINGE_JOINT_LIMIT_UPPER: return m_upperLimit;
- case PhysicsServer::HINGE_JOINT_LIMIT_LOWER: return m_lowerLimit;
- case PhysicsServer::HINGE_JOINT_LIMIT_BIAS: return m_biasFactor;
- case PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS: return m_limitSoftness;
- case PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION: return m_relaxationFactor;
- case PhysicsServer::HINGE_JOINT_MOTOR_TARGET_VELOCITY: return m_motorTargetVelocity;
- case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: return m_maxMotorImpulse;
- case PhysicsServer::HINGE_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::HINGE_JOINT_BIAS: return tau;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER: return m_upperLimit;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER: return m_lowerLimit;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS: return m_biasFactor;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS: return m_limitSoftness;
+ case PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION: return m_relaxationFactor;
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_TARGET_VELOCITY: return m_motorTargetVelocity;
+ case PhysicsServer3D::HINGE_JOINT_MOTOR_MAX_IMPULSE: return m_maxMotorImpulse;
+ case PhysicsServer3D::HINGE_JOINT_MAX: break; // Can't happen, but silences warning
}
return 0;
}
-void HingeJointSW::set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value) {
+void HingeJoint3DSW::set_flag(PhysicsServer3D::HingeJointFlag p_flag, bool p_value) {
switch (p_flag) {
- case PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT: m_useLimit = p_value; break;
- case PhysicsServer::HINGE_JOINT_FLAG_ENABLE_MOTOR: m_enableAngularMotor = p_value; break;
- case PhysicsServer::HINGE_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT: m_useLimit = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_FLAG_ENABLE_MOTOR: m_enableAngularMotor = p_value; break;
+ case PhysicsServer3D::HINGE_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
}
}
-bool HingeJointSW::get_flag(PhysicsServer::HingeJointFlag p_flag) const {
+bool HingeJoint3DSW::get_flag(PhysicsServer3D::HingeJointFlag p_flag) const {
switch (p_flag) {
- case PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT: return m_useLimit;
- case PhysicsServer::HINGE_JOINT_FLAG_ENABLE_MOTOR: return m_enableAngularMotor;
- case PhysicsServer::HINGE_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT: return m_useLimit;
+ case PhysicsServer3D::HINGE_JOINT_FLAG_ENABLE_MOTOR: return m_enableAngularMotor;
+ case PhysicsServer3D::HINGE_JOINT_FLAG_MAX: break; // Can't happen, but silences warning
}
return false;
diff --git a/servers/physics/joints/hinge_joint_sw.h b/servers/physics_3d/joints/hinge_joint_3d_sw.h
index 1c160cfc09..8da32885bc 100644
--- a/servers/physics/joints/hinge_joint_sw.h
+++ b/servers/physics_3d/joints/hinge_joint_3d_sw.h
@@ -35,8 +35,8 @@ Adapted to Godot from the Bullet library.
#ifndef HINGE_JOINT_SW_H
#define HINGE_JOINT_SW_H
-#include "servers/physics/joints/jacobian_entry_sw.h"
-#include "servers/physics/joints_sw.h"
+#include "servers/physics_3d/joints/jacobian_entry_3d_sw.h"
+#include "servers/physics_3d/joints_3d_sw.h"
/*
Bullet Continuous Collision Detection and Physics Library
@@ -53,19 +53,19 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
-class HingeJointSW : public JointSW {
+class HingeJoint3DSW : public Joint3DSW {
union {
struct {
- BodySW *A;
- BodySW *B;
+ Body3DSW *A;
+ Body3DSW *B;
};
- BodySW *_arr[2];
+ Body3DSW *_arr[2];
};
- JacobianEntrySW m_jac[3]; //3 orthogonal linear constraints
- JacobianEntrySW m_jacAng[3]; //2 orthogonal angular constraints+ 1 for limit/motor
+ JacobianEntry3DSW m_jac[3]; //3 orthogonal linear constraints
+ JacobianEntry3DSW m_jacAng[3]; //2 orthogonal angular constraints+ 1 for limit/motor
Transform m_rbAFrame; // constraint axii. Assumes z is hinge axis.
Transform m_rbBFrame;
@@ -97,21 +97,21 @@ class HingeJointSW : public JointSW {
real_t m_appliedImpulse;
public:
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_HINGE; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_HINGE; }
virtual bool setup(real_t p_step);
virtual void solve(real_t p_step);
real_t get_hinge_angle();
- void set_param(PhysicsServer::HingeJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::HingeJointParam p_param) const;
+ void set_param(PhysicsServer3D::HingeJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::HingeJointParam p_param) const;
- void set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value);
- bool get_flag(PhysicsServer::HingeJointFlag p_flag) const;
+ void set_flag(PhysicsServer3D::HingeJointFlag p_flag, bool p_value);
+ bool get_flag(PhysicsServer3D::HingeJointFlag p_flag) const;
- HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, const Transform &frameB);
- HingeJointSW(BodySW *rbA, BodySW *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB);
+ HingeJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &frameA, const Transform &frameB);
+ HingeJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB);
};
#endif // HINGE_JOINT_SW_H
diff --git a/servers/physics/joints/jacobian_entry_sw.h b/servers/physics_3d/joints/jacobian_entry_3d_sw.h
index a17175e6de..e298d40d8d 100644
--- a/servers/physics/joints/jacobian_entry_sw.h
+++ b/servers/physics_3d/joints/jacobian_entry_3d_sw.h
@@ -52,11 +52,11 @@ subject to the following restrictions:
#include "core/math/transform.h"
-class JacobianEntrySW {
+class JacobianEntry3DSW {
public:
- JacobianEntrySW(){};
+ JacobianEntry3DSW(){};
//constraint between two different rigidbodies
- JacobianEntrySW(
+ JacobianEntry3DSW(
const Basis &world2A,
const Basis &world2B,
const Vector3 &rel_pos1, const Vector3 &rel_pos2,
@@ -76,7 +76,7 @@ public:
}
//angular constraint between two different rigidbodies
- JacobianEntrySW(const Vector3 &jointAxis,
+ JacobianEntry3DSW(const Vector3 &jointAxis,
const Basis &world2A,
const Basis &world2B,
const Vector3 &inertiaInvA,
@@ -92,7 +92,7 @@ public:
}
//angular constraint between two different rigidbodies
- JacobianEntrySW(const Vector3 &axisInA,
+ JacobianEntry3DSW(const Vector3 &axisInA,
const Vector3 &axisInB,
const Vector3 &inertiaInvA,
const Vector3 &inertiaInvB) :
@@ -107,7 +107,7 @@ public:
}
//constraint on one rigidbody
- JacobianEntrySW(
+ JacobianEntry3DSW(
const Basis &world2A,
const Vector3 &rel_pos1, const Vector3 &rel_pos2,
const Vector3 &jointAxis,
@@ -126,16 +126,16 @@ public:
real_t getDiagonal() const { return m_Adiag; }
// for two constraints on the same rigidbody (for example vehicle friction)
- real_t getNonDiagonal(const JacobianEntrySW &jacB, const real_t massInvA) const {
- const JacobianEntrySW &jacA = *this;
+ real_t getNonDiagonal(const JacobianEntry3DSW &jacB, const real_t massInvA) const {
+ const JacobianEntry3DSW &jacA = *this;
real_t lin = massInvA * jacA.m_linearJointAxis.dot(jacB.m_linearJointAxis);
real_t ang = jacA.m_0MinvJt.dot(jacB.m_aJ);
return lin + ang;
}
// for two constraints on sharing two same rigidbodies (for example two contact points between two rigidbodies)
- real_t getNonDiagonal(const JacobianEntrySW &jacB, const real_t massInvA, const real_t massInvB) const {
- const JacobianEntrySW &jacA = *this;
+ real_t getNonDiagonal(const JacobianEntry3DSW &jacB, const real_t massInvA, const real_t massInvB) const {
+ const JacobianEntry3DSW &jacA = *this;
Vector3 lin = jacA.m_linearJointAxis * jacB.m_linearJointAxis;
Vector3 ang0 = jacA.m_0MinvJt * jacB.m_aJ;
Vector3 ang1 = jacA.m_1MinvJt * jacB.m_bJ;
diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics_3d/joints/pin_joint_3d_sw.cpp
index fe994aa172..67f2d78d54 100644
--- a/servers/physics/joints/pin_joint_sw.cpp
+++ b/servers/physics_3d/joints/pin_joint_3d_sw.cpp
@@ -47,9 +47,9 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
-#include "pin_joint_sw.h"
+#include "pin_joint_3d_sw.h"
-bool PinJointSW::setup(real_t p_step) {
+bool PinJoint3DSW::setup(real_t p_step) {
m_appliedImpulse = real_t(0.);
@@ -57,7 +57,7 @@ bool PinJointSW::setup(real_t p_step) {
for (int i = 0; i < 3; i++) {
normal[i] = 1;
- memnew_placement(&m_jac[i], JacobianEntrySW(
+ memnew_placement(&m_jac[i], JacobianEntry3DSW(
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
A->get_transform().xform(m_pivotInA) - A->get_transform().origin - A->get_center_of_mass(),
@@ -73,7 +73,7 @@ bool PinJointSW::setup(real_t p_step) {
return true;
}
-void PinJointSW::solve(real_t p_step) {
+void PinJoint3DSW::solve(real_t p_step) {
Vector3 pivotAInW = A->get_transform().xform(m_pivotInA);
Vector3 pivotBInW = B->get_transform().xform(m_pivotInB);
@@ -126,28 +126,28 @@ void PinJointSW::solve(real_t p_step) {
}
}
-void PinJointSW::set_param(PhysicsServer::PinJointParam p_param, real_t p_value) {
+void PinJoint3DSW::set_param(PhysicsServer3D::PinJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::PIN_JOINT_BIAS: m_tau = p_value; break;
- case PhysicsServer::PIN_JOINT_DAMPING: m_damping = p_value; break;
- case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP: m_impulseClamp = p_value; break;
+ case PhysicsServer3D::PIN_JOINT_BIAS: m_tau = p_value; break;
+ case PhysicsServer3D::PIN_JOINT_DAMPING: m_damping = p_value; break;
+ case PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP: m_impulseClamp = p_value; break;
}
}
-real_t PinJointSW::get_param(PhysicsServer::PinJointParam p_param) const {
+real_t PinJoint3DSW::get_param(PhysicsServer3D::PinJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::PIN_JOINT_BIAS: return m_tau;
- case PhysicsServer::PIN_JOINT_DAMPING: return m_damping;
- case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP: return m_impulseClamp;
+ case PhysicsServer3D::PIN_JOINT_BIAS: return m_tau;
+ case PhysicsServer3D::PIN_JOINT_DAMPING: return m_damping;
+ case PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP: return m_impulseClamp;
}
return 0;
}
-PinJointSW::PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b) :
- JointSW(_arr, 2) {
+PinJoint3DSW::PinJoint3DSW(Body3DSW *p_body_a, const Vector3 &p_pos_a, Body3DSW *p_body_b, const Vector3 &p_pos_b) :
+ Joint3DSW(_arr, 2) {
A = p_body_a;
B = p_body_b;
@@ -163,5 +163,5 @@ PinJointSW::PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_
B->add_constraint(this, 1);
}
-PinJointSW::~PinJointSW() {
+PinJoint3DSW::~PinJoint3DSW() {
}
diff --git a/servers/physics/joints/pin_joint_sw.h b/servers/physics_3d/joints/pin_joint_3d_sw.h
index 42884e4940..25876327a3 100644
--- a/servers/physics/joints/pin_joint_sw.h
+++ b/servers/physics_3d/joints/pin_joint_3d_sw.h
@@ -35,8 +35,8 @@ Adapted to Godot from the Bullet library.
#ifndef PIN_JOINT_SW_H
#define PIN_JOINT_SW_H
-#include "servers/physics/joints/jacobian_entry_sw.h"
-#include "servers/physics/joints_sw.h"
+#include "servers/physics_3d/joints/jacobian_entry_3d_sw.h"
+#include "servers/physics_3d/joints_3d_sw.h"
/*
Bullet Continuous Collision Detection and Physics Library
@@ -53,15 +53,15 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
-class PinJointSW : public JointSW {
+class PinJoint3DSW : public Joint3DSW {
union {
struct {
- BodySW *A;
- BodySW *B;
+ Body3DSW *A;
+ Body3DSW *B;
};
- BodySW *_arr[2];
+ Body3DSW *_arr[2];
};
real_t m_tau; //bias
@@ -69,19 +69,19 @@ class PinJointSW : public JointSW {
real_t m_impulseClamp;
real_t m_appliedImpulse;
- JacobianEntrySW m_jac[3]; //3 orthogonal linear constraints
+ JacobianEntry3DSW m_jac[3]; //3 orthogonal linear constraints
Vector3 m_pivotInA;
Vector3 m_pivotInB;
public:
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_PIN; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_PIN; }
virtual bool setup(real_t p_step);
virtual void solve(real_t p_step);
- void set_param(PhysicsServer::PinJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::PinJointParam p_param) const;
+ void set_param(PhysicsServer3D::PinJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::PinJointParam p_param) const;
void set_pos_a(const Vector3 &p_pos) { m_pivotInA = p_pos; }
void set_pos_b(const Vector3 &p_pos) { m_pivotInB = p_pos; }
@@ -89,8 +89,8 @@ public:
Vector3 get_position_a() { return m_pivotInA; }
Vector3 get_position_b() { return m_pivotInB; }
- PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b);
- ~PinJointSW();
+ PinJoint3DSW(Body3DSW *p_body_a, const Vector3 &p_pos_a, Body3DSW *p_body_b, const Vector3 &p_pos_b);
+ ~PinJoint3DSW();
};
#endif // PIN_JOINT_SW_H
diff --git a/servers/physics/joints/slider_joint_sw.cpp b/servers/physics_3d/joints/slider_joint_3d_sw.cpp
index 9963c7ae89..01336e2d7c 100644
--- a/servers/physics/joints/slider_joint_sw.cpp
+++ b/servers/physics_3d/joints/slider_joint_3d_sw.cpp
@@ -53,7 +53,7 @@ April 04, 2008
*/
-#include "slider_joint_sw.h"
+#include "slider_joint_3d_sw.h"
//-----------------------------------------------------------------------------
@@ -72,7 +72,7 @@ static _FORCE_INLINE_ real_t atan2fast(real_t y, real_t x) {
return (y < 0.0f) ? -angle : angle;
}
-void SliderJointSW::initParams() {
+void SliderJoint3DSW::initParams() {
m_lowerLinLimit = real_t(1.0);
m_upperLinLimit = real_t(-1.0);
m_lowerAngLimit = real_t(0.);
@@ -112,8 +112,8 @@ void SliderJointSW::initParams() {
//-----------------------------------------------------------------------------
-SliderJointSW::SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB) :
- JointSW(_arr, 2),
+SliderJoint3DSW::SliderJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &frameInA, const Transform &frameInB) :
+ Joint3DSW(_arr, 2),
m_frameInA(frameInA),
m_frameInB(frameInB) {
@@ -128,7 +128,7 @@ SliderJointSW::SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA
//-----------------------------------------------------------------------------
-bool SliderJointSW::setup(real_t p_step) {
+bool SliderJoint3DSW::setup(real_t p_step) {
//calculate transforms
m_calculatedTransformA = A->get_transform() * m_frameInA;
@@ -145,7 +145,7 @@ bool SliderJointSW::setup(real_t p_step) {
//linear part
for (i = 0; i < 3; i++) {
normalWorld = m_calculatedTransformA.basis.get_axis(i);
- memnew_placement(&m_jacLin[i], JacobianEntrySW(
+ memnew_placement(&m_jacLin[i], JacobianEntry3DSW(
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
m_relPosA - A->get_center_of_mass(),
@@ -162,7 +162,7 @@ bool SliderJointSW::setup(real_t p_step) {
// angular part
for (i = 0; i < 3; i++) {
normalWorld = m_calculatedTransformA.basis.get_axis(i);
- memnew_placement(&m_jacAng[i], JacobianEntrySW(
+ memnew_placement(&m_jacAng[i], JacobianEntry3DSW(
normalWorld,
A->get_principal_inertia_axes().transposed(),
B->get_principal_inertia_axes().transposed(),
@@ -181,7 +181,7 @@ bool SliderJointSW::setup(real_t p_step) {
//-----------------------------------------------------------------------------
-void SliderJointSW::solve(real_t p_step) {
+void SliderJoint3DSW::solve(real_t p_step) {
int i;
// linear
@@ -304,7 +304,7 @@ void SliderJointSW::solve(real_t p_step) {
//-----------------------------------------------------------------------------
-void SliderJointSW::calculateTransforms(void) {
+void SliderJoint3DSW::calculateTransforms(void) {
m_calculatedTransformA = A->get_transform() * m_frameInA;
m_calculatedTransformB = B->get_transform() * m_frameInB;
m_realPivotAInW = m_calculatedTransformA.origin;
@@ -323,7 +323,7 @@ void SliderJointSW::calculateTransforms(void) {
//-----------------------------------------------------------------------------
-void SliderJointSW::testLinLimits(void) {
+void SliderJoint3DSW::testLinLimits(void) {
m_solveLinLim = false;
m_linPos = m_depth[0];
if (m_lowerLinLimit <= m_upperLinLimit) {
@@ -343,7 +343,7 @@ void SliderJointSW::testLinLimits(void) {
//-----------------------------------------------------------------------------
-void SliderJointSW::testAngLimits(void) {
+void SliderJoint3DSW::testAngLimits(void) {
m_angDepth = real_t(0.);
m_solveAngLim = false;
if (m_lowerAngLimit <= m_upperAngLimit) {
@@ -363,7 +363,7 @@ void SliderJointSW::testAngLimits(void) {
//-----------------------------------------------------------------------------
-Vector3 SliderJointSW::getAncorInA(void) {
+Vector3 SliderJoint3DSW::getAncorInA(void) {
Vector3 ancorInA;
ancorInA = m_realPivotAInW + (m_lowerLinLimit + m_upperLinLimit) * real_t(0.5) * m_sliderAxis;
ancorInA = A->get_transform().inverse().xform(ancorInA);
@@ -372,71 +372,71 @@ Vector3 SliderJointSW::getAncorInA(void) {
//-----------------------------------------------------------------------------
-Vector3 SliderJointSW::getAncorInB(void) {
+Vector3 SliderJoint3DSW::getAncorInB(void) {
Vector3 ancorInB;
ancorInB = m_frameInB.origin;
return ancorInB;
} // SliderJointSW::getAncorInB();
-void SliderJointSW::set_param(PhysicsServer::SliderJointParam p_param, real_t p_value) {
+void SliderJoint3DSW::set_param(PhysicsServer3D::SliderJointParam p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER: m_upperLinLimit = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER: m_lowerLinLimit = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: m_softnessLimLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: m_restitutionLimLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: m_dampingLimLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: m_softnessDirLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: m_restitutionDirLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_DAMPING: m_dampingDirLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: m_softnessOrthoLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: m_restitutionOrthoLin = p_value; break;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: m_dampingOrthoLin = p_value; break;
-
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: m_upperAngLimit = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: m_lowerAngLimit = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: m_softnessLimAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: m_restitutionLimAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: m_dampingLimAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: m_softnessDirAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: m_restitutionDirAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: m_dampingDirAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: m_softnessOrthoAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: m_restitutionOrthoAng = p_value; break;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: m_dampingOrthoAng = p_value; break;
-
- case PhysicsServer::SLIDER_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER: m_upperLinLimit = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER: m_lowerLinLimit = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: m_softnessLimLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: m_restitutionLimLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: m_dampingLimLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: m_softnessDirLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: m_restitutionDirLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_DAMPING: m_dampingDirLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: m_softnessOrthoLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: m_restitutionOrthoLin = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: m_dampingOrthoLin = p_value; break;
+
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: m_upperAngLimit = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: m_lowerAngLimit = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: m_softnessLimAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: m_restitutionLimAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: m_dampingLimAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: m_softnessDirAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: m_restitutionDirAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: m_dampingDirAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: m_softnessOrthoAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: m_restitutionOrthoAng = p_value; break;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: m_dampingOrthoAng = p_value; break;
+
+ case PhysicsServer3D::SLIDER_JOINT_MAX: break; // Can't happen, but silences warning
}
}
-real_t SliderJointSW::get_param(PhysicsServer::SliderJointParam p_param) const {
+real_t SliderJoint3DSW::get_param(PhysicsServer3D::SliderJointParam p_param) const {
switch (p_param) {
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER: return m_upperLinLimit;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER: return m_lowerLinLimit;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: return m_softnessLimLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: return m_restitutionLimLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: return m_dampingLimLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: return m_softnessDirLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: return m_restitutionDirLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_DAMPING: return m_dampingDirLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: return m_softnessOrthoLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: return m_restitutionOrthoLin;
- case PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: return m_dampingOrthoLin;
-
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: return m_upperAngLimit;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: return m_lowerAngLimit;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: return m_softnessLimAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: return m_restitutionLimAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: return m_dampingLimAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: return m_softnessDirAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: return m_restitutionDirAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: return m_dampingDirAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: return m_softnessOrthoAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: return m_restitutionOrthoAng;
- case PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: return m_dampingOrthoAng;
-
- case PhysicsServer::SLIDER_JOINT_MAX: break; // Can't happen, but silences warning
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER: return m_upperLinLimit;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER: return m_lowerLinLimit;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: return m_softnessLimLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: return m_restitutionLimLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING: return m_dampingLimLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: return m_softnessDirLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: return m_restitutionDirLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_MOTION_DAMPING: return m_dampingDirLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: return m_softnessOrthoLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: return m_restitutionOrthoLin;
+ case PhysicsServer3D::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: return m_dampingOrthoLin;
+
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER: return m_upperAngLimit;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER: return m_lowerAngLimit;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: return m_softnessLimAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: return m_restitutionLimAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: return m_dampingLimAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: return m_softnessDirAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: return m_restitutionDirAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_MOTION_DAMPING: return m_dampingDirAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: return m_softnessOrthoAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: return m_restitutionOrthoAng;
+ case PhysicsServer3D::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: return m_dampingOrthoAng;
+
+ case PhysicsServer3D::SLIDER_JOINT_MAX: break; // Can't happen, but silences warning
}
return 0;
diff --git a/servers/physics/joints/slider_joint_sw.h b/servers/physics_3d/joints/slider_joint_3d_sw.h
index 8b416eafc9..a70ba2597d 100644
--- a/servers/physics/joints/slider_joint_sw.h
+++ b/servers/physics_3d/joints/slider_joint_3d_sw.h
@@ -35,8 +35,8 @@ Adapted to Godot from the Bullet library.
#ifndef SLIDER_JOINT_SW_H
#define SLIDER_JOINT_SW_H
-#include "servers/physics/joints/jacobian_entry_sw.h"
-#include "servers/physics/joints_sw.h"
+#include "servers/physics_3d/joints/jacobian_entry_3d_sw.h"
+#include "servers/physics_3d/joints_3d_sw.h"
/*
Bullet Continuous Collision Detection and Physics Library
@@ -65,15 +65,15 @@ April 04, 2008
//-----------------------------------------------------------------------------
-class SliderJointSW : public JointSW {
+class SliderJoint3DSW : public Joint3DSW {
protected:
union {
struct {
- BodySW *A;
- BodySW *B;
+ Body3DSW *A;
+ Body3DSW *B;
};
- BodySW *_arr[2];
+ Body3DSW *_arr[2];
};
Transform m_frameInA;
@@ -114,10 +114,10 @@ protected:
bool m_solveLinLim;
bool m_solveAngLim;
- JacobianEntrySW m_jacLin[3];
+ JacobianEntry3DSW m_jacLin[3];
real_t m_jacLinDiagABInv[3];
- JacobianEntrySW m_jacAng[3];
+ JacobianEntry3DSW m_jacAng[3];
real_t m_timeStep;
Transform m_calculatedTransformA;
@@ -152,13 +152,13 @@ protected:
public:
// constructors
- SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB);
+ SliderJoint3DSW(Body3DSW *rbA, Body3DSW *rbB, const Transform &frameInA, const Transform &frameInB);
//SliderJointSW();
// overrides
// access
- const BodySW *getRigidBodyA() const { return A; }
- const BodySW *getRigidBodyB() const { return B; }
+ const Body3DSW *getRigidBodyA() const { return A; }
+ const Body3DSW *getRigidBodyB() const { return B; }
const Transform &getCalculatedTransformA() const { return m_calculatedTransformA; }
const Transform &getCalculatedTransformB() const { return m_calculatedTransformB; }
const Transform &getFrameOffsetA() const { return m_frameInA; }
@@ -237,13 +237,13 @@ public:
Vector3 getAncorInA(void);
Vector3 getAncorInB(void);
- void set_param(PhysicsServer::SliderJointParam p_param, real_t p_value);
- real_t get_param(PhysicsServer::SliderJointParam p_param) const;
+ void set_param(PhysicsServer3D::SliderJointParam p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::SliderJointParam p_param) const;
bool setup(real_t p_step);
void solve(real_t p_step);
- virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_SLIDER; }
+ virtual PhysicsServer3D::JointType get_type() const { return PhysicsServer3D::JOINT_SLIDER; }
};
#endif // SLIDER_JOINT_SW_H
diff --git a/servers/physics/joints_sw.h b/servers/physics_3d/joints_3d_sw.h
index c284d541e3..097aeb22b9 100644
--- a/servers/physics/joints_sw.h
+++ b/servers/physics_3d/joints_3d_sw.h
@@ -31,15 +31,15 @@
#ifndef JOINTS_SW_H
#define JOINTS_SW_H
-#include "body_sw.h"
-#include "constraint_sw.h"
+#include "body_3d_sw.h"
+#include "constraint_3d_sw.h"
-class JointSW : public ConstraintSW {
+class Joint3DSW : public Constraint3DSW {
public:
- virtual PhysicsServer::JointType get_type() const = 0;
- _FORCE_INLINE_ JointSW(BodySW **p_body_ptr = NULL, int p_body_count = 0) :
- ConstraintSW(p_body_ptr, p_body_count) {
+ virtual PhysicsServer3D::JointType get_type() const = 0;
+ _FORCE_INLINE_ Joint3DSW(Body3DSW **p_body_ptr = NULL, int p_body_count = 0) :
+ Constraint3DSW(p_body_ptr, p_body_count) {
}
};
diff --git a/servers/physics_3d/physics_server_3d_sw.cpp b/servers/physics_3d/physics_server_3d_sw.cpp
new file mode 100644
index 0000000000..27fcedc45f
--- /dev/null
+++ b/servers/physics_3d/physics_server_3d_sw.cpp
@@ -0,0 +1,1589 @@
+/*************************************************************************/
+/* physics_server_sw.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "physics_server_3d_sw.h"
+
+#include "broad_phase_3d_basic.h"
+#include "broad_phase_octree.h"
+#include "core/debugger/engine_debugger.h"
+#include "core/os/os.h"
+#include "joints/cone_twist_joint_3d_sw.h"
+#include "joints/generic_6dof_joint_3d_sw.h"
+#include "joints/hinge_joint_3d_sw.h"
+#include "joints/pin_joint_3d_sw.h"
+#include "joints/slider_joint_3d_sw.h"
+
+#define FLUSH_QUERY_CHECK(m_object) \
+ ERR_FAIL_COND_MSG(m_object->get_space() && flushing_queries, "Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead.");
+
+RID PhysicsServer3DSW::shape_create(ShapeType p_shape) {
+
+ Shape3DSW *shape = NULL;
+ switch (p_shape) {
+
+ case SHAPE_PLANE: {
+
+ shape = memnew(PlaneShape3DSW);
+ } break;
+ case SHAPE_RAY: {
+
+ shape = memnew(RayShape3DSW);
+ } break;
+ case SHAPE_SPHERE: {
+
+ shape = memnew(SphereShape3DSW);
+ } break;
+ case SHAPE_BOX: {
+
+ shape = memnew(BoxShape3DSW);
+ } break;
+ case SHAPE_CAPSULE: {
+
+ shape = memnew(CapsuleShape3DSW);
+ } break;
+ case SHAPE_CYLINDER: {
+
+ ERR_FAIL_V_MSG(RID(), "CylinderShape is not supported in GodotPhysics. Please switch to Bullet in the Project Settings.");
+ } break;
+ case SHAPE_CONVEX_POLYGON: {
+
+ shape = memnew(ConvexPolygonShape3DSW);
+ } break;
+ case SHAPE_CONCAVE_POLYGON: {
+
+ shape = memnew(ConcavePolygonShape3DSW);
+ } break;
+ case SHAPE_HEIGHTMAP: {
+
+ shape = memnew(HeightMapShape3DSW);
+ } break;
+ case SHAPE_CUSTOM: {
+
+ ERR_FAIL_V(RID());
+
+ } break;
+ }
+
+ RID id = shape_owner.make_rid(shape);
+ shape->set_self(id);
+
+ return id;
+};
+
+void PhysicsServer3DSW::shape_set_data(RID p_shape, const Variant &p_data) {
+
+ Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND(!shape);
+ shape->set_data(p_data);
+};
+
+void PhysicsServer3DSW::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) {
+
+ Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND(!shape);
+ shape->set_custom_bias(p_bias);
+}
+
+PhysicsServer3D::ShapeType PhysicsServer3DSW::shape_get_type(RID p_shape) const {
+
+ const Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND_V(!shape, SHAPE_CUSTOM);
+ return shape->get_type();
+};
+
+Variant PhysicsServer3DSW::shape_get_data(RID p_shape) const {
+
+ const Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND_V(!shape, Variant());
+ ERR_FAIL_COND_V(!shape->is_configured(), Variant());
+ return shape->get_data();
+};
+
+void PhysicsServer3DSW::shape_set_margin(RID p_shape, real_t p_margin) {
+}
+
+real_t PhysicsServer3DSW::shape_get_margin(RID p_shape) const {
+ return 0.0;
+}
+
+real_t PhysicsServer3DSW::shape_get_custom_solver_bias(RID p_shape) const {
+
+ const Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND_V(!shape, 0);
+ return shape->get_custom_bias();
+}
+
+RID PhysicsServer3DSW::space_create() {
+
+ Space3DSW *space = memnew(Space3DSW);
+ RID id = space_owner.make_rid(space);
+ space->set_self(id);
+ RID area_id = area_create();
+ Area3DSW *area = area_owner.getornull(area_id);
+ ERR_FAIL_COND_V(!area, RID());
+ space->set_default_area(area);
+ area->set_space(space);
+ area->set_priority(-1);
+ RID sgb = body_create();
+ body_set_space(sgb, id);
+ body_set_mode(sgb, BODY_MODE_STATIC);
+ space->set_static_global_body(sgb);
+
+ return id;
+};
+
+void PhysicsServer3DSW::space_set_active(RID p_space, bool p_active) {
+
+ Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND(!space);
+ if (p_active)
+ active_spaces.insert(space);
+ else
+ active_spaces.erase(space);
+}
+
+bool PhysicsServer3DSW::space_is_active(RID p_space) const {
+
+ const Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND_V(!space, false);
+
+ return active_spaces.has(space);
+}
+
+void PhysicsServer3DSW::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) {
+
+ Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND(!space);
+
+ space->set_param(p_param, p_value);
+}
+
+real_t PhysicsServer3DSW::space_get_param(RID p_space, SpaceParameter p_param) const {
+
+ const Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND_V(!space, 0);
+ return space->get_param(p_param);
+}
+
+PhysicsDirectSpaceState3D *PhysicsServer3DSW::space_get_direct_state(RID p_space) {
+
+ Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND_V(!space, NULL);
+ ERR_FAIL_COND_V_MSG(!doing_sync || space->is_locked(), NULL, "Space state is inaccessible right now, wait for iteration or physics process notification.");
+
+ return space->get_direct_state();
+}
+
+void PhysicsServer3DSW::space_set_debug_contacts(RID p_space, int p_max_contacts) {
+
+ Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND(!space);
+ space->set_debug_contacts(p_max_contacts);
+}
+
+Vector<Vector3> PhysicsServer3DSW::space_get_contacts(RID p_space) const {
+
+ Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND_V(!space, Vector<Vector3>());
+ return space->get_debug_contacts();
+}
+
+int PhysicsServer3DSW::space_get_contact_count(RID p_space) const {
+
+ Space3DSW *space = space_owner.getornull(p_space);
+ ERR_FAIL_COND_V(!space, 0);
+ return space->get_debug_contact_count();
+}
+
+RID PhysicsServer3DSW::area_create() {
+
+ Area3DSW *area = memnew(Area3DSW);
+ RID rid = area_owner.make_rid(area);
+ area->set_self(rid);
+ return rid;
+};
+
+void PhysicsServer3DSW::area_set_space(RID p_area, RID p_space) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ Space3DSW *space = NULL;
+ if (p_space.is_valid()) {
+ space = space_owner.getornull(p_space);
+ ERR_FAIL_COND(!space);
+ }
+
+ if (area->get_space() == space)
+ return; //pointless
+
+ area->clear_constraints();
+ area->set_space(space);
+};
+
+RID PhysicsServer3DSW::area_get_space(RID p_area) const {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, RID());
+
+ Space3DSW *space = area->get_space();
+ if (!space)
+ return RID();
+ return space->get_self();
+};
+
+void PhysicsServer3DSW::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_space_override_mode(p_mode);
+}
+
+PhysicsServer3D::AreaSpaceOverrideMode PhysicsServer3DSW::area_get_space_override_mode(RID p_area) const {
+
+ const Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, AREA_SPACE_OVERRIDE_DISABLED);
+
+ return area->get_space_override_mode();
+}
+
+void PhysicsServer3DSW::area_add_shape(RID p_area, RID p_shape, const Transform &p_transform, bool p_disabled) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND(!shape);
+
+ area->add_shape(shape, p_transform, p_disabled);
+}
+
+void PhysicsServer3DSW::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND(!shape);
+ ERR_FAIL_COND(!shape->is_configured());
+
+ area->set_shape(p_shape_idx, shape);
+}
+
+void PhysicsServer3DSW::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_shape_transform(p_shape_idx, p_transform);
+}
+
+int PhysicsServer3DSW::area_get_shape_count(RID p_area) const {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, -1);
+
+ return area->get_shape_count();
+}
+RID PhysicsServer3DSW::area_get_shape(RID p_area, int p_shape_idx) const {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, RID());
+
+ Shape3DSW *shape = area->get_shape(p_shape_idx);
+ ERR_FAIL_COND_V(!shape, RID());
+
+ return shape->get_self();
+}
+Transform PhysicsServer3DSW::area_get_shape_transform(RID p_area, int p_shape_idx) const {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, Transform());
+
+ return area->get_shape_transform(p_shape_idx);
+}
+
+void PhysicsServer3DSW::area_remove_shape(RID p_area, int p_shape_idx) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->remove_shape(p_shape_idx);
+}
+
+void PhysicsServer3DSW::area_clear_shapes(RID p_area) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ while (area->get_shape_count())
+ area->remove_shape(0);
+}
+
+void PhysicsServer3DSW::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+ ERR_FAIL_INDEX(p_shape_idx, area->get_shape_count());
+ FLUSH_QUERY_CHECK(area);
+ area->set_shape_as_disabled(p_shape_idx, p_disabled);
+}
+
+void PhysicsServer3DSW::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
+
+ if (space_owner.owns(p_area)) {
+ Space3DSW *space = space_owner.getornull(p_area);
+ p_area = space->get_default_area()->get_self();
+ }
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+ area->set_instance_id(p_id);
+}
+ObjectID PhysicsServer3DSW::area_get_object_instance_id(RID p_area) const {
+
+ if (space_owner.owns(p_area)) {
+ Space3DSW *space = space_owner.getornull(p_area);
+ p_area = space->get_default_area()->get_self();
+ }
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, ObjectID());
+ return area->get_instance_id();
+}
+
+void PhysicsServer3DSW::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) {
+
+ if (space_owner.owns(p_area)) {
+ Space3DSW *space = space_owner.getornull(p_area);
+ p_area = space->get_default_area()->get_self();
+ }
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+ area->set_param(p_param, p_value);
+};
+
+void PhysicsServer3DSW::area_set_transform(RID p_area, const Transform &p_transform) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+ area->set_transform(p_transform);
+};
+
+Variant PhysicsServer3DSW::area_get_param(RID p_area, AreaParameter p_param) const {
+
+ if (space_owner.owns(p_area)) {
+ Space3DSW *space = space_owner.getornull(p_area);
+ p_area = space->get_default_area()->get_self();
+ }
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, Variant());
+
+ return area->get_param(p_param);
+};
+
+Transform PhysicsServer3DSW::area_get_transform(RID p_area) const {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, Transform());
+
+ return area->get_transform();
+};
+
+void PhysicsServer3DSW::area_set_collision_layer(RID p_area, uint32_t p_layer) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_collision_layer(p_layer);
+}
+
+void PhysicsServer3DSW::area_set_collision_mask(RID p_area, uint32_t p_mask) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_collision_mask(p_mask);
+}
+
+void PhysicsServer3DSW::area_set_monitorable(RID p_area, bool p_monitorable) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+ FLUSH_QUERY_CHECK(area);
+
+ area->set_monitorable(p_monitorable);
+}
+
+void PhysicsServer3DSW::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
+}
+
+void PhysicsServer3DSW::area_set_ray_pickable(RID p_area, bool p_enable) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_ray_pickable(p_enable);
+}
+
+bool PhysicsServer3DSW::area_is_ray_pickable(RID p_area) const {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND_V(!area, false);
+
+ return area->is_ray_pickable();
+}
+
+void PhysicsServer3DSW::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) {
+
+ Area3DSW *area = area_owner.getornull(p_area);
+ ERR_FAIL_COND(!area);
+
+ area->set_area_monitor_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method);
+}
+
+/* BODY API */
+
+RID PhysicsServer3DSW::body_create(BodyMode p_mode, bool p_init_sleeping) {
+
+ Body3DSW *body = memnew(Body3DSW);
+ if (p_mode != BODY_MODE_RIGID)
+ body->set_mode(p_mode);
+ if (p_init_sleeping)
+ body->set_state(BODY_STATE_SLEEPING, p_init_sleeping);
+ RID rid = body_owner.make_rid(body);
+ body->set_self(rid);
+ return rid;
+};
+
+void PhysicsServer3DSW::body_set_space(RID p_body, RID p_space) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ Space3DSW *space = NULL;
+ if (p_space.is_valid()) {
+ space = space_owner.getornull(p_space);
+ ERR_FAIL_COND(!space);
+ }
+
+ if (body->get_space() == space)
+ return; //pointless
+
+ body->clear_constraint_map();
+ body->set_space(space);
+};
+
+RID PhysicsServer3DSW::body_get_space(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, RID());
+
+ Space3DSW *space = body->get_space();
+ if (!space)
+ return RID();
+ return space->get_self();
+};
+
+void PhysicsServer3DSW::body_set_mode(RID p_body, BodyMode p_mode) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_mode(p_mode);
+};
+
+PhysicsServer3D::BodyMode PhysicsServer3DSW::body_get_mode(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, BODY_MODE_STATIC);
+
+ return body->get_mode();
+};
+
+void PhysicsServer3DSW::body_add_shape(RID p_body, RID p_shape, const Transform &p_transform, bool p_disabled) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND(!shape);
+
+ body->add_shape(shape, p_transform, p_disabled);
+}
+
+void PhysicsServer3DSW::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ Shape3DSW *shape = shape_owner.getornull(p_shape);
+ ERR_FAIL_COND(!shape);
+ ERR_FAIL_COND(!shape->is_configured());
+
+ body->set_shape(p_shape_idx, shape);
+}
+void PhysicsServer3DSW::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_shape_transform(p_shape_idx, p_transform);
+}
+
+int PhysicsServer3DSW::body_get_shape_count(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, -1);
+
+ return body->get_shape_count();
+}
+RID PhysicsServer3DSW::body_get_shape(RID p_body, int p_shape_idx) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, RID());
+
+ Shape3DSW *shape = body->get_shape(p_shape_idx);
+ ERR_FAIL_COND_V(!shape, RID());
+
+ return shape->get_self();
+}
+
+void PhysicsServer3DSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+ ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count());
+ FLUSH_QUERY_CHECK(body);
+
+ body->set_shape_as_disabled(p_shape_idx, p_disabled);
+}
+
+Transform PhysicsServer3DSW::body_get_shape_transform(RID p_body, int p_shape_idx) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, Transform());
+
+ return body->get_shape_transform(p_shape_idx);
+}
+
+void PhysicsServer3DSW::body_remove_shape(RID p_body, int p_shape_idx) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->remove_shape(p_shape_idx);
+}
+
+void PhysicsServer3DSW::body_clear_shapes(RID p_body) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ while (body->get_shape_count())
+ body->remove_shape(0);
+}
+
+void PhysicsServer3DSW::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_continuous_collision_detection(p_enable);
+}
+
+bool PhysicsServer3DSW::body_is_continuous_collision_detection_enabled(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, false);
+
+ return body->is_continuous_collision_detection_enabled();
+}
+
+void PhysicsServer3DSW::body_set_collision_layer(RID p_body, uint32_t p_layer) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_collision_layer(p_layer);
+ body->wakeup();
+}
+
+uint32_t PhysicsServer3DSW::body_get_collision_layer(RID p_body) const {
+
+ const Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+
+ return body->get_collision_layer();
+}
+
+void PhysicsServer3DSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_collision_mask(p_mask);
+ body->wakeup();
+}
+
+uint32_t PhysicsServer3DSW::body_get_collision_mask(RID p_body) const {
+
+ const Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+
+ return body->get_collision_mask();
+}
+
+void PhysicsServer3DSW::body_attach_object_instance_id(RID p_body, ObjectID p_id) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_instance_id(p_id);
+};
+
+ObjectID PhysicsServer3DSW::body_get_object_instance_id(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, ObjectID());
+
+ return body->get_instance_id();
+};
+
+void PhysicsServer3DSW::body_set_user_flags(RID p_body, uint32_t p_flags) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+};
+
+uint32_t PhysicsServer3DSW::body_get_user_flags(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+
+ return 0;
+};
+
+void PhysicsServer3DSW::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_param(p_param, p_value);
+};
+
+real_t PhysicsServer3DSW::body_get_param(RID p_body, BodyParameter p_param) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+
+ return body->get_param(p_param);
+};
+
+void PhysicsServer3DSW::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) {
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+ body->set_kinematic_margin(p_margin);
+}
+
+real_t PhysicsServer3DSW::body_get_kinematic_safe_margin(RID p_body) const {
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+
+ return body->get_kinematic_margin();
+}
+
+void PhysicsServer3DSW::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_state(p_state, p_variant);
+};
+
+Variant PhysicsServer3DSW::body_get_state(RID p_body, BodyState p_state) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, Variant());
+
+ return body->get_state(p_state);
+};
+
+void PhysicsServer3DSW::body_set_applied_force(RID p_body, const Vector3 &p_force) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_applied_force(p_force);
+ body->wakeup();
+};
+
+Vector3 PhysicsServer3DSW::body_get_applied_force(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, Vector3());
+ return body->get_applied_force();
+};
+
+void PhysicsServer3DSW::body_set_applied_torque(RID p_body, const Vector3 &p_torque) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_applied_torque(p_torque);
+ body->wakeup();
+};
+
+Vector3 PhysicsServer3DSW::body_get_applied_torque(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, Vector3());
+
+ return body->get_applied_torque();
+};
+
+void PhysicsServer3DSW::body_add_central_force(RID p_body, const Vector3 &p_force) {
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->add_central_force(p_force);
+ body->wakeup();
+}
+
+void PhysicsServer3DSW::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) {
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->add_force(p_force, p_pos);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_add_torque(RID p_body, const Vector3 &p_torque) {
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->add_torque(p_torque);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) {
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ _update_shapes();
+
+ body->apply_central_impulse(p_impulse);
+ body->wakeup();
+}
+
+void PhysicsServer3DSW::body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ _update_shapes();
+
+ body->apply_impulse(p_pos, p_impulse);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ _update_shapes();
+
+ body->apply_torque_impulse(p_impulse);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ _update_shapes();
+
+ Vector3 v = body->get_linear_velocity();
+ Vector3 axis = p_axis_velocity.normalized();
+ v -= axis * axis.dot(v);
+ v += p_axis_velocity;
+ body->set_linear_velocity(v);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_axis_lock(p_axis, p_lock);
+ body->wakeup();
+}
+
+bool PhysicsServer3DSW::body_is_axis_locked(RID p_body, BodyAxis p_axis) const {
+
+ const Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+ return body->is_axis_locked(p_axis);
+}
+
+void PhysicsServer3DSW::body_add_collision_exception(RID p_body, RID p_body_b) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->add_exception(p_body_b);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_remove_collision_exception(RID p_body, RID p_body_b) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->remove_exception(p_body_b);
+ body->wakeup();
+};
+
+void PhysicsServer3DSW::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ for (int i = 0; i < body->get_exceptions().size(); i++) {
+ p_exceptions->push_back(body->get_exceptions()[i]);
+ }
+};
+
+void PhysicsServer3DSW::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+};
+
+real_t PhysicsServer3DSW::body_get_contacts_reported_depth_threshold(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, 0);
+ return 0;
+};
+
+void PhysicsServer3DSW::body_set_omit_force_integration(RID p_body, bool p_omit) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+
+ body->set_omit_force_integration(p_omit);
+};
+
+bool PhysicsServer3DSW::body_is_omitting_force_integration(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, false);
+ return body->get_omit_force_integration();
+};
+
+void PhysicsServer3DSW::body_set_max_contacts_reported(RID p_body, int p_contacts) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+ body->set_max_contacts_reported(p_contacts);
+}
+
+int PhysicsServer3DSW::body_get_max_contacts_reported(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, -1);
+ return body->get_max_contacts_reported();
+}
+
+void PhysicsServer3DSW::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+ body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method, p_udata);
+}
+
+void PhysicsServer3DSW::body_set_ray_pickable(RID p_body, bool p_enable) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND(!body);
+ body->set_ray_pickable(p_enable);
+}
+
+bool PhysicsServer3DSW::body_is_ray_pickable(RID p_body) const {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, false);
+ return body->is_ray_pickable();
+}
+
+bool PhysicsServer3DSW::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, false);
+ ERR_FAIL_COND_V(!body->get_space(), false);
+ ERR_FAIL_COND_V(body->get_space()->is_locked(), false);
+
+ _update_shapes();
+
+ return body->get_space()->test_body_motion(body, p_from, p_motion, p_infinite_inertia, body->get_kinematic_margin(), r_result, p_exclude_raycast_shapes);
+}
+
+int PhysicsServer3DSW::body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, false);
+ ERR_FAIL_COND_V(!body->get_space(), false);
+ ERR_FAIL_COND_V(body->get_space()->is_locked(), false);
+
+ _update_shapes();
+
+ return body->get_space()->test_body_ray_separation(body, p_transform, p_infinite_inertia, r_recover_motion, r_results, p_result_max, p_margin);
+}
+
+PhysicsDirectBodyState3D *PhysicsServer3DSW::body_get_direct_state(RID p_body) {
+
+ Body3DSW *body = body_owner.getornull(p_body);
+ ERR_FAIL_COND_V(!body, NULL);
+ ERR_FAIL_COND_V_MSG(!doing_sync || body->get_space()->is_locked(), NULL, "Body state is inaccessible right now, wait for iteration or physics process notification.");
+
+ direct_state->body = body;
+ return direct_state;
+}
+
+/* JOINT API */
+
+RID PhysicsServer3DSW::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) {
+
+ Body3DSW *body_A = body_owner.getornull(p_body_A);
+ ERR_FAIL_COND_V(!body_A, RID());
+
+ if (!p_body_B.is_valid()) {
+ ERR_FAIL_COND_V(!body_A->get_space(), RID());
+ p_body_B = body_A->get_space()->get_static_global_body();
+ }
+
+ Body3DSW *body_B = body_owner.getornull(p_body_B);
+ ERR_FAIL_COND_V(!body_B, RID());
+
+ ERR_FAIL_COND_V(body_A == body_B, RID());
+
+ Joint3DSW *joint = memnew(PinJoint3DSW(body_A, p_local_A, body_B, p_local_B));
+ RID rid = joint_owner.make_rid(joint);
+ joint->set_self(rid);
+ return rid;
+}
+
+void PhysicsServer3DSW::pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
+ PinJoint3DSW *pin_joint = static_cast<PinJoint3DSW *>(joint);
+ pin_joint->set_param(p_param, p_value);
+}
+real_t PhysicsServer3DSW::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, 0);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, 0);
+ PinJoint3DSW *pin_joint = static_cast<PinJoint3DSW *>(joint);
+ return pin_joint->get_param(p_param);
+}
+
+void PhysicsServer3DSW::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
+ PinJoint3DSW *pin_joint = static_cast<PinJoint3DSW *>(joint);
+ pin_joint->set_pos_a(p_A);
+}
+Vector3 PhysicsServer3DSW::pin_joint_get_local_a(RID p_joint) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, Vector3());
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
+ PinJoint3DSW *pin_joint = static_cast<PinJoint3DSW *>(joint);
+ return pin_joint->get_position_a();
+}
+
+void PhysicsServer3DSW::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_PIN);
+ PinJoint3DSW *pin_joint = static_cast<PinJoint3DSW *>(joint);
+ pin_joint->set_pos_b(p_B);
+}
+Vector3 PhysicsServer3DSW::pin_joint_get_local_b(RID p_joint) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, Vector3());
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3());
+ PinJoint3DSW *pin_joint = static_cast<PinJoint3DSW *>(joint);
+ return pin_joint->get_position_b();
+}
+
+RID PhysicsServer3DSW::joint_create_hinge(RID p_body_A, const Transform &p_frame_A, RID p_body_B, const Transform &p_frame_B) {
+
+ Body3DSW *body_A = body_owner.getornull(p_body_A);
+ ERR_FAIL_COND_V(!body_A, RID());
+
+ if (!p_body_B.is_valid()) {
+ ERR_FAIL_COND_V(!body_A->get_space(), RID());
+ p_body_B = body_A->get_space()->get_static_global_body();
+ }
+
+ Body3DSW *body_B = body_owner.getornull(p_body_B);
+ ERR_FAIL_COND_V(!body_B, RID());
+
+ ERR_FAIL_COND_V(body_A == body_B, RID());
+
+ Joint3DSW *joint = memnew(HingeJoint3DSW(body_A, body_B, p_frame_A, p_frame_B));
+ RID rid = joint_owner.make_rid(joint);
+ joint->set_self(rid);
+ return rid;
+}
+
+RID PhysicsServer3DSW::joint_create_hinge_simple(RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) {
+
+ Body3DSW *body_A = body_owner.getornull(p_body_A);
+ ERR_FAIL_COND_V(!body_A, RID());
+
+ if (!p_body_B.is_valid()) {
+ ERR_FAIL_COND_V(!body_A->get_space(), RID());
+ p_body_B = body_A->get_space()->get_static_global_body();
+ }
+
+ Body3DSW *body_B = body_owner.getornull(p_body_B);
+ ERR_FAIL_COND_V(!body_B, RID());
+
+ ERR_FAIL_COND_V(body_A == body_B, RID());
+
+ Joint3DSW *joint = memnew(HingeJoint3DSW(body_A, body_B, p_pivot_A, p_pivot_B, p_axis_A, p_axis_B));
+ RID rid = joint_owner.make_rid(joint);
+ joint->set_self(rid);
+ return rid;
+}
+
+void PhysicsServer3DSW::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, real_t p_value) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_HINGE);
+ HingeJoint3DSW *hinge_joint = static_cast<HingeJoint3DSW *>(joint);
+ hinge_joint->set_param(p_param, p_value);
+}
+real_t PhysicsServer3DSW::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, 0);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, 0);
+ HingeJoint3DSW *hinge_joint = static_cast<HingeJoint3DSW *>(joint);
+ return hinge_joint->get_param(p_param);
+}
+
+void PhysicsServer3DSW::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_HINGE);
+ HingeJoint3DSW *hinge_joint = static_cast<HingeJoint3DSW *>(joint);
+ hinge_joint->set_flag(p_flag, p_value);
+}
+bool PhysicsServer3DSW::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, false);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, false);
+ HingeJoint3DSW *hinge_joint = static_cast<HingeJoint3DSW *>(joint);
+ return hinge_joint->get_flag(p_flag);
+}
+
+void PhysicsServer3DSW::joint_set_solver_priority(RID p_joint, int p_priority) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ joint->set_priority(p_priority);
+}
+
+int PhysicsServer3DSW::joint_get_solver_priority(RID p_joint) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, 0);
+ return joint->get_priority();
+}
+
+void PhysicsServer3DSW::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) {
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+
+ joint->disable_collisions_between_bodies(p_disable);
+
+ if (2 == joint->get_body_count()) {
+ Body3DSW *body_a = *joint->get_body_ptr();
+ Body3DSW *body_b = *(joint->get_body_ptr() + 1);
+
+ if (p_disable) {
+ body_add_collision_exception(body_a->get_self(), body_b->get_self());
+ body_add_collision_exception(body_b->get_self(), body_a->get_self());
+ } else {
+ body_remove_collision_exception(body_a->get_self(), body_b->get_self());
+ body_remove_collision_exception(body_b->get_self(), body_a->get_self());
+ }
+ }
+}
+
+bool PhysicsServer3DSW::joint_is_disabled_collisions_between_bodies(RID p_joint) const {
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, true);
+
+ return joint->is_disabled_collisions_between_bodies();
+}
+
+PhysicsServer3DSW::JointType PhysicsServer3DSW::joint_get_type(RID p_joint) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, JOINT_PIN);
+ return joint->get_type();
+}
+
+RID PhysicsServer3DSW::joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
+
+ Body3DSW *body_A = body_owner.getornull(p_body_A);
+ ERR_FAIL_COND_V(!body_A, RID());
+
+ if (!p_body_B.is_valid()) {
+ ERR_FAIL_COND_V(!body_A->get_space(), RID());
+ p_body_B = body_A->get_space()->get_static_global_body();
+ }
+
+ Body3DSW *body_B = body_owner.getornull(p_body_B);
+ ERR_FAIL_COND_V(!body_B, RID());
+
+ ERR_FAIL_COND_V(body_A == body_B, RID());
+
+ Joint3DSW *joint = memnew(SliderJoint3DSW(body_A, body_B, p_local_frame_A, p_local_frame_B));
+ RID rid = joint_owner.make_rid(joint);
+ joint->set_self(rid);
+ return rid;
+}
+
+void PhysicsServer3DSW::slider_joint_set_param(RID p_joint, SliderJointParam p_param, real_t p_value) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_SLIDER);
+ SliderJoint3DSW *slider_joint = static_cast<SliderJoint3DSW *>(joint);
+ slider_joint->set_param(p_param, p_value);
+}
+real_t PhysicsServer3DSW::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, 0);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0);
+ SliderJoint3DSW *slider_joint = static_cast<SliderJoint3DSW *>(joint);
+ return slider_joint->get_param(p_param);
+}
+
+RID PhysicsServer3DSW::joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
+
+ Body3DSW *body_A = body_owner.getornull(p_body_A);
+ ERR_FAIL_COND_V(!body_A, RID());
+
+ if (!p_body_B.is_valid()) {
+ ERR_FAIL_COND_V(!body_A->get_space(), RID());
+ p_body_B = body_A->get_space()->get_static_global_body();
+ }
+
+ Body3DSW *body_B = body_owner.getornull(p_body_B);
+ ERR_FAIL_COND_V(!body_B, RID());
+
+ ERR_FAIL_COND_V(body_A == body_B, RID());
+
+ Joint3DSW *joint = memnew(ConeTwistJoint3DSW(body_A, body_B, p_local_frame_A, p_local_frame_B));
+ RID rid = joint_owner.make_rid(joint);
+ joint->set_self(rid);
+ return rid;
+}
+
+void PhysicsServer3DSW::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, real_t p_value) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_CONE_TWIST);
+ ConeTwistJoint3DSW *cone_twist_joint = static_cast<ConeTwistJoint3DSW *>(joint);
+ cone_twist_joint->set_param(p_param, p_value);
+}
+real_t PhysicsServer3DSW::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, 0);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0);
+ ConeTwistJoint3DSW *cone_twist_joint = static_cast<ConeTwistJoint3DSW *>(joint);
+ return cone_twist_joint->get_param(p_param);
+}
+
+RID PhysicsServer3DSW::joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) {
+
+ Body3DSW *body_A = body_owner.getornull(p_body_A);
+ ERR_FAIL_COND_V(!body_A, RID());
+
+ if (!p_body_B.is_valid()) {
+ ERR_FAIL_COND_V(!body_A->get_space(), RID());
+ p_body_B = body_A->get_space()->get_static_global_body();
+ }
+
+ Body3DSW *body_B = body_owner.getornull(p_body_B);
+ ERR_FAIL_COND_V(!body_B, RID());
+
+ ERR_FAIL_COND_V(body_A == body_B, RID());
+
+ Joint3DSW *joint = memnew(Generic6DOFJoint3DSW(body_A, body_B, p_local_frame_A, p_local_frame_B, true));
+ RID rid = joint_owner.make_rid(joint);
+ joint->set_self(rid);
+ return rid;
+}
+
+void PhysicsServer3DSW::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, real_t p_value) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
+ Generic6DOFJoint3DSW *generic_6dof_joint = static_cast<Generic6DOFJoint3DSW *>(joint);
+ generic_6dof_joint->set_param(p_axis, p_param, p_value);
+}
+real_t PhysicsServer3DSW::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, 0);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0);
+ Generic6DOFJoint3DSW *generic_6dof_joint = static_cast<Generic6DOFJoint3DSW *>(joint);
+ return generic_6dof_joint->get_param(p_axis, p_param);
+}
+
+void PhysicsServer3DSW::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND(!joint);
+ ERR_FAIL_COND(joint->get_type() != JOINT_6DOF);
+ Generic6DOFJoint3DSW *generic_6dof_joint = static_cast<Generic6DOFJoint3DSW *>(joint);
+ generic_6dof_joint->set_flag(p_axis, p_flag, p_enable);
+}
+bool PhysicsServer3DSW::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_joint);
+ ERR_FAIL_COND_V(!joint, false);
+ ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, false);
+ Generic6DOFJoint3DSW *generic_6dof_joint = static_cast<Generic6DOFJoint3DSW *>(joint);
+ return generic_6dof_joint->get_flag(p_axis, p_flag);
+}
+
+void PhysicsServer3DSW::free(RID p_rid) {
+
+ _update_shapes(); //just in case
+
+ if (shape_owner.owns(p_rid)) {
+
+ Shape3DSW *shape = shape_owner.getornull(p_rid);
+
+ while (shape->get_owners().size()) {
+ ShapeOwner3DSW *so = shape->get_owners().front()->key();
+ so->remove_shape(shape);
+ }
+
+ shape_owner.free(p_rid);
+ memdelete(shape);
+ } else if (body_owner.owns(p_rid)) {
+
+ Body3DSW *body = body_owner.getornull(p_rid);
+
+ /*
+ if (body->get_state_query())
+ _clear_query(body->get_state_query());
+
+ if (body->get_direct_state_query())
+ _clear_query(body->get_direct_state_query());
+ */
+
+ body->set_space(NULL);
+
+ while (body->get_shape_count()) {
+
+ body->remove_shape(0);
+ }
+
+ body_owner.free(p_rid);
+ memdelete(body);
+
+ } else if (area_owner.owns(p_rid)) {
+
+ Area3DSW *area = area_owner.getornull(p_rid);
+
+ /*
+ if (area->get_monitor_query())
+ _clear_query(area->get_monitor_query());
+ */
+
+ area->set_space(NULL);
+
+ while (area->get_shape_count()) {
+
+ area->remove_shape(0);
+ }
+
+ area_owner.free(p_rid);
+ memdelete(area);
+ } else if (space_owner.owns(p_rid)) {
+
+ Space3DSW *space = space_owner.getornull(p_rid);
+
+ while (space->get_objects().size()) {
+ CollisionObject3DSW *co = (CollisionObject3DSW *)space->get_objects().front()->get();
+ co->set_space(NULL);
+ }
+
+ active_spaces.erase(space);
+ free(space->get_default_area()->get_self());
+ free(space->get_static_global_body());
+
+ space_owner.free(p_rid);
+ memdelete(space);
+ } else if (joint_owner.owns(p_rid)) {
+
+ Joint3DSW *joint = joint_owner.getornull(p_rid);
+
+ for (int i = 0; i < joint->get_body_count(); i++) {
+
+ joint->get_body_ptr()[i]->remove_constraint(joint);
+ }
+ joint_owner.free(p_rid);
+ memdelete(joint);
+
+ } else {
+
+ ERR_FAIL_MSG("Invalid ID.");
+ }
+};
+
+void PhysicsServer3DSW::set_active(bool p_active) {
+
+ active = p_active;
+};
+
+void PhysicsServer3DSW::init() {
+
+ doing_sync = true;
+ last_step = 0.001;
+ iterations = 8; // 8?
+ stepper = memnew(Step3DSW);
+ direct_state = memnew(PhysicsDirectBodyState3DSW);
+};
+
+void PhysicsServer3DSW::step(real_t p_step) {
+
+#ifndef _3D_DISABLED
+
+ if (!active)
+ return;
+
+ _update_shapes();
+
+ doing_sync = false;
+
+ last_step = p_step;
+ PhysicsDirectBodyState3DSW::singleton->step = p_step;
+
+ island_count = 0;
+ active_objects = 0;
+ collision_pairs = 0;
+ for (Set<const Space3DSW *>::Element *E = active_spaces.front(); E; E = E->next()) {
+
+ stepper->step((Space3DSW *)E->get(), p_step, iterations);
+ island_count += E->get()->get_island_count();
+ active_objects += E->get()->get_active_objects();
+ collision_pairs += E->get()->get_collision_pairs();
+ }
+#endif
+}
+
+void PhysicsServer3DSW::sync(){
+
+};
+
+void PhysicsServer3DSW::flush_queries() {
+
+#ifndef _3D_DISABLED
+
+ if (!active)
+ return;
+
+ doing_sync = true;
+
+ flushing_queries = true;
+
+ uint64_t time_beg = OS::get_singleton()->get_ticks_usec();
+
+ for (Set<const Space3DSW *>::Element *E = active_spaces.front(); E; E = E->next()) {
+
+ Space3DSW *space = (Space3DSW *)E->get();
+ space->call_queries();
+ }
+
+ flushing_queries = false;
+
+ if (EngineDebugger::is_profiling("servers")) {
+
+ uint64_t total_time[Space3DSW::ELAPSED_TIME_MAX];
+ static const char *time_name[Space3DSW::ELAPSED_TIME_MAX] = {
+ "integrate_forces",
+ "generate_islands",
+ "setup_constraints",
+ "solve_constraints",
+ "integrate_velocities"
+ };
+
+ for (int i = 0; i < Space3DSW::ELAPSED_TIME_MAX; i++) {
+ total_time[i] = 0;
+ }
+
+ for (Set<const Space3DSW *>::Element *E = active_spaces.front(); E; E = E->next()) {
+
+ for (int i = 0; i < Space3DSW::ELAPSED_TIME_MAX; i++) {
+ total_time[i] += E->get()->get_elapsed_time(Space3DSW::ElapsedTime(i));
+ }
+ }
+
+ Array values;
+ values.resize(Space3DSW::ELAPSED_TIME_MAX * 2);
+ for (int i = 0; i < Space3DSW::ELAPSED_TIME_MAX; i++) {
+ values[i * 2 + 0] = time_name[i];
+ values[i * 2 + 1] = USEC_TO_SEC(total_time[i]);
+ }
+ values.push_back("flush_queries");
+ values.push_back(USEC_TO_SEC(OS::get_singleton()->get_ticks_usec() - time_beg));
+
+ values.push_front("physics");
+ EngineDebugger::profiler_add_frame_data("server", values);
+ }
+#endif
+};
+
+void PhysicsServer3DSW::finish() {
+
+ memdelete(stepper);
+ memdelete(direct_state);
+};
+
+int PhysicsServer3DSW::get_process_info(ProcessInfo p_info) {
+
+ switch (p_info) {
+
+ case INFO_ACTIVE_OBJECTS: {
+
+ return active_objects;
+ } break;
+ case INFO_COLLISION_PAIRS: {
+ return collision_pairs;
+ } break;
+ case INFO_ISLAND_COUNT: {
+
+ return island_count;
+ } break;
+ }
+
+ return 0;
+}
+
+void PhysicsServer3DSW::_update_shapes() {
+
+ while (pending_shape_update_list.first()) {
+ pending_shape_update_list.first()->self()->_shape_changed();
+ pending_shape_update_list.remove(pending_shape_update_list.first());
+ }
+}
+
+void PhysicsServer3DSW::_shape_col_cbk(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata) {
+
+ CollCbkData *cbk = (CollCbkData *)p_userdata;
+
+ if (cbk->max == 0)
+ return;
+
+ if (cbk->amount == cbk->max) {
+ //find least deep
+ real_t min_depth = 1e20;
+ int min_depth_idx = 0;
+ for (int i = 0; i < cbk->amount; i++) {
+
+ real_t d = cbk->ptr[i * 2 + 0].distance_squared_to(cbk->ptr[i * 2 + 1]);
+ if (d < min_depth) {
+ min_depth = d;
+ min_depth_idx = i;
+ }
+ }
+
+ real_t d = p_point_A.distance_squared_to(p_point_B);
+ if (d < min_depth)
+ return;
+ cbk->ptr[min_depth_idx * 2 + 0] = p_point_A;
+ cbk->ptr[min_depth_idx * 2 + 1] = p_point_B;
+
+ } else {
+
+ cbk->ptr[cbk->amount * 2 + 0] = p_point_A;
+ cbk->ptr[cbk->amount * 2 + 1] = p_point_B;
+ cbk->amount++;
+ }
+}
+
+PhysicsServer3DSW *PhysicsServer3DSW::singleton = NULL;
+PhysicsServer3DSW::PhysicsServer3DSW() {
+ singleton = this;
+ BroadPhase3DSW::create_func = BroadPhaseOctree::_create;
+ island_count = 0;
+ active_objects = 0;
+ collision_pairs = 0;
+
+ active = true;
+ flushing_queries = false;
+};
+
+PhysicsServer3DSW::~PhysicsServer3DSW(){
+
+};
diff --git a/servers/physics/physics_server_sw.h b/servers/physics_3d/physics_server_3d_sw.h
index 459c7688f0..7f0cd0ba9f 100644
--- a/servers/physics/physics_server_sw.h
+++ b/servers/physics_3d/physics_server_3d_sw.h
@@ -32,17 +32,17 @@
#define PHYSICS_SERVER_SW
#include "core/rid_owner.h"
-#include "joints_sw.h"
-#include "servers/physics_server.h"
-#include "shape_sw.h"
-#include "space_sw.h"
-#include "step_sw.h"
+#include "joints_3d_sw.h"
+#include "servers/physics_server_3d.h"
+#include "shape_3d_sw.h"
+#include "space_3d_sw.h"
+#include "step_3d_sw.h"
-class PhysicsServerSW : public PhysicsServer {
+class PhysicsServer3DSW : public PhysicsServer3D {
- GDCLASS(PhysicsServerSW, PhysicsServer);
+ GDCLASS(PhysicsServer3DSW, PhysicsServer3D);
- friend class PhysicsDirectSpaceStateSW;
+ friend class PhysicsDirectSpaceState3DSW;
bool active;
int iterations;
bool doing_sync;
@@ -54,24 +54,24 @@ class PhysicsServerSW : public PhysicsServer {
bool flushing_queries;
- StepSW *stepper;
- Set<const SpaceSW *> active_spaces;
+ Step3DSW *stepper;
+ Set<const Space3DSW *> active_spaces;
- PhysicsDirectBodyStateSW *direct_state;
+ PhysicsDirectBodyState3DSW *direct_state;
- mutable RID_PtrOwner<ShapeSW> shape_owner;
- mutable RID_PtrOwner<SpaceSW> space_owner;
- mutable RID_PtrOwner<AreaSW> area_owner;
- mutable RID_PtrOwner<BodySW> body_owner;
- mutable RID_PtrOwner<JointSW> joint_owner;
+ mutable RID_PtrOwner<Shape3DSW> shape_owner;
+ mutable RID_PtrOwner<Space3DSW> space_owner;
+ mutable RID_PtrOwner<Area3DSW> area_owner;
+ mutable RID_PtrOwner<Body3DSW> body_owner;
+ mutable RID_PtrOwner<Joint3DSW> joint_owner;
//void _clear_query(QuerySW *p_query);
- friend class CollisionObjectSW;
- SelfList<CollisionObjectSW>::List pending_shape_update_list;
+ friend class CollisionObject3DSW;
+ SelfList<CollisionObject3DSW>::List pending_shape_update_list;
void _update_shapes();
public:
- static PhysicsServerSW *singleton;
+ static PhysicsServer3DSW *singleton;
struct CollCbkData {
@@ -104,7 +104,7 @@ public:
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const;
// this function only works on physics process, errors and returns null otherwise
- virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space);
+ virtual PhysicsDirectSpaceState3D *space_get_direct_state(RID p_space);
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts);
virtual Vector<Vector3> space_get_contacts(RID p_space) const;
@@ -241,13 +241,13 @@ public:
virtual int body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin = 0.001);
// this function only works on physics process, errors and returns null otherwise
- virtual PhysicsDirectBodyState *body_get_direct_state(RID p_body);
+ virtual PhysicsDirectBodyState3D *body_get_direct_state(RID p_body);
/* SOFT BODY */
virtual RID soft_body_create(bool p_init_sleeping = false) { return RID(); }
- virtual void soft_body_update_visual_server(RID p_body, class SoftBodyVisualServerHandler *p_visual_server_handler) {}
+ virtual void soft_body_update_rendering_server(RID p_body, class SoftBodyRenderingServerHandler *p_rendering_server_handler) {}
virtual void soft_body_set_space(RID p_body, RID p_space) {}
virtual RID soft_body_get_space(RID p_body) const { return RID(); }
@@ -375,8 +375,8 @@ public:
int get_process_info(ProcessInfo p_info);
- PhysicsServerSW();
- ~PhysicsServerSW();
+ PhysicsServer3DSW();
+ ~PhysicsServer3DSW();
};
#endif
diff --git a/servers/physics/shape_sw.cpp b/servers/physics_3d/shape_3d_sw.cpp
index 4a6ed6be58..53b162636e 100644
--- a/servers/physics/shape_sw.cpp
+++ b/servers/physics_3d/shape_3d_sw.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "shape_sw.h"
+#include "shape_3d_sw.h"
#include "core/math/geometry.h"
#include "core/math/quick_hull.h"
@@ -38,16 +38,16 @@
#define _EDGE_IS_VALID_SUPPORT_THRESHOLD 0.0002
#define _FACE_IS_VALID_SUPPORT_THRESHOLD 0.9998
-void ShapeSW::configure(const AABB &p_aabb) {
+void Shape3DSW::configure(const AABB &p_aabb) {
aabb = p_aabb;
configured = true;
- for (Map<ShapeOwnerSW *, int>::Element *E = owners.front(); E; E = E->next()) {
- ShapeOwnerSW *co = (ShapeOwnerSW *)E->key();
+ for (Map<ShapeOwner3DSW *, int>::Element *E = owners.front(); E; E = E->next()) {
+ ShapeOwner3DSW *co = (ShapeOwner3DSW *)E->key();
co->_shape_changed();
}
}
-Vector3 ShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 Shape3DSW::get_support(const Vector3 &p_normal) const {
Vector3 res;
int amnt;
@@ -55,9 +55,9 @@ Vector3 ShapeSW::get_support(const Vector3 &p_normal) const {
return res;
}
-void ShapeSW::add_owner(ShapeOwnerSW *p_owner) {
+void Shape3DSW::add_owner(ShapeOwner3DSW *p_owner) {
- Map<ShapeOwnerSW *, int>::Element *E = owners.find(p_owner);
+ Map<ShapeOwner3DSW *, int>::Element *E = owners.find(p_owner);
if (E) {
E->get()++;
} else {
@@ -65,9 +65,9 @@ void ShapeSW::add_owner(ShapeOwnerSW *p_owner) {
}
}
-void ShapeSW::remove_owner(ShapeOwnerSW *p_owner) {
+void Shape3DSW::remove_owner(ShapeOwner3DSW *p_owner) {
- Map<ShapeOwnerSW *, int>::Element *E = owners.find(p_owner);
+ Map<ShapeOwner3DSW *, int>::Element *E = owners.find(p_owner);
ERR_FAIL_COND(!E);
E->get()--;
if (E->get() == 0) {
@@ -75,44 +75,44 @@ void ShapeSW::remove_owner(ShapeOwnerSW *p_owner) {
}
}
-bool ShapeSW::is_owner(ShapeOwnerSW *p_owner) const {
+bool Shape3DSW::is_owner(ShapeOwner3DSW *p_owner) const {
return owners.has(p_owner);
}
-const Map<ShapeOwnerSW *, int> &ShapeSW::get_owners() const {
+const Map<ShapeOwner3DSW *, int> &Shape3DSW::get_owners() const {
return owners;
}
-ShapeSW::ShapeSW() {
+Shape3DSW::Shape3DSW() {
custom_bias = 0;
configured = false;
}
-ShapeSW::~ShapeSW() {
+Shape3DSW::~Shape3DSW() {
ERR_FAIL_COND(owners.size());
}
-Plane PlaneShapeSW::get_plane() const {
+Plane PlaneShape3DSW::get_plane() const {
return plane;
}
-void PlaneShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void PlaneShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
// gibberish, a plane is infinity
r_min = -1e7;
r_max = 1e7;
}
-Vector3 PlaneShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 PlaneShape3DSW::get_support(const Vector3 &p_normal) const {
return p_normal * 1e15;
}
-bool PlaneShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool PlaneShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
bool inters = plane.intersects_segment(p_begin, p_end, &r_result);
if (inters)
@@ -120,12 +120,12 @@ bool PlaneShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_en
return inters;
}
-bool PlaneShapeSW::intersect_point(const Vector3 &p_point) const {
+bool PlaneShape3DSW::intersect_point(const Vector3 &p_point) const {
return plane.distance_to(p_point) < 0;
}
-Vector3 PlaneShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 PlaneShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
if (plane.is_point_over(p_point)) {
return plane.project(p_point);
@@ -134,49 +134,49 @@ Vector3 PlaneShapeSW::get_closest_point_to(const Vector3 &p_point) const {
}
}
-Vector3 PlaneShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 PlaneShape3DSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3(); //wtf
}
-void PlaneShapeSW::_setup(const Plane &p_plane) {
+void PlaneShape3DSW::_setup(const Plane &p_plane) {
plane = p_plane;
configure(AABB(Vector3(-1e4, -1e4, -1e4), Vector3(1e4 * 2, 1e4 * 2, 1e4 * 2)));
}
-void PlaneShapeSW::set_data(const Variant &p_data) {
+void PlaneShape3DSW::set_data(const Variant &p_data) {
_setup(p_data);
}
-Variant PlaneShapeSW::get_data() const {
+Variant PlaneShape3DSW::get_data() const {
return plane;
}
-PlaneShapeSW::PlaneShapeSW() {
+PlaneShape3DSW::PlaneShape3DSW() {
}
//
-real_t RayShapeSW::get_length() const {
+real_t RayShape3DSW::get_length() const {
return length;
}
-bool RayShapeSW::get_slips_on_slope() const {
+bool RayShape3DSW::get_slips_on_slope() const {
return slips_on_slope;
}
-void RayShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void RayShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
// don't think this will be even used
r_min = 0;
r_max = 1;
}
-Vector3 RayShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 RayShape3DSW::get_support(const Vector3 &p_normal) const {
if (p_normal.z > 0)
return Vector3(0, 0, length);
@@ -184,7 +184,7 @@ Vector3 RayShapeSW::get_support(const Vector3 &p_normal) const {
return Vector3(0, 0, 0);
}
-void RayShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
+void RayShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
if (Math::abs(p_normal.z) < _EDGE_IS_VALID_SUPPORT_THRESHOLD) {
@@ -200,17 +200,17 @@ void RayShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_sup
}
}
-bool RayShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool RayShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
return false; //simply not possible
}
-bool RayShapeSW::intersect_point(const Vector3 &p_point) const {
+bool RayShape3DSW::intersect_point(const Vector3 &p_point) const {
return false; //simply not possible
}
-Vector3 RayShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 RayShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
Vector3 s[2] = {
Vector3(0, 0, 0),
@@ -220,25 +220,25 @@ Vector3 RayShapeSW::get_closest_point_to(const Vector3 &p_point) const {
return Geometry::get_closest_point_to_segment(p_point, s);
}
-Vector3 RayShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 RayShape3DSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3();
}
-void RayShapeSW::_setup(real_t p_length, bool p_slips_on_slope) {
+void RayShape3DSW::_setup(real_t p_length, bool p_slips_on_slope) {
length = p_length;
slips_on_slope = p_slips_on_slope;
configure(AABB(Vector3(0, 0, 0), Vector3(0.1, 0.1, length)));
}
-void RayShapeSW::set_data(const Variant &p_data) {
+void RayShape3DSW::set_data(const Variant &p_data) {
Dictionary d = p_data;
_setup(d["length"], d["slips_on_slope"]);
}
-Variant RayShapeSW::get_data() const {
+Variant RayShape3DSW::get_data() const {
Dictionary d;
d["length"] = length;
@@ -246,7 +246,7 @@ Variant RayShapeSW::get_data() const {
return d;
}
-RayShapeSW::RayShapeSW() {
+RayShape3DSW::RayShape3DSW() {
length = 1;
slips_on_slope = false;
@@ -254,12 +254,12 @@ RayShapeSW::RayShapeSW() {
/********** SPHERE *************/
-real_t SphereShapeSW::get_radius() const {
+real_t SphereShape3DSW::get_radius() const {
return radius;
}
-void SphereShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void SphereShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
real_t d = p_normal.dot(p_transform.origin);
@@ -271,28 +271,28 @@ void SphereShapeSW::project_range(const Vector3 &p_normal, const Transform &p_tr
r_max = d + (radius)*scale;
}
-Vector3 SphereShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 SphereShape3DSW::get_support(const Vector3 &p_normal) const {
return p_normal * radius;
}
-void SphereShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
+void SphereShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
*r_supports = p_normal * radius;
r_amount = 1;
}
-bool SphereShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool SphereShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
return Geometry::segment_intersects_sphere(p_begin, p_end, Vector3(), radius, &r_result, &r_normal);
}
-bool SphereShapeSW::intersect_point(const Vector3 &p_point) const {
+bool SphereShape3DSW::intersect_point(const Vector3 &p_point) const {
return p_point.length() < radius;
}
-Vector3 SphereShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 SphereShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
Vector3 p = p_point;
float l = p.length();
@@ -301,36 +301,36 @@ Vector3 SphereShapeSW::get_closest_point_to(const Vector3 &p_point) const {
return (p / l) * radius;
}
-Vector3 SphereShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 SphereShape3DSW::get_moment_of_inertia(real_t p_mass) const {
real_t s = 0.4 * p_mass * radius * radius;
return Vector3(s, s, s);
}
-void SphereShapeSW::_setup(real_t p_radius) {
+void SphereShape3DSW::_setup(real_t p_radius) {
radius = p_radius;
configure(AABB(Vector3(-radius, -radius, -radius), Vector3(radius * 2.0, radius * 2.0, radius * 2.0)));
}
-void SphereShapeSW::set_data(const Variant &p_data) {
+void SphereShape3DSW::set_data(const Variant &p_data) {
_setup(p_data);
}
-Variant SphereShapeSW::get_data() const {
+Variant SphereShape3DSW::get_data() const {
return radius;
}
-SphereShapeSW::SphereShapeSW() {
+SphereShape3DSW::SphereShape3DSW() {
radius = 0;
}
/********** BOX *************/
-void BoxShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void BoxShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
// no matter the angle, the box is mirrored anyway
Vector3 local_normal = p_transform.basis.xform_inv(p_normal);
@@ -342,7 +342,7 @@ void BoxShapeSW::project_range(const Vector3 &p_normal, const Transform &p_trans
r_max = distance + length;
}
-Vector3 BoxShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 BoxShape3DSW::get_support(const Vector3 &p_normal) const {
Vector3 point(
(p_normal.x < 0) ? -half_extents.x : half_extents.x,
@@ -352,7 +352,7 @@ Vector3 BoxShapeSW::get_support(const Vector3 &p_normal) const {
return point;
}
-void BoxShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
+void BoxShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
static const int next[3] = { 1, 2, 0 };
static const int next2[3] = { 2, 0, 1 };
@@ -439,19 +439,19 @@ void BoxShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_sup
r_supports[0] = point;
}
-bool BoxShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool BoxShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
AABB aabb(-half_extents, half_extents * 2.0);
return aabb.intersects_segment(p_begin, p_end, &r_result, &r_normal);
}
-bool BoxShapeSW::intersect_point(const Vector3 &p_point) const {
+bool BoxShape3DSW::intersect_point(const Vector3 &p_point) const {
return (Math::abs(p_point.x) < half_extents.x && Math::abs(p_point.y) < half_extents.y && Math::abs(p_point.z) < half_extents.z);
}
-Vector3 BoxShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 BoxShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
int outside = 0;
Vector3 min_point;
@@ -502,7 +502,7 @@ Vector3 BoxShapeSW::get_closest_point_to(const Vector3 &p_point) const {
return min_point;
}
-Vector3 BoxShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 BoxShape3DSW::get_moment_of_inertia(real_t p_mass) const {
real_t lx = half_extents.x;
real_t ly = half_extents.y;
@@ -511,29 +511,29 @@ Vector3 BoxShapeSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3((p_mass / 3.0) * (ly * ly + lz * lz), (p_mass / 3.0) * (lx * lx + lz * lz), (p_mass / 3.0) * (lx * lx + ly * ly));
}
-void BoxShapeSW::_setup(const Vector3 &p_half_extents) {
+void BoxShape3DSW::_setup(const Vector3 &p_half_extents) {
half_extents = p_half_extents.abs();
configure(AABB(-half_extents, half_extents * 2));
}
-void BoxShapeSW::set_data(const Variant &p_data) {
+void BoxShape3DSW::set_data(const Variant &p_data) {
_setup(p_data);
}
-Variant BoxShapeSW::get_data() const {
+Variant BoxShape3DSW::get_data() const {
return half_extents;
}
-BoxShapeSW::BoxShapeSW() {
+BoxShape3DSW::BoxShape3DSW() {
}
/********** CAPSULE *************/
-void CapsuleShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void CapsuleShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
Vector3 n = p_transform.basis.xform_inv(p_normal).normalized();
real_t h = (n.z > 0) ? height : -height;
@@ -545,7 +545,7 @@ void CapsuleShapeSW::project_range(const Vector3 &p_normal, const Transform &p_t
r_min = p_normal.dot(p_transform.xform(-n));
}
-Vector3 CapsuleShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 CapsuleShape3DSW::get_support(const Vector3 &p_normal) const {
Vector3 n = p_normal;
@@ -556,7 +556,7 @@ Vector3 CapsuleShapeSW::get_support(const Vector3 &p_normal) const {
return n;
}
-void CapsuleShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
+void CapsuleShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
Vector3 n = p_normal;
@@ -586,7 +586,7 @@ void CapsuleShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r
}
}
-bool CapsuleShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool CapsuleShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
Vector3 norm = (p_end - p_begin).normalized();
real_t min_d = 1e20;
@@ -644,7 +644,7 @@ bool CapsuleShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_
return collision;
}
-bool CapsuleShapeSW::intersect_point(const Vector3 &p_point) const {
+bool CapsuleShape3DSW::intersect_point(const Vector3 &p_point) const {
if (Math::abs(p_point.z) < height * 0.5) {
return Vector3(p_point.x, p_point.y, 0).length() < radius;
@@ -655,7 +655,7 @@ bool CapsuleShapeSW::intersect_point(const Vector3 &p_point) const {
}
}
-Vector3 CapsuleShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 CapsuleShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
Vector3 s[2] = {
Vector3(0, 0, -height * 0.5),
@@ -670,7 +670,7 @@ Vector3 CapsuleShapeSW::get_closest_point_to(const Vector3 &p_point) const {
return p + (p_point - p).normalized() * radius;
}
-Vector3 CapsuleShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 CapsuleShape3DSW::get_moment_of_inertia(real_t p_mass) const {
// use bad AABB approximation
Vector3 extents = get_aabb().size * 0.5;
@@ -681,14 +681,14 @@ Vector3 CapsuleShapeSW::get_moment_of_inertia(real_t p_mass) const {
(p_mass / 3.0) * (extents.y * extents.y + extents.y * extents.y));
}
-void CapsuleShapeSW::_setup(real_t p_height, real_t p_radius) {
+void CapsuleShape3DSW::_setup(real_t p_height, real_t p_radius) {
height = p_height;
radius = p_radius;
configure(AABB(Vector3(-radius, -radius, -height * 0.5 - radius), Vector3(radius * 2, radius * 2, height + radius * 2.0)));
}
-void CapsuleShapeSW::set_data(const Variant &p_data) {
+void CapsuleShape3DSW::set_data(const Variant &p_data) {
Dictionary d = p_data;
ERR_FAIL_COND(!d.has("radius"));
@@ -696,7 +696,7 @@ void CapsuleShapeSW::set_data(const Variant &p_data) {
_setup(d["height"], d["radius"]);
}
-Variant CapsuleShapeSW::get_data() const {
+Variant CapsuleShape3DSW::get_data() const {
Dictionary d;
d["radius"] = radius;
@@ -704,14 +704,14 @@ Variant CapsuleShapeSW::get_data() const {
return d;
}
-CapsuleShapeSW::CapsuleShapeSW() {
+CapsuleShape3DSW::CapsuleShape3DSW() {
height = radius = 0;
}
/********** CONVEX POLYGON *************/
-void ConvexPolygonShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void ConvexPolygonShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
int vertex_count = mesh.vertices.size();
if (vertex_count == 0)
@@ -730,7 +730,7 @@ void ConvexPolygonShapeSW::project_range(const Vector3 &p_normal, const Transfor
}
}
-Vector3 ConvexPolygonShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 ConvexPolygonShape3DSW::get_support(const Vector3 &p_normal) const {
Vector3 n = p_normal;
@@ -756,7 +756,7 @@ Vector3 ConvexPolygonShapeSW::get_support(const Vector3 &p_normal) const {
return vrts[vert_support_idx];
}
-void ConvexPolygonShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
+void ConvexPolygonShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
const Geometry::MeshData::Face *faces = mesh.faces.ptr();
int fc = mesh.faces.size();
@@ -826,7 +826,7 @@ void ConvexPolygonShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vect
r_amount = 1;
}
-bool ConvexPolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool ConvexPolygonShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
const Geometry::MeshData::Face *faces = mesh.faces.ptr();
int fc = mesh.faces.size();
@@ -866,7 +866,7 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vecto
return col;
}
-bool ConvexPolygonShapeSW::intersect_point(const Vector3 &p_point) const {
+bool ConvexPolygonShape3DSW::intersect_point(const Vector3 &p_point) const {
const Geometry::MeshData::Face *faces = mesh.faces.ptr();
int fc = mesh.faces.size();
@@ -880,7 +880,7 @@ bool ConvexPolygonShapeSW::intersect_point(const Vector3 &p_point) const {
return true;
}
-Vector3 ConvexPolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 ConvexPolygonShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
const Geometry::MeshData::Face *faces = mesh.faces.ptr();
int fc = mesh.faces.size();
@@ -941,7 +941,7 @@ Vector3 ConvexPolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const
return min_point;
}
-Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 ConvexPolygonShape3DSW::get_moment_of_inertia(real_t p_mass) const {
// use bad AABB approximation
Vector3 extents = get_aabb().size * 0.5;
@@ -952,7 +952,7 @@ Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
(p_mass / 3.0) * (extents.y * extents.y + extents.y * extents.y));
}
-void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
+void ConvexPolygonShape3DSW::_setup(const Vector<Vector3> &p_vertices) {
Error err = QuickHull::build(p_vertices, mesh);
if (err != OK)
@@ -971,22 +971,22 @@ void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
configure(_aabb);
}
-void ConvexPolygonShapeSW::set_data(const Variant &p_data) {
+void ConvexPolygonShape3DSW::set_data(const Variant &p_data) {
_setup(p_data);
}
-Variant ConvexPolygonShapeSW::get_data() const {
+Variant ConvexPolygonShape3DSW::get_data() const {
return mesh.vertices;
}
-ConvexPolygonShapeSW::ConvexPolygonShapeSW() {
+ConvexPolygonShape3DSW::ConvexPolygonShape3DSW() {
}
/********** FACE POLYGON *************/
-void FaceShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void FaceShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
for (int i = 0; i < 3; i++) {
@@ -1001,7 +1001,7 @@ void FaceShapeSW::project_range(const Vector3 &p_normal, const Transform &p_tran
}
}
-Vector3 FaceShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 FaceShape3DSW::get_support(const Vector3 &p_normal) const {
int vert_support_idx = -1;
real_t support_max = 0;
@@ -1019,7 +1019,7 @@ Vector3 FaceShapeSW::get_support(const Vector3 &p_normal) const {
return vertex[vert_support_idx];
}
-void FaceShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
+void FaceShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const {
Vector3 n = p_normal;
@@ -1073,7 +1073,7 @@ void FaceShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_su
r_supports[0] = vertex[vert_support_idx];
}
-bool FaceShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool FaceShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
bool c = Geometry::segment_intersects_triangle(p_begin, p_end, vertex[0], vertex[1], vertex[2], &r_result);
if (c) {
@@ -1086,27 +1086,27 @@ bool FaceShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end
return c;
}
-bool FaceShapeSW::intersect_point(const Vector3 &p_point) const {
+bool FaceShape3DSW::intersect_point(const Vector3 &p_point) const {
return false; //face is flat
}
-Vector3 FaceShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 FaceShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
return Face3(vertex[0], vertex[1], vertex[2]).get_closest_point_to(p_point);
}
-Vector3 FaceShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 FaceShape3DSW::get_moment_of_inertia(real_t p_mass) const {
return Vector3(); // Sorry, but i don't think anyone cares, FaceShape!
}
-FaceShapeSW::FaceShapeSW() {
+FaceShape3DSW::FaceShape3DSW() {
configure(AABB());
}
-Vector<Vector3> ConcavePolygonShapeSW::get_faces() const {
+Vector<Vector3> ConcavePolygonShape3DSW::get_faces() const {
Vector<Vector3> rfaces;
rfaces.resize(faces.size() * 3);
@@ -1124,7 +1124,7 @@ Vector<Vector3> ConcavePolygonShapeSW::get_faces() const {
return rfaces;
}
-void ConcavePolygonShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void ConcavePolygonShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
int count = vertices.size();
if (count == 0) {
@@ -1145,7 +1145,7 @@ void ConcavePolygonShapeSW::project_range(const Vector3 &p_normal, const Transfo
}
}
-Vector3 ConcavePolygonShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 ConcavePolygonShape3DSW::get_support(const Vector3 &p_normal) const {
int count = vertices.size();
if (count == 0)
@@ -1171,7 +1171,7 @@ Vector3 ConcavePolygonShapeSW::get_support(const Vector3 &p_normal) const {
return vptr[vert_support_idx];
}
-void ConcavePolygonShapeSW::_cull_segment(int p_idx, _SegmentCullParams *p_params) const {
+void ConcavePolygonShape3DSW::_cull_segment(int p_idx, _SegmentCullParams *p_params) const {
const BVH *bvh = &p_params->bvh[p_idx];
@@ -1223,7 +1223,7 @@ void ConcavePolygonShapeSW::_cull_segment(int p_idx, _SegmentCullParams *p_param
}
}
-bool ConcavePolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
+bool ConcavePolygonShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
if (faces.size() == 0)
return false;
@@ -1258,17 +1258,17 @@ bool ConcavePolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vect
}
}
-bool ConcavePolygonShapeSW::intersect_point(const Vector3 &p_point) const {
+bool ConcavePolygonShape3DSW::intersect_point(const Vector3 &p_point) const {
return false; //face is flat
}
-Vector3 ConcavePolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 ConcavePolygonShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
return Vector3();
}
-void ConcavePolygonShapeSW::_cull(int p_idx, _CullParams *p_params) const {
+void ConcavePolygonShape3DSW::_cull(int p_idx, _CullParams *p_params) const {
const BVH *bvh = &p_params->bvh[p_idx];
@@ -1278,7 +1278,7 @@ void ConcavePolygonShapeSW::_cull(int p_idx, _CullParams *p_params) const {
if (bvh->face_index >= 0) {
const Face *f = &p_params->faces[bvh->face_index];
- FaceShapeSW *face = p_params->face;
+ FaceShape3DSW *face = p_params->face;
face->normal = f->normal;
face->vertex[0] = p_params->vertices[f->indices[0]];
face->vertex[1] = p_params->vertices[f->indices[1]];
@@ -1299,7 +1299,7 @@ void ConcavePolygonShapeSW::_cull(int p_idx, _CullParams *p_params) const {
}
}
-void ConcavePolygonShapeSW::cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const {
+void ConcavePolygonShape3DSW::cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const {
// make matrix local to concave
if (faces.size() == 0)
@@ -1312,7 +1312,7 @@ void ConcavePolygonShapeSW::cull(const AABB &p_local_aabb, Callback p_callback,
const Vector3 *vr = vertices.ptr();
const BVH *br = bvh.ptr();
- FaceShapeSW face; // use this to send in the callback
+ FaceShape3DSW face; // use this to send in the callback
_CullParams params;
params.aabb = local_aabb;
@@ -1327,7 +1327,7 @@ void ConcavePolygonShapeSW::cull(const AABB &p_local_aabb, Callback p_callback,
_cull(0, &params);
}
-Vector3 ConcavePolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 ConcavePolygonShape3DSW::get_moment_of_inertia(real_t p_mass) const {
// use bad AABB approximation
Vector3 extents = get_aabb().size * 0.5;
@@ -1433,7 +1433,7 @@ _VolumeSW_BVH *_volume_sw_build_bvh(_VolumeSW_BVH_Element *p_elements, int p_siz
return bvh;
}
-void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH *p_bvh_tree, BVH *p_bvh_array, int &p_idx) {
+void ConcavePolygonShape3DSW::_fill_bvh(_VolumeSW_BVH *p_bvh_tree, BVH *p_bvh_array, int &p_idx) {
int idx = p_idx;
@@ -1462,7 +1462,7 @@ void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH *p_bvh_tree, BVH *p_bvh_arra
memdelete(p_bvh_tree);
}
-void ConcavePolygonShapeSW::_setup(Vector<Vector3> p_faces) {
+void ConcavePolygonShape3DSW::_setup(Vector<Vector3> p_faces) {
int src_face_count = p_faces.size();
if (src_face_count == 0) {
@@ -1521,68 +1521,68 @@ void ConcavePolygonShapeSW::_setup(Vector<Vector3> p_faces) {
configure(_aabb); // this type of shape has no margin
}
-void ConcavePolygonShapeSW::set_data(const Variant &p_data) {
+void ConcavePolygonShape3DSW::set_data(const Variant &p_data) {
_setup(p_data);
}
-Variant ConcavePolygonShapeSW::get_data() const {
+Variant ConcavePolygonShape3DSW::get_data() const {
return get_faces();
}
-ConcavePolygonShapeSW::ConcavePolygonShapeSW() {
+ConcavePolygonShape3DSW::ConcavePolygonShape3DSW() {
}
/* HEIGHT MAP SHAPE */
-Vector<real_t> HeightMapShapeSW::get_heights() const {
+Vector<real_t> HeightMapShape3DSW::get_heights() const {
return heights;
}
-int HeightMapShapeSW::get_width() const {
+int HeightMapShape3DSW::get_width() const {
return width;
}
-int HeightMapShapeSW::get_depth() const {
+int HeightMapShape3DSW::get_depth() const {
return depth;
}
-real_t HeightMapShapeSW::get_cell_size() const {
+real_t HeightMapShape3DSW::get_cell_size() const {
return cell_size;
}
-void HeightMapShapeSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
+void HeightMapShape3DSW::project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
//not very useful, but not very used either
p_transform.xform(get_aabb()).project_range_in_plane(Plane(p_normal, 0), r_min, r_max);
}
-Vector3 HeightMapShapeSW::get_support(const Vector3 &p_normal) const {
+Vector3 HeightMapShape3DSW::get_support(const Vector3 &p_normal) const {
//not very useful, but not very used either
return get_aabb().get_support(p_normal);
}
-bool HeightMapShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const {
+bool HeightMapShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const {
return false;
}
-bool HeightMapShapeSW::intersect_point(const Vector3 &p_point) const {
+bool HeightMapShape3DSW::intersect_point(const Vector3 &p_point) const {
return false;
}
-Vector3 HeightMapShapeSW::get_closest_point_to(const Vector3 &p_point) const {
+Vector3 HeightMapShape3DSW::get_closest_point_to(const Vector3 &p_point) const {
return Vector3();
}
-void HeightMapShapeSW::cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const {
+void HeightMapShape3DSW::cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const {
}
-Vector3 HeightMapShapeSW::get_moment_of_inertia(real_t p_mass) const {
+Vector3 HeightMapShape3DSW::get_moment_of_inertia(real_t p_mass) const {
// use bad AABB approximation
Vector3 extents = get_aabb().size * 0.5;
@@ -1593,7 +1593,7 @@ Vector3 HeightMapShapeSW::get_moment_of_inertia(real_t p_mass) const {
(p_mass / 3.0) * (extents.y * extents.y + extents.y * extents.y));
}
-void HeightMapShapeSW::_setup(Vector<real_t> p_heights, int p_width, int p_depth, real_t p_cell_size) {
+void HeightMapShape3DSW::_setup(Vector<real_t> p_heights, int p_width, int p_depth, real_t p_cell_size) {
heights = p_heights;
width = p_width;
@@ -1621,7 +1621,7 @@ void HeightMapShapeSW::_setup(Vector<real_t> p_heights, int p_width, int p_depth
configure(aabb);
}
-void HeightMapShapeSW::set_data(const Variant &p_data) {
+void HeightMapShape3DSW::set_data(const Variant &p_data) {
ERR_FAIL_COND(p_data.get_type() != Variant::DICTIONARY);
Dictionary d = p_data;
@@ -1642,12 +1642,12 @@ void HeightMapShapeSW::set_data(const Variant &p_data) {
_setup(heights, width, depth, cell_size);
}
-Variant HeightMapShapeSW::get_data() const {
+Variant HeightMapShape3DSW::get_data() const {
ERR_FAIL_V(Variant());
}
-HeightMapShapeSW::HeightMapShapeSW() {
+HeightMapShape3DSW::HeightMapShape3DSW() {
width = 0;
depth = 0;
diff --git a/servers/physics/shape_sw.h b/servers/physics_3d/shape_3d_sw.h
index eaae64be66..f10bd0771b 100644
--- a/servers/physics/shape_sw.h
+++ b/servers/physics_3d/shape_3d_sw.h
@@ -32,7 +32,7 @@
#define SHAPE_SW_H
#include "core/math/geometry.h"
-#include "servers/physics_server.h"
+#include "servers/physics_server_3d.h"
/*
SHAPE_LINE, ///< plane:"plane"
@@ -45,24 +45,24 @@ SHAPE_CUSTOM, ///< Server-Implementation based custom shape, calling shape_creat
*/
-class ShapeSW;
+class Shape3DSW;
-class ShapeOwnerSW {
+class ShapeOwner3DSW {
public:
virtual void _shape_changed() = 0;
- virtual void remove_shape(ShapeSW *p_shape) = 0;
+ virtual void remove_shape(Shape3DSW *p_shape) = 0;
- virtual ~ShapeOwnerSW() {}
+ virtual ~ShapeOwner3DSW() {}
};
-class ShapeSW {
+class Shape3DSW {
RID self;
AABB aabb;
bool configured;
real_t custom_bias;
- Map<ShapeOwnerSW *, int> owners;
+ Map<ShapeOwner3DSW *, int> owners;
protected:
void configure(const AABB &p_aabb);
@@ -77,7 +77,7 @@ public:
_FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; }
_FORCE_INLINE_ RID get_self() const { return self; }
- virtual PhysicsServer::ShapeType get_type() const = 0;
+ virtual PhysicsServer3D::ShapeType get_type() const = 0;
_FORCE_INLINE_ AABB get_aabb() const { return aabb; }
_FORCE_INLINE_ bool is_configured() const { return configured; }
@@ -98,28 +98,28 @@ public:
_FORCE_INLINE_ void set_custom_bias(real_t p_bias) { custom_bias = p_bias; }
_FORCE_INLINE_ real_t get_custom_bias() const { return custom_bias; }
- void add_owner(ShapeOwnerSW *p_owner);
- void remove_owner(ShapeOwnerSW *p_owner);
- bool is_owner(ShapeOwnerSW *p_owner) const;
- const Map<ShapeOwnerSW *, int> &get_owners() const;
+ void add_owner(ShapeOwner3DSW *p_owner);
+ void remove_owner(ShapeOwner3DSW *p_owner);
+ bool is_owner(ShapeOwner3DSW *p_owner) const;
+ const Map<ShapeOwner3DSW *, int> &get_owners() const;
- ShapeSW();
- virtual ~ShapeSW();
+ Shape3DSW();
+ virtual ~Shape3DSW();
};
-class ConcaveShapeSW : public ShapeSW {
+class ConcaveShape3DSW : public Shape3DSW {
public:
virtual bool is_concave() const { return true; }
- typedef void (*Callback)(void *p_userdata, ShapeSW *p_convex);
+ typedef void (*Callback)(void *p_userdata, Shape3DSW *p_convex);
virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const { r_amount = 0; }
virtual void cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const = 0;
- ConcaveShapeSW() {}
+ ConcaveShape3DSW() {}
};
-class PlaneShapeSW : public ShapeSW {
+class PlaneShape3DSW : public Shape3DSW {
Plane plane;
@@ -129,7 +129,7 @@ public:
Plane get_plane() const;
virtual real_t get_area() const { return Math_INF; }
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_PLANE; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_PLANE; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const { r_amount = 0; }
@@ -142,10 +142,10 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- PlaneShapeSW();
+ PlaneShape3DSW();
};
-class RayShapeSW : public ShapeSW {
+class RayShape3DSW : public Shape3DSW {
real_t length;
bool slips_on_slope;
@@ -157,7 +157,7 @@ public:
bool get_slips_on_slope() const;
virtual real_t get_area() const { return 0.0; }
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_RAY; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_RAY; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const;
@@ -171,10 +171,10 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- RayShapeSW();
+ RayShape3DSW();
};
-class SphereShapeSW : public ShapeSW {
+class SphereShape3DSW : public Shape3DSW {
real_t radius;
@@ -185,7 +185,7 @@ public:
virtual real_t get_area() const { return 4.0 / 3.0 * Math_PI * radius * radius * radius; }
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_SPHERE; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_SPHERE; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
@@ -199,10 +199,10 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- SphereShapeSW();
+ SphereShape3DSW();
};
-class BoxShapeSW : public ShapeSW {
+class BoxShape3DSW : public Shape3DSW {
Vector3 half_extents;
void _setup(const Vector3 &p_half_extents);
@@ -211,7 +211,7 @@ public:
_FORCE_INLINE_ Vector3 get_half_extents() const { return half_extents; }
virtual real_t get_area() const { return 8 * half_extents.x * half_extents.y * half_extents.z; }
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_BOX; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_BOX; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
@@ -225,10 +225,10 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- BoxShapeSW();
+ BoxShape3DSW();
};
-class CapsuleShapeSW : public ShapeSW {
+class CapsuleShape3DSW : public Shape3DSW {
real_t height;
real_t radius;
@@ -241,7 +241,7 @@ public:
virtual real_t get_area() const { return 4.0 / 3.0 * Math_PI * radius * radius * radius + height * Math_PI * radius * radius; }
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CAPSULE; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_CAPSULE; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
@@ -255,10 +255,10 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- CapsuleShapeSW();
+ CapsuleShape3DSW();
};
-struct ConvexPolygonShapeSW : public ShapeSW {
+struct ConvexPolygonShape3DSW : public Shape3DSW {
Geometry::MeshData mesh;
@@ -267,7 +267,7 @@ struct ConvexPolygonShapeSW : public ShapeSW {
public:
const Geometry::MeshData &get_mesh() const { return mesh; }
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CONVEX_POLYGON; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_CONVEX_POLYGON; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
@@ -281,13 +281,13 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- ConvexPolygonShapeSW();
+ ConvexPolygonShape3DSW();
};
struct _VolumeSW_BVH;
-struct FaceShapeSW;
+struct FaceShape3DSW;
-struct ConcavePolygonShapeSW : public ConcaveShapeSW {
+struct ConcavePolygonShape3DSW : public ConcaveShape3DSW {
// always a trimesh
struct Face {
@@ -318,7 +318,7 @@ struct ConcavePolygonShapeSW : public ConcaveShapeSW {
const Face *faces;
const Vector3 *vertices;
const BVH *bvh;
- FaceShapeSW *face;
+ FaceShape3DSW *face;
};
struct _SegmentCullParams {
@@ -346,7 +346,7 @@ struct ConcavePolygonShapeSW : public ConcaveShapeSW {
public:
Vector<Vector3> get_faces() const;
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CONCAVE_POLYGON; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_CONCAVE_POLYGON; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
@@ -362,10 +362,10 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- ConcavePolygonShapeSW();
+ ConcavePolygonShape3DSW();
};
-struct HeightMapShapeSW : public ConcaveShapeSW {
+struct HeightMapShape3DSW : public ConcaveShape3DSW {
Vector<real_t> heights;
int width;
@@ -383,7 +383,7 @@ public:
int get_depth() const;
real_t get_cell_size() const;
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_HEIGHTMAP; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_HEIGHTMAP; }
virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const;
virtual Vector3 get_support(const Vector3 &p_normal) const;
@@ -398,16 +398,16 @@ public:
virtual void set_data(const Variant &p_data);
virtual Variant get_data() const;
- HeightMapShapeSW();
+ HeightMapShape3DSW();
};
//used internally
-struct FaceShapeSW : public ShapeSW {
+struct FaceShape3DSW : public Shape3DSW {
Vector3 normal; //cache
Vector3 vertex[3];
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CONCAVE_POLYGON; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_CONCAVE_POLYGON; }
const Vector3 &get_vertex(int p_idx) const { return vertex[p_idx]; }
@@ -423,15 +423,15 @@ struct FaceShapeSW : public ShapeSW {
virtual void set_data(const Variant &p_data) {}
virtual Variant get_data() const { return Variant(); }
- FaceShapeSW();
+ FaceShape3DSW();
};
-struct MotionShapeSW : public ShapeSW {
+struct MotionShape3DSW : public Shape3DSW {
- ShapeSW *shape;
+ Shape3DSW *shape;
Vector3 motion;
- virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CONVEX_POLYGON; }
+ virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_CONVEX_POLYGON; }
void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const {
@@ -464,7 +464,7 @@ struct MotionShapeSW : public ShapeSW {
virtual void set_data(const Variant &p_data) {}
virtual Variant get_data() const { return Variant(); }
- MotionShapeSW() { configure(AABB()); }
+ MotionShape3DSW() { configure(AABB()); }
};
#endif // SHAPE_SW_H
diff --git a/servers/physics/space_sw.cpp b/servers/physics_3d/space_3d_sw.cpp
index 110520db5a..e7b2c7bfd7 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics_3d/space_3d_sw.cpp
@@ -28,31 +28,31 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "space_sw.h"
+#include "space_3d_sw.h"
-#include "collision_solver_sw.h"
+#include "collision_solver_3d_sw.h"
#include "core/project_settings.h"
-#include "physics_server_sw.h"
+#include "physics_server_3d_sw.h"
-_FORCE_INLINE_ static bool _can_collide_with(CollisionObjectSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+_FORCE_INLINE_ static bool _can_collide_with(CollisionObject3DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
if (!(p_object->get_collision_layer() & p_collision_mask)) {
return false;
}
- if (p_object->get_type() == CollisionObjectSW::TYPE_AREA && !p_collide_with_areas)
+ if (p_object->get_type() == CollisionObject3DSW::TYPE_AREA && !p_collide_with_areas)
return false;
- if (p_object->get_type() == CollisionObjectSW::TYPE_BODY && !p_collide_with_bodies)
+ if (p_object->get_type() == CollisionObject3DSW::TYPE_BODY && !p_collide_with_bodies)
return false;
return true;
}
-int PhysicsDirectSpaceStateSW::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+int PhysicsDirectSpaceState3DSW::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
ERR_FAIL_COND_V(space->locked, false);
- int amount = space->broadphase->cull_point(p_point, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int amount = space->broadphase->cull_point(p_point, space->intersection_query_results, Space3DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
int cc = 0;
//Transform ai = p_xform.affine_inverse();
@@ -70,7 +70,7 @@ int PhysicsDirectSpaceStateSW::intersect_point(const Vector3 &p_point, ShapeResu
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
continue;
- const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = space->intersection_query_results[i];
int shape_idx = space->intersection_query_subindex_results[i];
Transform inv_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx);
@@ -93,7 +93,7 @@ int PhysicsDirectSpaceStateSW::intersect_point(const Vector3 &p_point, ShapeResu
return cc;
}
-bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_pick_ray) {
+bool PhysicsDirectSpaceState3DSW::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_pick_ray) {
ERR_FAIL_COND_V(space->locked, false);
@@ -103,14 +103,14 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
end = p_to;
normal = (end - begin).normalized();
- int amount = space->broadphase->cull_segment(begin, end, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int amount = space->broadphase->cull_segment(begin, end, space->intersection_query_results, Space3DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
//todo, create another array that references results, compute AABBs and check closest point to ray origin, sort, and stop evaluating results when beyond first collision
bool collided = false;
Vector3 res_point, res_normal;
int res_shape;
- const CollisionObjectSW *res_obj;
+ const CollisionObject3DSW *res_obj;
real_t min_d = 1e10;
for (int i = 0; i < amount; i++) {
@@ -124,7 +124,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
continue;
- const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = space->intersection_query_results[i];
int shape_idx = space->intersection_query_subindex_results[i];
Transform inv_xform = col_obj->get_shape_inv_transform(shape_idx) * col_obj->get_inv_transform();
@@ -132,7 +132,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
Vector3 local_from = inv_xform.xform(begin);
Vector3 local_to = inv_xform.xform(end);
- const ShapeSW *shape = col_obj->get_shape(shape_idx);
+ const Shape3DSW *shape = col_obj->get_shape(shape_idx);
Vector3 shape_point, shape_normal;
@@ -171,17 +171,17 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
return true;
}
-int PhysicsDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transform &p_xform, real_t p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+int PhysicsDirectSpaceState3DSW::intersect_shape(const RID &p_shape, const Transform &p_xform, real_t p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
if (p_result_max <= 0)
return 0;
- ShapeSW *shape = static_cast<PhysicsServerSW *>(PhysicsServer::get_singleton())->shape_owner.getornull(p_shape);
+ Shape3DSW *shape = static_cast<PhysicsServer3DSW *>(PhysicsServer3D::get_singleton())->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
AABB aabb = p_xform.xform(shape->get_aabb());
- int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space3DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
int cc = 0;
@@ -200,10 +200,10 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transfo
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
continue;
- const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = space->intersection_query_results[i];
int shape_idx = space->intersection_query_subindex_results[i];
- if (!CollisionSolverSW::solve_static(shape, p_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), NULL, NULL, NULL, p_margin, 0))
+ if (!CollisionSolver3DSW::solve_static(shape, p_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), NULL, NULL, NULL, p_margin, 0))
continue;
if (r_results) {
@@ -222,22 +222,22 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transfo
return cc;
}
-bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, real_t p_margin, real_t &p_closest_safe, real_t &p_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, ShapeRestInfo *r_info) {
+bool PhysicsDirectSpaceState3DSW::cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, real_t p_margin, real_t &p_closest_safe, real_t &p_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, ShapeRestInfo *r_info) {
- ShapeSW *shape = static_cast<PhysicsServerSW *>(PhysicsServer::get_singleton())->shape_owner.getornull(p_shape);
+ Shape3DSW *shape = static_cast<PhysicsServer3DSW *>(PhysicsServer3D::get_singleton())->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, false);
AABB aabb = p_xform.xform(shape->get_aabb());
aabb = aabb.merge(AABB(aabb.position + p_motion, aabb.size)); //motion
aabb = aabb.grow(p_margin);
- int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space3DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
real_t best_safe = 1;
real_t best_unsafe = 1;
Transform xform_inv = p_xform.affine_inverse();
- MotionShapeSW mshape;
+ MotionShape3DSW mshape;
mshape.shape = shape;
mshape.motion = xform_inv.basis.xform(p_motion);
@@ -253,7 +253,7 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
continue; //ignore excluded
- const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = space->intersection_query_results[i];
int shape_idx = space->intersection_query_subindex_results[i];
Vector3 point_A, point_B;
@@ -261,14 +261,14 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
Transform col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx);
//test initial overlap, does it collide if going all the way?
- if (CollisionSolverSW::solve_distance(&mshape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, aabb, &sep_axis)) {
+ if (CollisionSolver3DSW::solve_distance(&mshape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, aabb, &sep_axis)) {
continue;
}
//test initial overlap
sep_axis = p_motion.normalized();
- if (!CollisionSolverSW::solve_distance(shape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, aabb, &sep_axis)) {
+ if (!CollisionSolver3DSW::solve_distance(shape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, aabb, &sep_axis)) {
return false;
}
@@ -287,7 +287,7 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
Vector3 lA, lB;
- bool collided = !CollisionSolverSW::solve_distance(&mshape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, lA, lB, aabb, &sep);
+ bool collided = !CollisionSolver3DSW::solve_distance(&mshape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, lA, lB, aabb, &sep);
if (collided) {
@@ -315,8 +315,8 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
r_info->point = closest_B;
r_info->normal = (closest_A - closest_B).normalized();
best_first = false;
- if (col_obj->get_type() == CollisionObjectSW::TYPE_BODY) {
- const BodySW *body = static_cast<const BodySW *>(col_obj);
+ if (col_obj->get_type() == CollisionObject3DSW::TYPE_BODY) {
+ const Body3DSW *body = static_cast<const Body3DSW *>(col_obj);
r_info->linear_velocity = body->get_linear_velocity() + (body->get_angular_velocity()).cross(body->get_transform().origin - closest_B);
}
}
@@ -328,43 +328,43 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
return true;
}
-bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform &p_shape_xform, real_t p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+bool PhysicsDirectSpaceState3DSW::collide_shape(RID p_shape, const Transform &p_shape_xform, real_t p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
if (p_result_max <= 0)
return 0;
- ShapeSW *shape = static_cast<PhysicsServerSW *>(PhysicsServer::get_singleton())->shape_owner.getornull(p_shape);
+ Shape3DSW *shape = static_cast<PhysicsServer3DSW *>(PhysicsServer3D::get_singleton())->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
AABB aabb = p_shape_xform.xform(shape->get_aabb());
aabb = aabb.grow(p_margin);
- int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space3DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
bool collided = false;
r_result_count = 0;
- PhysicsServerSW::CollCbkData cbk;
+ PhysicsServer3DSW::CollCbkData cbk;
cbk.max = p_result_max;
cbk.amount = 0;
cbk.ptr = r_results;
- CollisionSolverSW::CallbackResult cbkres = PhysicsServerSW::_shape_col_cbk;
+ CollisionSolver3DSW::CallbackResult cbkres = PhysicsServer3DSW::_shape_col_cbk;
- PhysicsServerSW::CollCbkData *cbkptr = &cbk;
+ PhysicsServer3DSW::CollCbkData *cbkptr = &cbk;
for (int i = 0; i < amount; i++) {
if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas))
continue;
- const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = space->intersection_query_results[i];
int shape_idx = space->intersection_query_subindex_results[i];
if (p_exclude.has(col_obj->get_self())) {
continue;
}
- if (CollisionSolverSW::solve_static(shape, p_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
+ if (CollisionSolver3DSW::solve_static(shape, p_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
collided = true;
}
}
@@ -376,8 +376,8 @@ bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform &p_sh
struct _RestCallbackData {
- const CollisionObjectSW *object;
- const CollisionObjectSW *best_object;
+ const CollisionObject3DSW *object;
+ const CollisionObject3DSW *best_object;
int shape;
int best_shape;
Vector3 best_contact;
@@ -403,15 +403,15 @@ static void _rest_cbk_result(const Vector3 &p_point_A, const Vector3 &p_point_B,
rd->best_object = rd->object;
rd->best_shape = rd->shape;
}
-bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_xform, real_t p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+bool PhysicsDirectSpaceState3DSW::rest_info(RID p_shape, const Transform &p_shape_xform, real_t p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
- ShapeSW *shape = static_cast<PhysicsServerSW *>(PhysicsServer::get_singleton())->shape_owner.getornull(p_shape);
+ Shape3DSW *shape = static_cast<PhysicsServer3DSW *>(PhysicsServer3D::get_singleton())->shape_owner.getornull(p_shape);
ERR_FAIL_COND_V(!shape, 0);
AABB aabb = p_shape_xform.xform(shape->get_aabb());
aabb = aabb.grow(p_margin);
- int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
+ int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space3DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results);
_RestCallbackData rcd;
rcd.best_len = 0;
@@ -424,7 +424,7 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas))
continue;
- const CollisionObjectSW *col_obj = space->intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = space->intersection_query_results[i];
int shape_idx = space->intersection_query_subindex_results[i];
if (p_exclude.has(col_obj->get_self()))
@@ -432,7 +432,7 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
rcd.object = col_obj;
rcd.shape = shape_idx;
- bool sc = CollisionSolverSW::solve_static(shape, p_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, NULL, p_margin);
+ bool sc = CollisionSolver3DSW::solve_static(shape, p_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, NULL, p_margin);
if (!sc)
continue;
}
@@ -445,9 +445,9 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
r_info->normal = rcd.best_normal;
r_info->point = rcd.best_contact;
r_info->rid = rcd.best_object->get_self();
- if (rcd.best_object->get_type() == CollisionObjectSW::TYPE_BODY) {
+ if (rcd.best_object->get_type() == CollisionObject3DSW::TYPE_BODY) {
- const BodySW *body = static_cast<const BodySW *>(rcd.best_object);
+ const Body3DSW *body = static_cast<const Body3DSW *>(rcd.best_object);
r_info->linear_velocity = body->get_linear_velocity() +
(body->get_angular_velocity()).cross(body->get_transform().origin - rcd.best_contact); // * mPos);
@@ -458,11 +458,11 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
return true;
}
-Vector3 PhysicsDirectSpaceStateSW::get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const {
+Vector3 PhysicsDirectSpaceState3DSW::get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const {
- CollisionObjectSW *obj = PhysicsServerSW::singleton->area_owner.getornull(p_object);
+ CollisionObject3DSW *obj = PhysicsServer3DSW::singleton->area_owner.getornull(p_object);
if (!obj) {
- obj = PhysicsServerSW::singleton->body_owner.getornull(p_object);
+ obj = PhysicsServer3DSW::singleton->body_owner.getornull(p_object);
}
ERR_FAIL_COND_V(!obj, Vector3());
@@ -479,7 +479,7 @@ Vector3 PhysicsDirectSpaceStateSW::get_closest_point_to_object_volume(RID p_obje
continue;
Transform shape_xform = obj->get_transform() * obj->get_shape_transform(i);
- ShapeSW *shape = obj->get_shape(i);
+ Shape3DSW *shape = obj->get_shape(i);
Vector3 point = shape->get_closest_point_to(shape_xform.affine_inverse().xform(p_point));
point = shape_xform.xform(point);
@@ -499,14 +499,14 @@ Vector3 PhysicsDirectSpaceStateSW::get_closest_point_to_object_volume(RID p_obje
}
}
-PhysicsDirectSpaceStateSW::PhysicsDirectSpaceStateSW() {
+PhysicsDirectSpaceState3DSW::PhysicsDirectSpaceState3DSW() {
space = NULL;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
-int SpaceSW::_cull_aabb_for_body(BodySW *p_body, const AABB &p_aabb) {
+int Space3DSW::_cull_aabb_for_body(Body3DSW *p_body, const AABB &p_aabb) {
int amount = broadphase->cull_aabb(p_aabb, intersection_query_results, INTERSECTION_QUERY_MAX, intersection_query_subindex_results);
@@ -516,13 +516,13 @@ int SpaceSW::_cull_aabb_for_body(BodySW *p_body, const AABB &p_aabb) {
if (intersection_query_results[i] == p_body)
keep = false;
- else if (intersection_query_results[i]->get_type() == CollisionObjectSW::TYPE_AREA)
+ else if (intersection_query_results[i]->get_type() == CollisionObject3DSW::TYPE_AREA)
keep = false;
- else if ((static_cast<BodySW *>(intersection_query_results[i])->test_collision_mask(p_body)) == 0)
+ else if ((static_cast<Body3DSW *>(intersection_query_results[i])->test_collision_mask(p_body)) == 0)
keep = false;
- else if (static_cast<BodySW *>(intersection_query_results[i])->has_exception(p_body->get_self()) || p_body->has_exception(intersection_query_results[i]->get_self()))
+ else if (static_cast<Body3DSW *>(intersection_query_results[i])->has_exception(p_body->get_self()) || p_body->has_exception(intersection_query_results[i]->get_self()))
keep = false;
- else if (static_cast<BodySW *>(intersection_query_results[i])->is_shape_set_as_disabled(intersection_query_subindex_results[i]))
+ else if (static_cast<Body3DSW *>(intersection_query_results[i])->is_shape_set_as_disabled(intersection_query_subindex_results[i]))
keep = false;
if (!keep) {
@@ -540,7 +540,7 @@ int SpaceSW::_cull_aabb_for_body(BodySW *p_body, const AABB &p_aabb) {
return amount;
}
-int SpaceSW::test_body_ray_separation(BodySW *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer::SeparationResult *r_results, int p_result_max, real_t p_margin) {
+int Space3DSW::test_body_ray_separation(Body3DSW *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer3D::SeparationResult *r_results, int p_result_max, real_t p_margin) {
AABB body_aabb;
@@ -581,10 +581,10 @@ int SpaceSW::test_body_ray_separation(BodySW *p_body, const Transform &p_transfo
const int max_results = 32;
int recover_attempts = 4;
Vector3 sr[max_results * 2];
- PhysicsServerSW::CollCbkData cbk;
+ PhysicsServer3DSW::CollCbkData cbk;
cbk.max = max_results;
- PhysicsServerSW::CollCbkData *cbkptr = &cbk;
- CollisionSolverSW::CallbackResult cbkres = PhysicsServerSW::_shape_col_cbk;
+ PhysicsServer3DSW::CollCbkData *cbkptr = &cbk;
+ CollisionSolver3DSW::CallbackResult cbkres = PhysicsServer3DSW::_shape_col_cbk;
do {
@@ -598,30 +598,30 @@ int SpaceSW::test_body_ray_separation(BodySW *p_body, const Transform &p_transfo
if (p_body->is_shape_set_as_disabled(j))
continue;
- ShapeSW *body_shape = p_body->get_shape(j);
+ Shape3DSW *body_shape = p_body->get_shape(j);
- if (body_shape->get_type() != PhysicsServer::SHAPE_RAY)
+ if (body_shape->get_type() != PhysicsServer3D::SHAPE_RAY)
continue;
Transform body_shape_xform = body_transform * p_body->get_shape_transform(j);
for (int i = 0; i < amount; i++) {
- const CollisionObjectSW *col_obj = intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
cbk.amount = 0;
cbk.ptr = sr;
- if (CollisionObjectSW::TYPE_BODY == col_obj->get_type()) {
- const BodySW *b = static_cast<const BodySW *>(col_obj);
- if (p_infinite_inertia && PhysicsServer::BODY_MODE_STATIC != b->get_mode() && PhysicsServer::BODY_MODE_KINEMATIC != b->get_mode()) {
+ if (CollisionObject3DSW::TYPE_BODY == col_obj->get_type()) {
+ const Body3DSW *b = static_cast<const Body3DSW *>(col_obj);
+ if (p_infinite_inertia && PhysicsServer3D::BODY_MODE_STATIC != b->get_mode() && PhysicsServer3D::BODY_MODE_KINEMATIC != b->get_mode()) {
continue;
}
}
- ShapeSW *against_shape = col_obj->get_shape(shape_idx);
- if (CollisionSolverSW::solve_static(body_shape, body_shape_xform, against_shape, col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
+ Shape3DSW *against_shape = col_obj->get_shape(shape_idx);
+ if (CollisionSolver3DSW::solve_static(body_shape, body_shape_xform, against_shape, col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
if (cbk.amount > 0) {
collided = true;
}
@@ -639,7 +639,7 @@ int SpaceSW::test_body_ray_separation(BodySW *p_body, const Transform &p_transfo
}
if (ray_index != -1) {
- PhysicsServer::SeparationResult &result = r_results[ray_index];
+ PhysicsServer3D::SeparationResult &result = r_results[ray_index];
for (int k = 0; k < cbk.amount; k++) {
Vector3 a = sr[k * 2 + 0];
@@ -658,8 +658,8 @@ int SpaceSW::test_body_ray_separation(BodySW *p_body, const Transform &p_transfo
result.collider_id = col_obj->get_instance_id();
result.collider_shape = shape_idx;
//result.collider_metadata = col_obj->get_shape_metadata(shape_idx);
- if (col_obj->get_type() == CollisionObjectSW::TYPE_BODY) {
- BodySW *body = (BodySW *)col_obj;
+ if (col_obj->get_type() == CollisionObject3DSW::TYPE_BODY) {
+ Body3DSW *body = (Body3DSW *)col_obj;
Vector3 rel_vec = b - body->get_transform().get_origin();
//result.collider_velocity = Vector3(-body->get_angular_velocity() * rel_vec.y, body->get_angular_velocity() * rel_vec.x) + body->get_linear_velocity();
@@ -695,7 +695,7 @@ int SpaceSW::test_body_ray_separation(BodySW *p_body, const Transform &p_transfo
return rays_found;
}
-bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, real_t p_margin, PhysicsServer::MotionResult *r_result, bool p_exclude_raycast_shapes) {
+bool Space3DSW::test_body_motion(Body3DSW *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, real_t p_margin, PhysicsServer3D::MotionResult *r_result, bool p_exclude_raycast_shapes) {
//give me back regular physics engine logic
//this is madness
@@ -726,7 +726,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
if (!shapes_found) {
if (r_result) {
- *r_result = PhysicsServer::MotionResult();
+ *r_result = PhysicsServer3D::MotionResult();
r_result->motion = p_motion;
}
@@ -748,13 +748,13 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
do {
- PhysicsServerSW::CollCbkData cbk;
+ PhysicsServer3DSW::CollCbkData cbk;
cbk.max = max_results;
cbk.amount = 0;
cbk.ptr = sr;
- PhysicsServerSW::CollCbkData *cbkptr = &cbk;
- CollisionSolverSW::CallbackResult cbkres = PhysicsServerSW::_shape_col_cbk;
+ PhysicsServer3DSW::CollCbkData *cbkptr = &cbk;
+ CollisionSolver3DSW::CallbackResult cbkres = PhysicsServer3DSW::_shape_col_cbk;
bool collided = false;
@@ -765,17 +765,17 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
continue;
Transform body_shape_xform = body_transform * p_body->get_shape_transform(j);
- ShapeSW *body_shape = p_body->get_shape(j);
- if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer::SHAPE_RAY) {
+ Shape3DSW *body_shape = p_body->get_shape(j);
+ if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer3D::SHAPE_RAY) {
continue;
}
for (int i = 0; i < amount; i++) {
- const CollisionObjectSW *col_obj = intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
- if (CollisionSolverSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
+ if (CollisionSolver3DSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) {
collided = cbk.amount > 0;
}
}
@@ -826,14 +826,14 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
continue;
Transform body_shape_xform = body_transform * p_body->get_shape_transform(j);
- ShapeSW *body_shape = p_body->get_shape(j);
+ Shape3DSW *body_shape = p_body->get_shape(j);
- if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer::SHAPE_RAY) {
+ if (p_exclude_raycast_shapes && body_shape->get_type() == PhysicsServer3D::SHAPE_RAY) {
continue;
}
Transform body_shape_xform_inv = body_shape_xform.affine_inverse();
- MotionShapeSW mshape;
+ MotionShape3DSW mshape;
mshape.shape = body_shape;
mshape.motion = body_shape_xform_inv.basis.xform(p_motion);
@@ -844,7 +844,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
for (int i = 0; i < amount; i++) {
- const CollisionObjectSW *col_obj = intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
//test initial overlap, does it collide if going all the way?
@@ -853,12 +853,12 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
Transform col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx);
//test initial overlap, does it collide if going all the way?
- if (CollisionSolverSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) {
+ if (CollisionSolver3DSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) {
continue;
}
sep_axis = p_motion.normalized();
- if (!CollisionSolverSW::solve_distance(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) {
+ if (!CollisionSolver3DSW::solve_distance(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) {
stuck = true;
break;
}
@@ -878,7 +878,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
Vector3 lA, lB;
- bool collided = !CollisionSolverSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, lA, lB, motion_aabb, &sep);
+ bool collided = !CollisionSolver3DSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, lA, lB, motion_aabb, &sep);
if (collided) {
@@ -940,7 +940,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
rcd.min_allowed_depth = test_motion_min_contact_depth;
Transform body_shape_xform = ugt * p_body->get_shape_transform(best_shape);
- ShapeSW *body_shape = p_body->get_shape(best_shape);
+ Shape3DSW *body_shape = p_body->get_shape(best_shape);
body_aabb.position += p_motion * unsafe;
@@ -948,12 +948,12 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
for (int i = 0; i < amount; i++) {
- const CollisionObjectSW *col_obj = intersection_query_results[i];
+ const CollisionObject3DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
rcd.object = col_obj;
rcd.shape = shape_idx;
- bool sc = CollisionSolverSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, NULL, p_margin);
+ bool sc = CollisionSolver3DSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, NULL, p_margin);
if (!sc)
continue;
}
@@ -969,7 +969,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
r_result->collision_point = rcd.best_contact;
//r_result->collider_metadata = rcd.best_object->get_shape_metadata(rcd.best_shape);
- const BodySW *body = static_cast<const BodySW *>(rcd.best_object);
+ const Body3DSW *body = static_cast<const Body3DSW *>(rcd.best_object);
//Vector3 rel_vec = r_result->collision_point - body->get_transform().get_origin();
// r_result->collider_velocity = Vector3(-body->get_angular_velocity() * rel_vec.y, body->get_angular_velocity() * rel_vec.x) + body->get_linear_velocity();
r_result->collider_velocity = body->get_linear_velocity() + (body->get_angular_velocity()).cross(body->get_transform().origin - rcd.best_contact); // * mPos);
@@ -995,10 +995,10 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
return collided;
}
-void *SpaceSW::_broadphase_pair(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_self) {
+void *Space3DSW::_broadphase_pair(CollisionObject3DSW *A, int p_subindex_A, CollisionObject3DSW *B, int p_subindex_B, void *p_self) {
- CollisionObjectSW::Type type_A = A->get_type();
- CollisionObjectSW::Type type_B = B->get_type();
+ CollisionObject3DSW::Type type_A = A->get_type();
+ CollisionObject3DSW::Type type_B = B->get_type();
if (type_A > type_B) {
SWAP(A, B);
@@ -1006,137 +1006,137 @@ void *SpaceSW::_broadphase_pair(CollisionObjectSW *A, int p_subindex_A, Collisio
SWAP(type_A, type_B);
}
- SpaceSW *self = (SpaceSW *)p_self;
+ Space3DSW *self = (Space3DSW *)p_self;
self->collision_pairs++;
- if (type_A == CollisionObjectSW::TYPE_AREA) {
+ if (type_A == CollisionObject3DSW::TYPE_AREA) {
- AreaSW *area = static_cast<AreaSW *>(A);
- if (type_B == CollisionObjectSW::TYPE_AREA) {
+ Area3DSW *area = static_cast<Area3DSW *>(A);
+ if (type_B == CollisionObject3DSW::TYPE_AREA) {
- AreaSW *area_b = static_cast<AreaSW *>(B);
- Area2PairSW *area2_pair = memnew(Area2PairSW(area_b, p_subindex_B, area, p_subindex_A));
+ Area3DSW *area_b = static_cast<Area3DSW *>(B);
+ Area2Pair3DSW *area2_pair = memnew(Area2Pair3DSW(area_b, p_subindex_B, area, p_subindex_A));
return area2_pair;
} else {
- BodySW *body = static_cast<BodySW *>(B);
- AreaPairSW *area_pair = memnew(AreaPairSW(body, p_subindex_B, area, p_subindex_A));
+ Body3DSW *body = static_cast<Body3DSW *>(B);
+ AreaPair3DSW *area_pair = memnew(AreaPair3DSW(body, p_subindex_B, area, p_subindex_A));
return area_pair;
}
} else {
- BodyPairSW *b = memnew(BodyPairSW((BodySW *)A, p_subindex_A, (BodySW *)B, p_subindex_B));
+ BodyPair3DSW *b = memnew(BodyPair3DSW((Body3DSW *)A, p_subindex_A, (Body3DSW *)B, p_subindex_B));
return b;
}
return NULL;
}
-void SpaceSW::_broadphase_unpair(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_data, void *p_self) {
+void Space3DSW::_broadphase_unpair(CollisionObject3DSW *A, int p_subindex_A, CollisionObject3DSW *B, int p_subindex_B, void *p_data, void *p_self) {
- SpaceSW *self = (SpaceSW *)p_self;
+ Space3DSW *self = (Space3DSW *)p_self;
self->collision_pairs--;
- ConstraintSW *c = (ConstraintSW *)p_data;
+ Constraint3DSW *c = (Constraint3DSW *)p_data;
memdelete(c);
}
-const SelfList<BodySW>::List &SpaceSW::get_active_body_list() const {
+const SelfList<Body3DSW>::List &Space3DSW::get_active_body_list() const {
return active_list;
}
-void SpaceSW::body_add_to_active_list(SelfList<BodySW> *p_body) {
+void Space3DSW::body_add_to_active_list(SelfList<Body3DSW> *p_body) {
active_list.add(p_body);
}
-void SpaceSW::body_remove_from_active_list(SelfList<BodySW> *p_body) {
+void Space3DSW::body_remove_from_active_list(SelfList<Body3DSW> *p_body) {
active_list.remove(p_body);
}
-void SpaceSW::body_add_to_inertia_update_list(SelfList<BodySW> *p_body) {
+void Space3DSW::body_add_to_inertia_update_list(SelfList<Body3DSW> *p_body) {
inertia_update_list.add(p_body);
}
-void SpaceSW::body_remove_from_inertia_update_list(SelfList<BodySW> *p_body) {
+void Space3DSW::body_remove_from_inertia_update_list(SelfList<Body3DSW> *p_body) {
inertia_update_list.remove(p_body);
}
-BroadPhaseSW *SpaceSW::get_broadphase() {
+BroadPhase3DSW *Space3DSW::get_broadphase() {
return broadphase;
}
-void SpaceSW::add_object(CollisionObjectSW *p_object) {
+void Space3DSW::add_object(CollisionObject3DSW *p_object) {
ERR_FAIL_COND(objects.has(p_object));
objects.insert(p_object);
}
-void SpaceSW::remove_object(CollisionObjectSW *p_object) {
+void Space3DSW::remove_object(CollisionObject3DSW *p_object) {
ERR_FAIL_COND(!objects.has(p_object));
objects.erase(p_object);
}
-const Set<CollisionObjectSW *> &SpaceSW::get_objects() const {
+const Set<CollisionObject3DSW *> &Space3DSW::get_objects() const {
return objects;
}
-void SpaceSW::body_add_to_state_query_list(SelfList<BodySW> *p_body) {
+void Space3DSW::body_add_to_state_query_list(SelfList<Body3DSW> *p_body) {
state_query_list.add(p_body);
}
-void SpaceSW::body_remove_from_state_query_list(SelfList<BodySW> *p_body) {
+void Space3DSW::body_remove_from_state_query_list(SelfList<Body3DSW> *p_body) {
state_query_list.remove(p_body);
}
-void SpaceSW::area_add_to_monitor_query_list(SelfList<AreaSW> *p_area) {
+void Space3DSW::area_add_to_monitor_query_list(SelfList<Area3DSW> *p_area) {
monitor_query_list.add(p_area);
}
-void SpaceSW::area_remove_from_monitor_query_list(SelfList<AreaSW> *p_area) {
+void Space3DSW::area_remove_from_monitor_query_list(SelfList<Area3DSW> *p_area) {
monitor_query_list.remove(p_area);
}
-void SpaceSW::area_add_to_moved_list(SelfList<AreaSW> *p_area) {
+void Space3DSW::area_add_to_moved_list(SelfList<Area3DSW> *p_area) {
area_moved_list.add(p_area);
}
-void SpaceSW::area_remove_from_moved_list(SelfList<AreaSW> *p_area) {
+void Space3DSW::area_remove_from_moved_list(SelfList<Area3DSW> *p_area) {
area_moved_list.remove(p_area);
}
-const SelfList<AreaSW>::List &SpaceSW::get_moved_area_list() const {
+const SelfList<Area3DSW>::List &Space3DSW::get_moved_area_list() const {
return area_moved_list;
}
-void SpaceSW::call_queries() {
+void Space3DSW::call_queries() {
while (state_query_list.first()) {
- BodySW *b = state_query_list.first()->self();
+ Body3DSW *b = state_query_list.first()->self();
state_query_list.remove(state_query_list.first());
b->call_queries();
}
while (monitor_query_list.first()) {
- AreaSW *a = monitor_query_list.first()->self();
+ Area3DSW *a = monitor_query_list.first()->self();
monitor_query_list.remove(monitor_query_list.first());
a->call_queries();
}
}
-void SpaceSW::setup() {
+void Space3DSW::setup() {
contact_debug_count = 0;
while (inertia_update_list.first()) {
@@ -1145,65 +1145,65 @@ void SpaceSW::setup() {
}
}
-void SpaceSW::update() {
+void Space3DSW::update() {
broadphase->update();
}
-void SpaceSW::set_param(PhysicsServer::SpaceParameter p_param, real_t p_value) {
+void Space3DSW::set_param(PhysicsServer3D::SpaceParameter p_param, real_t p_value) {
switch (p_param) {
- case PhysicsServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: contact_recycle_radius = p_value; break;
- case PhysicsServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: contact_max_separation = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: contact_max_allowed_penetration = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: body_time_to_sleep = p_value; break;
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: body_angular_velocity_damp_ratio = p_value; break;
- case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; break;
- case PhysicsServer::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: test_motion_min_contact_depth = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: contact_recycle_radius = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_MAX_SEPARATION: contact_max_separation = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: contact_max_allowed_penetration = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: body_linear_velocity_sleep_threshold = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: body_angular_velocity_sleep_threshold = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_BODY_TIME_TO_SLEEP: body_time_to_sleep = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: body_angular_velocity_damp_ratio = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; break;
+ case PhysicsServer3D::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: test_motion_min_contact_depth = p_value; break;
}
}
-real_t SpaceSW::get_param(PhysicsServer::SpaceParameter p_param) const {
+real_t Space3DSW::get_param(PhysicsServer3D::SpaceParameter p_param) const {
switch (p_param) {
- case PhysicsServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: return contact_recycle_radius;
- case PhysicsServer::SPACE_PARAM_CONTACT_MAX_SEPARATION: return contact_max_separation;
- case PhysicsServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: return contact_max_allowed_penetration;
- case PhysicsServer::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: return body_linear_velocity_sleep_threshold;
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: return body_angular_velocity_sleep_threshold;
- case PhysicsServer::SPACE_PARAM_BODY_TIME_TO_SLEEP: return body_time_to_sleep;
- case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: return body_angular_velocity_damp_ratio;
- case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias;
- case PhysicsServer::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: return test_motion_min_contact_depth;
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_RECYCLE_RADIUS: return contact_recycle_radius;
+ case PhysicsServer3D::SPACE_PARAM_CONTACT_MAX_SEPARATION: return contact_max_separation;
+ case PhysicsServer3D::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: return contact_max_allowed_penetration;
+ case PhysicsServer3D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: return body_linear_velocity_sleep_threshold;
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: return body_angular_velocity_sleep_threshold;
+ case PhysicsServer3D::SPACE_PARAM_BODY_TIME_TO_SLEEP: return body_time_to_sleep;
+ case PhysicsServer3D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: return body_angular_velocity_damp_ratio;
+ case PhysicsServer3D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias;
+ case PhysicsServer3D::SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH: return test_motion_min_contact_depth;
}
return 0;
}
-void SpaceSW::lock() {
+void Space3DSW::lock() {
locked = true;
}
-void SpaceSW::unlock() {
+void Space3DSW::unlock() {
locked = false;
}
-bool SpaceSW::is_locked() const {
+bool Space3DSW::is_locked() const {
return locked;
}
-PhysicsDirectSpaceStateSW *SpaceSW::get_direct_state() {
+PhysicsDirectSpaceState3DSW *Space3DSW::get_direct_state() {
return direct_access;
}
-SpaceSW::SpaceSW() {
+Space3DSW::Space3DSW() {
collision_pairs = 0;
active_objects = 0;
@@ -1223,19 +1223,19 @@ SpaceSW::SpaceSW() {
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/time_before_sleep", PropertyInfo(Variant::FLOAT, "physics/3d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"));
body_angular_velocity_damp_ratio = 10;
- broadphase = BroadPhaseSW::create_func();
+ broadphase = BroadPhase3DSW::create_func();
broadphase->set_pair_callback(_broadphase_pair, this);
broadphase->set_unpair_callback(_broadphase_unpair, this);
area = NULL;
- direct_access = memnew(PhysicsDirectSpaceStateSW);
+ direct_access = memnew(PhysicsDirectSpaceState3DSW);
direct_access->space = this;
for (int i = 0; i < ELAPSED_TIME_MAX; i++)
elapsed_time[i] = 0;
}
-SpaceSW::~SpaceSW() {
+Space3DSW::~Space3DSW() {
memdelete(broadphase);
memdelete(direct_access);
diff --git a/servers/physics/space_sw.h b/servers/physics_3d/space_3d_sw.h
index 9e82720a75..c32af5c5d4 100644
--- a/servers/physics/space_sw.h
+++ b/servers/physics_3d/space_3d_sw.h
@@ -31,22 +31,22 @@
#ifndef SPACE_SW_H
#define SPACE_SW_H
-#include "area_pair_sw.h"
-#include "area_sw.h"
-#include "body_pair_sw.h"
-#include "body_sw.h"
-#include "broad_phase_sw.h"
-#include "collision_object_sw.h"
+#include "area_3d_sw.h"
+#include "area_pair_3d_sw.h"
+#include "body_3d_sw.h"
+#include "body_pair_3d_sw.h"
+#include "broad_phase_3d_sw.h"
+#include "collision_object_3d_sw.h"
#include "core/hash_map.h"
#include "core/project_settings.h"
#include "core/typedefs.h"
-class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState {
+class PhysicsDirectSpaceState3DSW : public PhysicsDirectSpaceState3D {
- GDCLASS(PhysicsDirectSpaceStateSW, PhysicsDirectSpaceState);
+ GDCLASS(PhysicsDirectSpaceState3DSW, PhysicsDirectSpaceState3D);
public:
- SpaceSW *space;
+ Space3DSW *space;
virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false);
virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false, bool p_pick_ray = false);
@@ -56,10 +56,10 @@ public:
virtual bool rest_info(RID p_shape, const Transform &p_shape_xform, real_t p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false);
virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const;
- PhysicsDirectSpaceStateSW();
+ PhysicsDirectSpaceState3DSW();
};
-class SpaceSW {
+class Space3DSW {
public:
enum ElapsedTime {
@@ -75,22 +75,22 @@ public:
private:
uint64_t elapsed_time[ELAPSED_TIME_MAX];
- PhysicsDirectSpaceStateSW *direct_access;
+ PhysicsDirectSpaceState3DSW *direct_access;
RID self;
- BroadPhaseSW *broadphase;
- SelfList<BodySW>::List active_list;
- SelfList<BodySW>::List inertia_update_list;
- SelfList<BodySW>::List state_query_list;
- SelfList<AreaSW>::List monitor_query_list;
- SelfList<AreaSW>::List area_moved_list;
+ BroadPhase3DSW *broadphase;
+ SelfList<Body3DSW>::List active_list;
+ SelfList<Body3DSW>::List inertia_update_list;
+ SelfList<Body3DSW>::List state_query_list;
+ SelfList<Area3DSW>::List monitor_query_list;
+ SelfList<Area3DSW>::List area_moved_list;
- static void *_broadphase_pair(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_self);
- static void _broadphase_unpair(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_data, void *p_self);
+ static void *_broadphase_pair(CollisionObject3DSW *A, int p_subindex_A, CollisionObject3DSW *B, int p_subindex_B, void *p_self);
+ static void _broadphase_unpair(CollisionObject3DSW *A, int p_subindex_A, CollisionObject3DSW *B, int p_subindex_B, void *p_data, void *p_self);
- Set<CollisionObjectSW *> objects;
+ Set<CollisionObject3DSW *> objects;
- AreaSW *area;
+ Area3DSW *area;
real_t contact_recycle_radius;
real_t contact_max_separation;
@@ -103,7 +103,7 @@ private:
INTERSECTION_QUERY_MAX = 2048
};
- CollisionObjectSW *intersection_query_results[INTERSECTION_QUERY_MAX];
+ CollisionObject3DSW *intersection_query_results[INTERSECTION_QUERY_MAX];
int intersection_query_subindex_results[INTERSECTION_QUERY_MAX];
real_t body_linear_velocity_sleep_threshold;
@@ -122,37 +122,37 @@ private:
Vector<Vector3> contact_debug;
int contact_debug_count;
- friend class PhysicsDirectSpaceStateSW;
+ friend class PhysicsDirectSpaceState3DSW;
- int _cull_aabb_for_body(BodySW *p_body, const AABB &p_aabb);
+ int _cull_aabb_for_body(Body3DSW *p_body, const AABB &p_aabb);
public:
_FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; }
_FORCE_INLINE_ RID get_self() const { return self; }
- void set_default_area(AreaSW *p_area) { area = p_area; }
- AreaSW *get_default_area() const { return area; }
+ void set_default_area(Area3DSW *p_area) { area = p_area; }
+ Area3DSW *get_default_area() const { return area; }
- const SelfList<BodySW>::List &get_active_body_list() const;
- void body_add_to_active_list(SelfList<BodySW> *p_body);
- void body_remove_from_active_list(SelfList<BodySW> *p_body);
- void body_add_to_inertia_update_list(SelfList<BodySW> *p_body);
- void body_remove_from_inertia_update_list(SelfList<BodySW> *p_body);
+ const SelfList<Body3DSW>::List &get_active_body_list() const;
+ void body_add_to_active_list(SelfList<Body3DSW> *p_body);
+ void body_remove_from_active_list(SelfList<Body3DSW> *p_body);
+ void body_add_to_inertia_update_list(SelfList<Body3DSW> *p_body);
+ void body_remove_from_inertia_update_list(SelfList<Body3DSW> *p_body);
- void body_add_to_state_query_list(SelfList<BodySW> *p_body);
- void body_remove_from_state_query_list(SelfList<BodySW> *p_body);
+ void body_add_to_state_query_list(SelfList<Body3DSW> *p_body);
+ void body_remove_from_state_query_list(SelfList<Body3DSW> *p_body);
- void area_add_to_monitor_query_list(SelfList<AreaSW> *p_area);
- void area_remove_from_monitor_query_list(SelfList<AreaSW> *p_area);
- void area_add_to_moved_list(SelfList<AreaSW> *p_area);
- void area_remove_from_moved_list(SelfList<AreaSW> *p_area);
- const SelfList<AreaSW>::List &get_moved_area_list() const;
+ void area_add_to_monitor_query_list(SelfList<Area3DSW> *p_area);
+ void area_remove_from_monitor_query_list(SelfList<Area3DSW> *p_area);
+ void area_add_to_moved_list(SelfList<Area3DSW> *p_area);
+ void area_remove_from_moved_list(SelfList<Area3DSW> *p_area);
+ const SelfList<Area3DSW>::List &get_moved_area_list() const;
- BroadPhaseSW *get_broadphase();
+ BroadPhase3DSW *get_broadphase();
- void add_object(CollisionObjectSW *p_object);
- void remove_object(CollisionObjectSW *p_object);
- const Set<CollisionObjectSW *> &get_objects() const;
+ void add_object(CollisionObject3DSW *p_object);
+ void remove_object(CollisionObject3DSW *p_object);
+ const Set<CollisionObject3DSW *> &get_objects() const;
_FORCE_INLINE_ real_t get_contact_recycle_radius() const { return contact_recycle_radius; }
_FORCE_INLINE_ real_t get_contact_max_separation() const { return contact_max_separation; }
@@ -171,8 +171,8 @@ public:
void lock();
void unlock();
- void set_param(PhysicsServer::SpaceParameter p_param, real_t p_value);
- real_t get_param(PhysicsServer::SpaceParameter p_param) const;
+ void set_param(PhysicsServer3D::SpaceParameter p_param, real_t p_value);
+ real_t get_param(PhysicsServer3D::SpaceParameter p_param) const;
void set_island_count(int p_island_count) { island_count = p_island_count; }
int get_island_count() const { return island_count; }
@@ -182,7 +182,7 @@ public:
int get_collision_pairs() const { return collision_pairs; }
- PhysicsDirectSpaceStateSW *get_direct_state();
+ PhysicsDirectSpaceState3DSW *get_direct_state();
void set_debug_contacts(int p_amount) { contact_debug.resize(p_amount); }
_FORCE_INLINE_ bool is_debugging_contacts() const { return !contact_debug.empty(); }
@@ -198,11 +198,11 @@ public:
void set_elapsed_time(ElapsedTime p_time, uint64_t p_msec) { elapsed_time[p_time] = p_msec; }
uint64_t get_elapsed_time(ElapsedTime p_time) const { return elapsed_time[p_time]; }
- int test_body_ray_separation(BodySW *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer::SeparationResult *r_results, int p_result_max, real_t p_margin);
- bool test_body_motion(BodySW *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, real_t p_margin, PhysicsServer::MotionResult *r_result, bool p_exclude_raycast_shapes);
+ int test_body_ray_separation(Body3DSW *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer3D::SeparationResult *r_results, int p_result_max, real_t p_margin);
+ bool test_body_motion(Body3DSW *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, real_t p_margin, PhysicsServer3D::MotionResult *r_result, bool p_exclude_raycast_shapes);
- SpaceSW();
- ~SpaceSW();
+ Space3DSW();
+ ~Space3DSW();
};
#endif // SPACE__SW_H
diff --git a/servers/physics/step_sw.cpp b/servers/physics_3d/step_3d_sw.cpp
index f4055ecff7..ef9015a61c 100644
--- a/servers/physics/step_sw.cpp
+++ b/servers/physics_3d/step_3d_sw.cpp
@@ -28,20 +28,20 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "step_sw.h"
-#include "joints_sw.h"
+#include "step_3d_sw.h"
+#include "joints_3d_sw.h"
#include "core/os/os.h"
-void StepSW::_populate_island(BodySW *p_body, BodySW **p_island, ConstraintSW **p_constraint_island) {
+void Step3DSW::_populate_island(Body3DSW *p_body, Body3DSW **p_island, Constraint3DSW **p_constraint_island) {
p_body->set_island_step(_step);
p_body->set_island_next(*p_island);
*p_island = p_body;
- for (Map<ConstraintSW *, int>::Element *E = p_body->get_constraint_map().front(); E; E = E->next()) {
+ for (Map<Constraint3DSW *, int>::Element *E = p_body->get_constraint_map().front(); E; E = E->next()) {
- ConstraintSW *c = (ConstraintSW *)E->key();
+ Constraint3DSW *c = (Constraint3DSW *)E->key();
if (c->get_island_step() == _step)
continue; //already processed
c->set_island_step(_step);
@@ -51,17 +51,17 @@ void StepSW::_populate_island(BodySW *p_body, BodySW **p_island, ConstraintSW **
for (int i = 0; i < c->get_body_count(); i++) {
if (i == E->get())
continue;
- BodySW *b = c->get_body_ptr()[i];
- if (b->get_island_step() == _step || b->get_mode() == PhysicsServer::BODY_MODE_STATIC || b->get_mode() == PhysicsServer::BODY_MODE_KINEMATIC)
+ Body3DSW *b = c->get_body_ptr()[i];
+ if (b->get_island_step() == _step || b->get_mode() == PhysicsServer3D::BODY_MODE_STATIC || b->get_mode() == PhysicsServer3D::BODY_MODE_KINEMATIC)
continue; //no go
_populate_island(c->get_body_ptr()[i], p_island, p_constraint_island);
}
}
}
-void StepSW::_setup_island(ConstraintSW *p_island, real_t p_delta) {
+void Step3DSW::_setup_island(Constraint3DSW *p_island, real_t p_delta) {
- ConstraintSW *ci = p_island;
+ Constraint3DSW *ci = p_island;
while (ci) {
ci->setup(p_delta);
//todo remove from island if process fails
@@ -69,7 +69,7 @@ void StepSW::_setup_island(ConstraintSW *p_island, real_t p_delta) {
}
}
-void StepSW::_solve_island(ConstraintSW *p_island, int p_iterations, real_t p_delta) {
+void Step3DSW::_solve_island(Constraint3DSW *p_island, int p_iterations, real_t p_delta) {
int at_priority = 1;
@@ -77,7 +77,7 @@ void StepSW::_solve_island(ConstraintSW *p_island, int p_iterations, real_t p_de
for (int i = 0; i < p_iterations; i++) {
- ConstraintSW *ci = p_island;
+ Constraint3DSW *ci = p_island;
while (ci) {
ci->solve(p_delta);
ci = ci->get_island_next();
@@ -87,8 +87,8 @@ void StepSW::_solve_island(ConstraintSW *p_island, int p_iterations, real_t p_de
at_priority++;
{
- ConstraintSW *ci = p_island;
- ConstraintSW *prev = NULL;
+ Constraint3DSW *ci = p_island;
+ Constraint3DSW *prev = NULL;
while (ci) {
if (ci->get_priority() < at_priority) {
if (prev) {
@@ -107,14 +107,14 @@ void StepSW::_solve_island(ConstraintSW *p_island, int p_iterations, real_t p_de
}
}
-void StepSW::_check_suspend(BodySW *p_island, real_t p_delta) {
+void Step3DSW::_check_suspend(Body3DSW *p_island, real_t p_delta) {
bool can_sleep = true;
- BodySW *b = p_island;
+ Body3DSW *b = p_island;
while (b) {
- if (b->get_mode() == PhysicsServer::BODY_MODE_STATIC || b->get_mode() == PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (b->get_mode() == PhysicsServer3D::BODY_MODE_STATIC || b->get_mode() == PhysicsServer3D::BODY_MODE_KINEMATIC) {
b = b->get_island_next();
continue; //ignore for static
}
@@ -130,7 +130,7 @@ void StepSW::_check_suspend(BodySW *p_island, real_t p_delta) {
b = p_island;
while (b) {
- if (b->get_mode() == PhysicsServer::BODY_MODE_STATIC || b->get_mode() == PhysicsServer::BODY_MODE_KINEMATIC) {
+ if (b->get_mode() == PhysicsServer3D::BODY_MODE_STATIC || b->get_mode() == PhysicsServer3D::BODY_MODE_KINEMATIC) {
b = b->get_island_next();
continue; //ignore for static
}
@@ -144,13 +144,13 @@ void StepSW::_check_suspend(BodySW *p_island, real_t p_delta) {
}
}
-void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
+void Step3DSW::step(Space3DSW *p_space, real_t p_delta, int p_iterations) {
p_space->lock(); // can't access space during this
p_space->setup(); //update inertias, etc
- const SelfList<BodySW>::List *body_list = &p_space->get_active_body_list();
+ const SelfList<Body3DSW>::List *body_list = &p_space->get_active_body_list();
/* INTEGRATE FORCES */
@@ -159,7 +159,7 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
int active_count = 0;
- const SelfList<BodySW> *b = body_list->first();
+ const SelfList<Body3DSW> *b = body_list->first();
while (b) {
b->self()->integrate_forces(p_delta);
@@ -171,25 +171,25 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
- p_space->set_elapsed_time(SpaceSW::ELAPSED_TIME_INTEGRATE_FORCES, profile_endtime - profile_begtime);
+ p_space->set_elapsed_time(Space3DSW::ELAPSED_TIME_INTEGRATE_FORCES, profile_endtime - profile_begtime);
profile_begtime = profile_endtime;
}
/* GENERATE CONSTRAINT ISLANDS */
- BodySW *island_list = NULL;
- ConstraintSW *constraint_island_list = NULL;
+ Body3DSW *island_list = NULL;
+ Constraint3DSW *constraint_island_list = NULL;
b = body_list->first();
int island_count = 0;
while (b) {
- BodySW *body = b->self();
+ Body3DSW *body = b->self();
if (body->get_island_step() != _step) {
- BodySW *island = NULL;
- ConstraintSW *constraint_island = NULL;
+ Body3DSW *island = NULL;
+ Constraint3DSW *constraint_island = NULL;
_populate_island(body, &island, &constraint_island);
island->set_island_list_next(island_list);
@@ -206,12 +206,12 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
p_space->set_island_count(island_count);
- const SelfList<AreaSW>::List &aml = p_space->get_moved_area_list();
+ const SelfList<Area3DSW>::List &aml = p_space->get_moved_area_list();
while (aml.first()) {
- for (const Set<ConstraintSW *>::Element *E = aml.first()->self()->get_constraints().front(); E; E = E->next()) {
+ for (const Set<Constraint3DSW *>::Element *E = aml.first()->self()->get_constraints().front(); E; E = E->next()) {
- ConstraintSW *c = E->get();
+ Constraint3DSW *c = E->get();
if (c->get_island_step() == _step)
continue;
c->set_island_step(_step);
@@ -219,19 +219,19 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
c->set_island_list_next(constraint_island_list);
constraint_island_list = c;
}
- p_space->area_remove_from_moved_list((SelfList<AreaSW> *)aml.first()); //faster to remove here
+ p_space->area_remove_from_moved_list((SelfList<Area3DSW> *)aml.first()); //faster to remove here
}
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
- p_space->set_elapsed_time(SpaceSW::ELAPSED_TIME_GENERATE_ISLANDS, profile_endtime - profile_begtime);
+ p_space->set_elapsed_time(Space3DSW::ELAPSED_TIME_GENERATE_ISLANDS, profile_endtime - profile_begtime);
profile_begtime = profile_endtime;
}
/* SETUP CONSTRAINT ISLANDS */
{
- ConstraintSW *ci = constraint_island_list;
+ Constraint3DSW *ci = constraint_island_list;
while (ci) {
_setup_island(ci, p_delta);
@@ -241,14 +241,14 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
- p_space->set_elapsed_time(SpaceSW::ELAPSED_TIME_SETUP_CONSTRAINTS, profile_endtime - profile_begtime);
+ p_space->set_elapsed_time(Space3DSW::ELAPSED_TIME_SETUP_CONSTRAINTS, profile_endtime - profile_begtime);
profile_begtime = profile_endtime;
}
/* SOLVE CONSTRAINT ISLANDS */
{
- ConstraintSW *ci = constraint_island_list;
+ Constraint3DSW *ci = constraint_island_list;
while (ci) {
//iterating each island separatedly improves cache efficiency
_solve_island(ci, p_iterations, p_delta);
@@ -258,7 +258,7 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
- p_space->set_elapsed_time(SpaceSW::ELAPSED_TIME_SOLVE_CONSTRAINTS, profile_endtime - profile_begtime);
+ p_space->set_elapsed_time(Space3DSW::ELAPSED_TIME_SOLVE_CONSTRAINTS, profile_endtime - profile_begtime);
profile_begtime = profile_endtime;
}
@@ -266,7 +266,7 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
b = body_list->first();
while (b) {
- const SelfList<BodySW> *n = b->next();
+ const SelfList<Body3DSW> *n = b->next();
b->self()->integrate_velocities(p_delta);
b = n;
}
@@ -274,7 +274,7 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
/* SLEEP / WAKE UP ISLANDS */
{
- BodySW *bi = island_list;
+ Body3DSW *bi = island_list;
while (bi) {
_check_suspend(bi, p_delta);
@@ -284,7 +284,7 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
{ //profile
profile_endtime = OS::get_singleton()->get_ticks_usec();
- p_space->set_elapsed_time(SpaceSW::ELAPSED_TIME_INTEGRATE_VELOCITIES, profile_endtime - profile_begtime);
+ p_space->set_elapsed_time(Space3DSW::ELAPSED_TIME_INTEGRATE_VELOCITIES, profile_endtime - profile_begtime);
profile_begtime = profile_endtime;
}
@@ -293,7 +293,7 @@ void StepSW::step(SpaceSW *p_space, real_t p_delta, int p_iterations) {
_step++;
}
-StepSW::StepSW() {
+Step3DSW::Step3DSW() {
_step = 1;
}
diff --git a/servers/physics/step_sw.h b/servers/physics_3d/step_3d_sw.h
index 40022ef8b9..dcd67fa122 100644
--- a/servers/physics/step_sw.h
+++ b/servers/physics_3d/step_3d_sw.h
@@ -31,20 +31,20 @@
#ifndef STEP_SW_H
#define STEP_SW_H
-#include "space_sw.h"
+#include "space_3d_sw.h"
-class StepSW {
+class Step3DSW {
uint64_t _step;
- void _populate_island(BodySW *p_body, BodySW **p_island, ConstraintSW **p_constraint_island);
- void _setup_island(ConstraintSW *p_island, real_t p_delta);
- void _solve_island(ConstraintSW *p_island, int p_iterations, real_t p_delta);
- void _check_suspend(BodySW *p_island, real_t p_delta);
+ void _populate_island(Body3DSW *p_body, Body3DSW **p_island, Constraint3DSW **p_constraint_island);
+ void _setup_island(Constraint3DSW *p_island, real_t p_delta);
+ void _solve_island(Constraint3DSW *p_island, int p_iterations, real_t p_delta);
+ void _check_suspend(Body3DSW *p_island, real_t p_delta);
public:
- void step(SpaceSW *p_space, real_t p_delta, int p_iterations);
- StepSW();
+ void step(Space3DSW *p_space, real_t p_delta, int p_iterations);
+ Step3DSW();
};
#endif // STEP__SW_H
diff --git a/servers/physics_2d_server.cpp b/servers/physics_server_2d.cpp
index 1f92d6e419..d80a51ca36 100644
--- a/servers/physics_2d_server.cpp
+++ b/servers/physics_server_2d.cpp
@@ -28,15 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "physics_2d_server.h"
+#include "physics_server_2d.h"
#include "core/method_bind_ext.gen.inc"
#include "core/print_string.h"
#include "core/project_settings.h"
-Physics2DServer *Physics2DServer::singleton = NULL;
+PhysicsServer2D *PhysicsServer2D::singleton = NULL;
-void Physics2DDirectBodyState::integrate_forces() {
+void PhysicsDirectBodyState2D::integrate_forces() {
real_t step = get_step();
Vector2 lv = get_linear_velocity();
@@ -62,61 +62,61 @@ void Physics2DDirectBodyState::integrate_forces() {
set_angular_velocity(av);
}
-Object *Physics2DDirectBodyState::get_contact_collider_object(int p_contact_idx) const {
+Object *PhysicsDirectBodyState2D::get_contact_collider_object(int p_contact_idx) const {
ObjectID objid = get_contact_collider_id(p_contact_idx);
Object *obj = ObjectDB::get_instance(objid);
return obj;
}
-Physics2DServer *Physics2DServer::get_singleton() {
+PhysicsServer2D *PhysicsServer2D::get_singleton() {
return singleton;
}
-void Physics2DDirectBodyState::_bind_methods() {
+void PhysicsDirectBodyState2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_total_gravity"), &Physics2DDirectBodyState::get_total_gravity);
- ClassDB::bind_method(D_METHOD("get_total_linear_damp"), &Physics2DDirectBodyState::get_total_linear_damp);
- ClassDB::bind_method(D_METHOD("get_total_angular_damp"), &Physics2DDirectBodyState::get_total_angular_damp);
+ ClassDB::bind_method(D_METHOD("get_total_gravity"), &PhysicsDirectBodyState2D::get_total_gravity);
+ ClassDB::bind_method(D_METHOD("get_total_linear_damp"), &PhysicsDirectBodyState2D::get_total_linear_damp);
+ ClassDB::bind_method(D_METHOD("get_total_angular_damp"), &PhysicsDirectBodyState2D::get_total_angular_damp);
- ClassDB::bind_method(D_METHOD("get_inverse_mass"), &Physics2DDirectBodyState::get_inverse_mass);
- ClassDB::bind_method(D_METHOD("get_inverse_inertia"), &Physics2DDirectBodyState::get_inverse_inertia);
+ ClassDB::bind_method(D_METHOD("get_inverse_mass"), &PhysicsDirectBodyState2D::get_inverse_mass);
+ ClassDB::bind_method(D_METHOD("get_inverse_inertia"), &PhysicsDirectBodyState2D::get_inverse_inertia);
- ClassDB::bind_method(D_METHOD("set_linear_velocity", "velocity"), &Physics2DDirectBodyState::set_linear_velocity);
- ClassDB::bind_method(D_METHOD("get_linear_velocity"), &Physics2DDirectBodyState::get_linear_velocity);
+ ClassDB::bind_method(D_METHOD("set_linear_velocity", "velocity"), &PhysicsDirectBodyState2D::set_linear_velocity);
+ ClassDB::bind_method(D_METHOD("get_linear_velocity"), &PhysicsDirectBodyState2D::get_linear_velocity);
- ClassDB::bind_method(D_METHOD("set_angular_velocity", "velocity"), &Physics2DDirectBodyState::set_angular_velocity);
- ClassDB::bind_method(D_METHOD("get_angular_velocity"), &Physics2DDirectBodyState::get_angular_velocity);
+ ClassDB::bind_method(D_METHOD("set_angular_velocity", "velocity"), &PhysicsDirectBodyState2D::set_angular_velocity);
+ ClassDB::bind_method(D_METHOD("get_angular_velocity"), &PhysicsDirectBodyState2D::get_angular_velocity);
- ClassDB::bind_method(D_METHOD("set_transform", "transform"), &Physics2DDirectBodyState::set_transform);
- ClassDB::bind_method(D_METHOD("get_transform"), &Physics2DDirectBodyState::get_transform);
+ ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsDirectBodyState2D::set_transform);
+ ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsDirectBodyState2D::get_transform);
- ClassDB::bind_method(D_METHOD("add_central_force", "force"), &Physics2DDirectBodyState::add_central_force);
- ClassDB::bind_method(D_METHOD("add_force", "offset", "force"), &Physics2DDirectBodyState::add_force);
- ClassDB::bind_method(D_METHOD("add_torque", "torque"), &Physics2DDirectBodyState::add_torque);
- ClassDB::bind_method(D_METHOD("apply_central_impulse", "impulse"), &Physics2DDirectBodyState::apply_central_impulse);
- ClassDB::bind_method(D_METHOD("apply_torque_impulse", "impulse"), &Physics2DDirectBodyState::apply_torque_impulse);
- ClassDB::bind_method(D_METHOD("apply_impulse", "offset", "impulse"), &Physics2DDirectBodyState::apply_impulse);
+ ClassDB::bind_method(D_METHOD("add_central_force", "force"), &PhysicsDirectBodyState2D::add_central_force);
+ ClassDB::bind_method(D_METHOD("add_force", "offset", "force"), &PhysicsDirectBodyState2D::add_force);
+ ClassDB::bind_method(D_METHOD("add_torque", "torque"), &PhysicsDirectBodyState2D::add_torque);
+ ClassDB::bind_method(D_METHOD("apply_central_impulse", "impulse"), &PhysicsDirectBodyState2D::apply_central_impulse);
+ ClassDB::bind_method(D_METHOD("apply_torque_impulse", "impulse"), &PhysicsDirectBodyState2D::apply_torque_impulse);
+ ClassDB::bind_method(D_METHOD("apply_impulse", "offset", "impulse"), &PhysicsDirectBodyState2D::apply_impulse);
- ClassDB::bind_method(D_METHOD("set_sleep_state", "enabled"), &Physics2DDirectBodyState::set_sleep_state);
- ClassDB::bind_method(D_METHOD("is_sleeping"), &Physics2DDirectBodyState::is_sleeping);
+ ClassDB::bind_method(D_METHOD("set_sleep_state", "enabled"), &PhysicsDirectBodyState2D::set_sleep_state);
+ ClassDB::bind_method(D_METHOD("is_sleeping"), &PhysicsDirectBodyState2D::is_sleeping);
- ClassDB::bind_method(D_METHOD("get_contact_count"), &Physics2DDirectBodyState::get_contact_count);
+ ClassDB::bind_method(D_METHOD("get_contact_count"), &PhysicsDirectBodyState2D::get_contact_count);
- ClassDB::bind_method(D_METHOD("get_contact_local_position", "contact_idx"), &Physics2DDirectBodyState::get_contact_local_position);
- ClassDB::bind_method(D_METHOD("get_contact_local_normal", "contact_idx"), &Physics2DDirectBodyState::get_contact_local_normal);
- ClassDB::bind_method(D_METHOD("get_contact_local_shape", "contact_idx"), &Physics2DDirectBodyState::get_contact_local_shape);
- ClassDB::bind_method(D_METHOD("get_contact_collider", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider);
- ClassDB::bind_method(D_METHOD("get_contact_collider_position", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider_position);
- ClassDB::bind_method(D_METHOD("get_contact_collider_id", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider_id);
- ClassDB::bind_method(D_METHOD("get_contact_collider_object", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider_object);
- ClassDB::bind_method(D_METHOD("get_contact_collider_shape", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider_shape);
- ClassDB::bind_method(D_METHOD("get_contact_collider_shape_metadata", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider_shape_metadata);
- ClassDB::bind_method(D_METHOD("get_contact_collider_velocity_at_position", "contact_idx"), &Physics2DDirectBodyState::get_contact_collider_velocity_at_position);
- ClassDB::bind_method(D_METHOD("get_step"), &Physics2DDirectBodyState::get_step);
- ClassDB::bind_method(D_METHOD("integrate_forces"), &Physics2DDirectBodyState::integrate_forces);
- ClassDB::bind_method(D_METHOD("get_space_state"), &Physics2DDirectBodyState::get_space_state);
+ ClassDB::bind_method(D_METHOD("get_contact_local_position", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_local_position);
+ ClassDB::bind_method(D_METHOD("get_contact_local_normal", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_local_normal);
+ ClassDB::bind_method(D_METHOD("get_contact_local_shape", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_local_shape);
+ ClassDB::bind_method(D_METHOD("get_contact_collider", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_position", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider_position);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_id", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider_id);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_object", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider_object);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_shape", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider_shape);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_shape_metadata", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider_shape_metadata);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_velocity_at_position", "contact_idx"), &PhysicsDirectBodyState2D::get_contact_collider_velocity_at_position);
+ ClassDB::bind_method(D_METHOD("get_step"), &PhysicsDirectBodyState2D::get_step);
+ ClassDB::bind_method(D_METHOD("integrate_forces"), &PhysicsDirectBodyState2D::integrate_forces);
+ ClassDB::bind_method(D_METHOD("get_space_state"), &PhysicsDirectBodyState2D::get_space_state);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "", "get_step");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inverse_mass"), "", "get_inverse_mass");
@@ -130,70 +130,70 @@ void Physics2DDirectBodyState::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform"), "set_transform", "get_transform");
}
-Physics2DDirectBodyState::Physics2DDirectBodyState() {}
+PhysicsDirectBodyState2D::PhysicsDirectBodyState2D() {}
///////////////////////////////////////////////////////
-void Physics2DShapeQueryParameters::set_shape(const RES &p_shape) {
+void PhysicsShapeQueryParameters2D::set_shape(const RES &p_shape) {
ERR_FAIL_COND(p_shape.is_null());
shape = p_shape->get_rid();
}
-void Physics2DShapeQueryParameters::set_shape_rid(const RID &p_shape) {
+void PhysicsShapeQueryParameters2D::set_shape_rid(const RID &p_shape) {
shape = p_shape;
}
-RID Physics2DShapeQueryParameters::get_shape_rid() const {
+RID PhysicsShapeQueryParameters2D::get_shape_rid() const {
return shape;
}
-void Physics2DShapeQueryParameters::set_transform(const Transform2D &p_transform) {
+void PhysicsShapeQueryParameters2D::set_transform(const Transform2D &p_transform) {
transform = p_transform;
}
-Transform2D Physics2DShapeQueryParameters::get_transform() const {
+Transform2D PhysicsShapeQueryParameters2D::get_transform() const {
return transform;
}
-void Physics2DShapeQueryParameters::set_motion(const Vector2 &p_motion) {
+void PhysicsShapeQueryParameters2D::set_motion(const Vector2 &p_motion) {
motion = p_motion;
}
-Vector2 Physics2DShapeQueryParameters::get_motion() const {
+Vector2 PhysicsShapeQueryParameters2D::get_motion() const {
return motion;
}
-void Physics2DShapeQueryParameters::set_margin(float p_margin) {
+void PhysicsShapeQueryParameters2D::set_margin(float p_margin) {
margin = p_margin;
}
-float Physics2DShapeQueryParameters::get_margin() const {
+float PhysicsShapeQueryParameters2D::get_margin() const {
return margin;
}
-void Physics2DShapeQueryParameters::set_collision_mask(int p_collision_mask) {
+void PhysicsShapeQueryParameters2D::set_collision_mask(int p_collision_mask) {
collision_mask = p_collision_mask;
}
-int Physics2DShapeQueryParameters::get_collision_mask() const {
+int PhysicsShapeQueryParameters2D::get_collision_mask() const {
return collision_mask;
}
-void Physics2DShapeQueryParameters::set_exclude(const Vector<RID> &p_exclude) {
+void PhysicsShapeQueryParameters2D::set_exclude(const Vector<RID> &p_exclude) {
exclude.clear();
for (int i = 0; i < p_exclude.size(); i++)
exclude.insert(p_exclude[i]);
}
-Vector<RID> Physics2DShapeQueryParameters::get_exclude() const {
+Vector<RID> PhysicsShapeQueryParameters2D::get_exclude() const {
Vector<RID> ret;
ret.resize(exclude.size());
@@ -204,48 +204,48 @@ Vector<RID> Physics2DShapeQueryParameters::get_exclude() const {
return ret;
}
-void Physics2DShapeQueryParameters::set_collide_with_bodies(bool p_enable) {
+void PhysicsShapeQueryParameters2D::set_collide_with_bodies(bool p_enable) {
collide_with_bodies = p_enable;
}
-bool Physics2DShapeQueryParameters::is_collide_with_bodies_enabled() const {
+bool PhysicsShapeQueryParameters2D::is_collide_with_bodies_enabled() const {
return collide_with_bodies;
}
-void Physics2DShapeQueryParameters::set_collide_with_areas(bool p_enable) {
+void PhysicsShapeQueryParameters2D::set_collide_with_areas(bool p_enable) {
collide_with_areas = p_enable;
}
-bool Physics2DShapeQueryParameters::is_collide_with_areas_enabled() const {
+bool PhysicsShapeQueryParameters2D::is_collide_with_areas_enabled() const {
return collide_with_areas;
}
-void Physics2DShapeQueryParameters::_bind_methods() {
+void PhysicsShapeQueryParameters2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_shape", "shape"), &Physics2DShapeQueryParameters::set_shape);
- ClassDB::bind_method(D_METHOD("set_shape_rid", "shape"), &Physics2DShapeQueryParameters::set_shape_rid);
- ClassDB::bind_method(D_METHOD("get_shape_rid"), &Physics2DShapeQueryParameters::get_shape_rid);
+ ClassDB::bind_method(D_METHOD("set_shape", "shape"), &PhysicsShapeQueryParameters2D::set_shape);
+ ClassDB::bind_method(D_METHOD("set_shape_rid", "shape"), &PhysicsShapeQueryParameters2D::set_shape_rid);
+ ClassDB::bind_method(D_METHOD("get_shape_rid"), &PhysicsShapeQueryParameters2D::get_shape_rid);
- ClassDB::bind_method(D_METHOD("set_transform", "transform"), &Physics2DShapeQueryParameters::set_transform);
- ClassDB::bind_method(D_METHOD("get_transform"), &Physics2DShapeQueryParameters::get_transform);
+ ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsShapeQueryParameters2D::set_transform);
+ ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsShapeQueryParameters2D::get_transform);
- ClassDB::bind_method(D_METHOD("set_motion", "motion"), &Physics2DShapeQueryParameters::set_motion);
- ClassDB::bind_method(D_METHOD("get_motion"), &Physics2DShapeQueryParameters::get_motion);
+ ClassDB::bind_method(D_METHOD("set_motion", "motion"), &PhysicsShapeQueryParameters2D::set_motion);
+ ClassDB::bind_method(D_METHOD("get_motion"), &PhysicsShapeQueryParameters2D::get_motion);
- ClassDB::bind_method(D_METHOD("set_margin", "margin"), &Physics2DShapeQueryParameters::set_margin);
- ClassDB::bind_method(D_METHOD("get_margin"), &Physics2DShapeQueryParameters::get_margin);
+ ClassDB::bind_method(D_METHOD("set_margin", "margin"), &PhysicsShapeQueryParameters2D::set_margin);
+ ClassDB::bind_method(D_METHOD("get_margin"), &PhysicsShapeQueryParameters2D::get_margin);
- ClassDB::bind_method(D_METHOD("set_collision_layer", "collision_layer"), &Physics2DShapeQueryParameters::set_collision_mask);
- ClassDB::bind_method(D_METHOD("get_collision_layer"), &Physics2DShapeQueryParameters::get_collision_mask);
+ ClassDB::bind_method(D_METHOD("set_collision_layer", "collision_layer"), &PhysicsShapeQueryParameters2D::set_collision_mask);
+ ClassDB::bind_method(D_METHOD("get_collision_layer"), &PhysicsShapeQueryParameters2D::get_collision_mask);
- ClassDB::bind_method(D_METHOD("set_exclude", "exclude"), &Physics2DShapeQueryParameters::set_exclude);
- ClassDB::bind_method(D_METHOD("get_exclude"), &Physics2DShapeQueryParameters::get_exclude);
+ ClassDB::bind_method(D_METHOD("set_exclude", "exclude"), &PhysicsShapeQueryParameters2D::set_exclude);
+ ClassDB::bind_method(D_METHOD("get_exclude"), &PhysicsShapeQueryParameters2D::get_exclude);
- ClassDB::bind_method(D_METHOD("set_collide_with_bodies", "enable"), &Physics2DShapeQueryParameters::set_collide_with_bodies);
- ClassDB::bind_method(D_METHOD("is_collide_with_bodies_enabled"), &Physics2DShapeQueryParameters::is_collide_with_bodies_enabled);
+ ClassDB::bind_method(D_METHOD("set_collide_with_bodies", "enable"), &PhysicsShapeQueryParameters2D::set_collide_with_bodies);
+ ClassDB::bind_method(D_METHOD("is_collide_with_bodies_enabled"), &PhysicsShapeQueryParameters2D::is_collide_with_bodies_enabled);
- ClassDB::bind_method(D_METHOD("set_collide_with_areas", "enable"), &Physics2DShapeQueryParameters::set_collide_with_areas);
- ClassDB::bind_method(D_METHOD("is_collide_with_areas_enabled"), &Physics2DShapeQueryParameters::is_collide_with_areas_enabled);
+ ClassDB::bind_method(D_METHOD("set_collide_with_areas", "enable"), &PhysicsShapeQueryParameters2D::set_collide_with_areas);
+ ClassDB::bind_method(D_METHOD("is_collide_with_areas_enabled"), &PhysicsShapeQueryParameters2D::is_collide_with_areas_enabled);
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "exclude", PROPERTY_HINT_NONE, itos(Variant::_RID) + ":"), "set_exclude", "get_exclude");
@@ -258,7 +258,7 @@ void Physics2DShapeQueryParameters::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with_areas"), "set_collide_with_areas", "is_collide_with_areas_enabled");
}
-Physics2DShapeQueryParameters::Physics2DShapeQueryParameters() {
+PhysicsShapeQueryParameters2D::PhysicsShapeQueryParameters2D() {
margin = 0;
collision_mask = 0x7FFFFFFF;
@@ -266,7 +266,7 @@ Physics2DShapeQueryParameters::Physics2DShapeQueryParameters() {
collide_with_areas = false;
}
-Dictionary Physics2DDirectSpaceState::_intersect_ray(const Vector2 &p_from, const Vector2 &p_to, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas) {
+Dictionary PhysicsDirectSpaceState2D::_intersect_ray(const Vector2 &p_from, const Vector2 &p_to, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas) {
RayResult inters;
Set<RID> exclude;
@@ -290,7 +290,7 @@ Dictionary Physics2DDirectSpaceState::_intersect_ray(const Vector2 &p_from, cons
return d;
}
-Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryParameters> &p_shape_query, int p_max_results) {
+Array PhysicsDirectSpaceState2D::_intersect_shape(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query, int p_max_results) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
@@ -313,7 +313,7 @@ Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryP
return ret;
}
-Array Physics2DDirectSpaceState::_cast_motion(const Ref<Physics2DShapeQueryParameters> &p_shape_query) {
+Array PhysicsDirectSpaceState2D::_cast_motion(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
@@ -328,7 +328,7 @@ Array Physics2DDirectSpaceState::_cast_motion(const Ref<Physics2DShapeQueryParam
return ret;
}
-Array Physics2DDirectSpaceState::_intersect_point_impl(const Vector2 &p_point, int p_max_results, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_filter_by_canvas, ObjectID p_canvas_instance_id) {
+Array PhysicsDirectSpaceState2D::_intersect_point_impl(const Vector2 &p_point, int p_max_results, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_filter_by_canvas, ObjectID p_canvas_instance_id) {
Set<RID> exclude;
for (int i = 0; i < p_exclude.size(); i++)
@@ -361,17 +361,17 @@ Array Physics2DDirectSpaceState::_intersect_point_impl(const Vector2 &p_point, i
return r;
}
-Array Physics2DDirectSpaceState::_intersect_point(const Vector2 &p_point, int p_max_results, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas) {
+Array PhysicsDirectSpaceState2D::_intersect_point(const Vector2 &p_point, int p_max_results, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas) {
return _intersect_point_impl(p_point, p_max_results, p_exclude, p_layers, p_collide_with_bodies, p_collide_with_areas);
}
-Array Physics2DDirectSpaceState::_intersect_point_on_canvas(const Vector2 &p_point, ObjectID p_canvas_intance_id, int p_max_results, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas) {
+Array PhysicsDirectSpaceState2D::_intersect_point_on_canvas(const Vector2 &p_point, ObjectID p_canvas_intance_id, int p_max_results, const Vector<RID> &p_exclude, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas) {
return _intersect_point_impl(p_point, p_max_results, p_exclude, p_layers, p_collide_with_bodies, p_collide_with_areas, true, p_canvas_intance_id);
}
-Array Physics2DDirectSpaceState::_collide_shape(const Ref<Physics2DShapeQueryParameters> &p_shape_query, int p_max_results) {
+Array PhysicsDirectSpaceState2D::_collide_shape(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query, int p_max_results) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
@@ -387,7 +387,7 @@ Array Physics2DDirectSpaceState::_collide_shape(const Ref<Physics2DShapeQueryPar
r[i] = ret[i];
return r;
}
-Dictionary Physics2DDirectSpaceState::_get_rest_info(const Ref<Physics2DShapeQueryParameters> &p_shape_query) {
+Dictionary PhysicsDirectSpaceState2D::_get_rest_info(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Dictionary());
@@ -409,51 +409,51 @@ Dictionary Physics2DDirectSpaceState::_get_rest_info(const Ref<Physics2DShapeQue
return r;
}
-Physics2DDirectSpaceState::Physics2DDirectSpaceState() {
+PhysicsDirectSpaceState2D::PhysicsDirectSpaceState2D() {
}
-void Physics2DDirectSpaceState::_bind_methods() {
+void PhysicsDirectSpaceState2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("intersect_point", "point", "max_results", "exclude", "collision_layer", "collide_with_bodies", "collide_with_areas"), &Physics2DDirectSpaceState::_intersect_point, DEFVAL(32), DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("intersect_point_on_canvas", "point", "canvas_instance_id", "max_results", "exclude", "collision_layer", "collide_with_bodies", "collide_with_areas"), &Physics2DDirectSpaceState::_intersect_point_on_canvas, DEFVAL(32), DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("intersect_ray", "from", "to", "exclude", "collision_layer", "collide_with_bodies", "collide_with_areas"), &Physics2DDirectSpaceState::_intersect_ray, DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("intersect_shape", "shape", "max_results"), &Physics2DDirectSpaceState::_intersect_shape, DEFVAL(32));
- ClassDB::bind_method(D_METHOD("cast_motion", "shape"), &Physics2DDirectSpaceState::_cast_motion);
- ClassDB::bind_method(D_METHOD("collide_shape", "shape", "max_results"), &Physics2DDirectSpaceState::_collide_shape, DEFVAL(32));
- ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &Physics2DDirectSpaceState::_get_rest_info);
+ ClassDB::bind_method(D_METHOD("intersect_point", "point", "max_results", "exclude", "collision_layer", "collide_with_bodies", "collide_with_areas"), &PhysicsDirectSpaceState2D::_intersect_point, DEFVAL(32), DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("intersect_point_on_canvas", "point", "canvas_instance_id", "max_results", "exclude", "collision_layer", "collide_with_bodies", "collide_with_areas"), &PhysicsDirectSpaceState2D::_intersect_point_on_canvas, DEFVAL(32), DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("intersect_ray", "from", "to", "exclude", "collision_layer", "collide_with_bodies", "collide_with_areas"), &PhysicsDirectSpaceState2D::_intersect_ray, DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("intersect_shape", "shape", "max_results"), &PhysicsDirectSpaceState2D::_intersect_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("cast_motion", "shape"), &PhysicsDirectSpaceState2D::_cast_motion);
+ ClassDB::bind_method(D_METHOD("collide_shape", "shape", "max_results"), &PhysicsDirectSpaceState2D::_collide_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &PhysicsDirectSpaceState2D::_get_rest_info);
}
-int Physics2DShapeQueryResult::get_result_count() const {
+int PhysicsShapeQueryResult2D::get_result_count() const {
return result.size();
}
-RID Physics2DShapeQueryResult::get_result_rid(int p_idx) const {
+RID PhysicsShapeQueryResult2D::get_result_rid(int p_idx) const {
return result[p_idx].rid;
}
-ObjectID Physics2DShapeQueryResult::get_result_object_id(int p_idx) const {
+ObjectID PhysicsShapeQueryResult2D::get_result_object_id(int p_idx) const {
return result[p_idx].collider_id;
}
-Object *Physics2DShapeQueryResult::get_result_object(int p_idx) const {
+Object *PhysicsShapeQueryResult2D::get_result_object(int p_idx) const {
return result[p_idx].collider;
}
-int Physics2DShapeQueryResult::get_result_object_shape(int p_idx) const {
+int PhysicsShapeQueryResult2D::get_result_object_shape(int p_idx) const {
return result[p_idx].shape;
}
-Physics2DShapeQueryResult::Physics2DShapeQueryResult() {
+PhysicsShapeQueryResult2D::PhysicsShapeQueryResult2D() {
}
-void Physics2DShapeQueryResult::_bind_methods() {
+void PhysicsShapeQueryResult2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_result_count"), &Physics2DShapeQueryResult::get_result_count);
- ClassDB::bind_method(D_METHOD("get_result_rid", "idx"), &Physics2DShapeQueryResult::get_result_rid);
- ClassDB::bind_method(D_METHOD("get_result_object_id", "idx"), &Physics2DShapeQueryResult::get_result_object_id);
- ClassDB::bind_method(D_METHOD("get_result_object", "idx"), &Physics2DShapeQueryResult::get_result_object);
- ClassDB::bind_method(D_METHOD("get_result_object_shape", "idx"), &Physics2DShapeQueryResult::get_result_object_shape);
+ ClassDB::bind_method(D_METHOD("get_result_count"), &PhysicsShapeQueryResult2D::get_result_count);
+ ClassDB::bind_method(D_METHOD("get_result_rid", "idx"), &PhysicsShapeQueryResult2D::get_result_rid);
+ ClassDB::bind_method(D_METHOD("get_result_object_id", "idx"), &PhysicsShapeQueryResult2D::get_result_object_id);
+ ClassDB::bind_method(D_METHOD("get_result_object", "idx"), &PhysicsShapeQueryResult2D::get_result_object);
+ ClassDB::bind_method(D_METHOD("get_result_object_shape", "idx"), &PhysicsShapeQueryResult2D::get_result_object_shape);
}
///////////////////////////////
@@ -529,7 +529,7 @@ Physics2DTestMotionResult::Physics2DTestMotionResult() {
///////////////////////////////////////
-bool Physics2DServer::_body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref<Physics2DTestMotionResult> &p_result) {
+bool PhysicsServer2D::_body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref<Physics2DTestMotionResult> &p_result) {
MotionResult *r = NULL;
if (p_result.is_valid())
@@ -537,154 +537,154 @@ bool Physics2DServer::_body_test_motion(RID p_body, const Transform2D &p_from, c
return body_test_motion(p_body, p_from, p_motion, p_infinite_inertia, p_margin, r);
}
-void Physics2DServer::_bind_methods() {
+void PhysicsServer2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("line_shape_create"), &Physics2DServer::line_shape_create);
- ClassDB::bind_method(D_METHOD("ray_shape_create"), &Physics2DServer::ray_shape_create);
- ClassDB::bind_method(D_METHOD("segment_shape_create"), &Physics2DServer::segment_shape_create);
- ClassDB::bind_method(D_METHOD("circle_shape_create"), &Physics2DServer::circle_shape_create);
- ClassDB::bind_method(D_METHOD("rectangle_shape_create"), &Physics2DServer::rectangle_shape_create);
- ClassDB::bind_method(D_METHOD("capsule_shape_create"), &Physics2DServer::capsule_shape_create);
- ClassDB::bind_method(D_METHOD("convex_polygon_shape_create"), &Physics2DServer::convex_polygon_shape_create);
- ClassDB::bind_method(D_METHOD("concave_polygon_shape_create"), &Physics2DServer::concave_polygon_shape_create);
+ ClassDB::bind_method(D_METHOD("line_shape_create"), &PhysicsServer2D::line_shape_create);
+ ClassDB::bind_method(D_METHOD("ray_shape_create"), &PhysicsServer2D::ray_shape_create);
+ ClassDB::bind_method(D_METHOD("segment_shape_create"), &PhysicsServer2D::segment_shape_create);
+ ClassDB::bind_method(D_METHOD("circle_shape_create"), &PhysicsServer2D::circle_shape_create);
+ ClassDB::bind_method(D_METHOD("rectangle_shape_create"), &PhysicsServer2D::rectangle_shape_create);
+ ClassDB::bind_method(D_METHOD("capsule_shape_create"), &PhysicsServer2D::capsule_shape_create);
+ ClassDB::bind_method(D_METHOD("convex_polygon_shape_create"), &PhysicsServer2D::convex_polygon_shape_create);
+ ClassDB::bind_method(D_METHOD("concave_polygon_shape_create"), &PhysicsServer2D::concave_polygon_shape_create);
- ClassDB::bind_method(D_METHOD("shape_set_data", "shape", "data"), &Physics2DServer::shape_set_data);
+ ClassDB::bind_method(D_METHOD("shape_set_data", "shape", "data"), &PhysicsServer2D::shape_set_data);
- ClassDB::bind_method(D_METHOD("shape_get_type", "shape"), &Physics2DServer::shape_get_type);
- ClassDB::bind_method(D_METHOD("shape_get_data", "shape"), &Physics2DServer::shape_get_data);
+ ClassDB::bind_method(D_METHOD("shape_get_type", "shape"), &PhysicsServer2D::shape_get_type);
+ ClassDB::bind_method(D_METHOD("shape_get_data", "shape"), &PhysicsServer2D::shape_get_data);
- ClassDB::bind_method(D_METHOD("space_create"), &Physics2DServer::space_create);
- ClassDB::bind_method(D_METHOD("space_set_active", "space", "active"), &Physics2DServer::space_set_active);
- ClassDB::bind_method(D_METHOD("space_is_active", "space"), &Physics2DServer::space_is_active);
- ClassDB::bind_method(D_METHOD("space_set_param", "space", "param", "value"), &Physics2DServer::space_set_param);
- ClassDB::bind_method(D_METHOD("space_get_param", "space", "param"), &Physics2DServer::space_get_param);
- ClassDB::bind_method(D_METHOD("space_get_direct_state", "space"), &Physics2DServer::space_get_direct_state);
+ ClassDB::bind_method(D_METHOD("space_create"), &PhysicsServer2D::space_create);
+ ClassDB::bind_method(D_METHOD("space_set_active", "space", "active"), &PhysicsServer2D::space_set_active);
+ ClassDB::bind_method(D_METHOD("space_is_active", "space"), &PhysicsServer2D::space_is_active);
+ ClassDB::bind_method(D_METHOD("space_set_param", "space", "param", "value"), &PhysicsServer2D::space_set_param);
+ ClassDB::bind_method(D_METHOD("space_get_param", "space", "param"), &PhysicsServer2D::space_get_param);
+ ClassDB::bind_method(D_METHOD("space_get_direct_state", "space"), &PhysicsServer2D::space_get_direct_state);
- ClassDB::bind_method(D_METHOD("area_create"), &Physics2DServer::area_create);
- ClassDB::bind_method(D_METHOD("area_set_space", "area", "space"), &Physics2DServer::area_set_space);
- ClassDB::bind_method(D_METHOD("area_get_space", "area"), &Physics2DServer::area_get_space);
+ ClassDB::bind_method(D_METHOD("area_create"), &PhysicsServer2D::area_create);
+ ClassDB::bind_method(D_METHOD("area_set_space", "area", "space"), &PhysicsServer2D::area_set_space);
+ ClassDB::bind_method(D_METHOD("area_get_space", "area"), &PhysicsServer2D::area_get_space);
- ClassDB::bind_method(D_METHOD("area_set_space_override_mode", "area", "mode"), &Physics2DServer::area_set_space_override_mode);
- ClassDB::bind_method(D_METHOD("area_get_space_override_mode", "area"), &Physics2DServer::area_get_space_override_mode);
+ ClassDB::bind_method(D_METHOD("area_set_space_override_mode", "area", "mode"), &PhysicsServer2D::area_set_space_override_mode);
+ ClassDB::bind_method(D_METHOD("area_get_space_override_mode", "area"), &PhysicsServer2D::area_get_space_override_mode);
- ClassDB::bind_method(D_METHOD("area_add_shape", "area", "shape", "transform", "disabled"), &Physics2DServer::area_add_shape, DEFVAL(Transform2D()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("area_set_shape", "area", "shape_idx", "shape"), &Physics2DServer::area_set_shape);
- ClassDB::bind_method(D_METHOD("area_set_shape_transform", "area", "shape_idx", "transform"), &Physics2DServer::area_set_shape_transform);
- ClassDB::bind_method(D_METHOD("area_set_shape_disabled", "area", "shape_idx", "disabled"), &Physics2DServer::area_set_shape_disabled);
+ ClassDB::bind_method(D_METHOD("area_add_shape", "area", "shape", "transform", "disabled"), &PhysicsServer2D::area_add_shape, DEFVAL(Transform2D()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("area_set_shape", "area", "shape_idx", "shape"), &PhysicsServer2D::area_set_shape);
+ ClassDB::bind_method(D_METHOD("area_set_shape_transform", "area", "shape_idx", "transform"), &PhysicsServer2D::area_set_shape_transform);
+ ClassDB::bind_method(D_METHOD("area_set_shape_disabled", "area", "shape_idx", "disabled"), &PhysicsServer2D::area_set_shape_disabled);
- ClassDB::bind_method(D_METHOD("area_get_shape_count", "area"), &Physics2DServer::area_get_shape_count);
- ClassDB::bind_method(D_METHOD("area_get_shape", "area", "shape_idx"), &Physics2DServer::area_get_shape);
- ClassDB::bind_method(D_METHOD("area_get_shape_transform", "area", "shape_idx"), &Physics2DServer::area_get_shape_transform);
+ ClassDB::bind_method(D_METHOD("area_get_shape_count", "area"), &PhysicsServer2D::area_get_shape_count);
+ ClassDB::bind_method(D_METHOD("area_get_shape", "area", "shape_idx"), &PhysicsServer2D::area_get_shape);
+ ClassDB::bind_method(D_METHOD("area_get_shape_transform", "area", "shape_idx"), &PhysicsServer2D::area_get_shape_transform);
- ClassDB::bind_method(D_METHOD("area_remove_shape", "area", "shape_idx"), &Physics2DServer::area_remove_shape);
- ClassDB::bind_method(D_METHOD("area_clear_shapes", "area"), &Physics2DServer::area_clear_shapes);
+ ClassDB::bind_method(D_METHOD("area_remove_shape", "area", "shape_idx"), &PhysicsServer2D::area_remove_shape);
+ ClassDB::bind_method(D_METHOD("area_clear_shapes", "area"), &PhysicsServer2D::area_clear_shapes);
- ClassDB::bind_method(D_METHOD("area_set_collision_layer", "area", "layer"), &Physics2DServer::area_set_collision_layer);
- ClassDB::bind_method(D_METHOD("area_set_collision_mask", "area", "mask"), &Physics2DServer::area_set_collision_mask);
+ ClassDB::bind_method(D_METHOD("area_set_collision_layer", "area", "layer"), &PhysicsServer2D::area_set_collision_layer);
+ ClassDB::bind_method(D_METHOD("area_set_collision_mask", "area", "mask"), &PhysicsServer2D::area_set_collision_mask);
- ClassDB::bind_method(D_METHOD("area_set_param", "area", "param", "value"), &Physics2DServer::area_set_param);
- ClassDB::bind_method(D_METHOD("area_set_transform", "area", "transform"), &Physics2DServer::area_set_transform);
+ ClassDB::bind_method(D_METHOD("area_set_param", "area", "param", "value"), &PhysicsServer2D::area_set_param);
+ ClassDB::bind_method(D_METHOD("area_set_transform", "area", "transform"), &PhysicsServer2D::area_set_transform);
- ClassDB::bind_method(D_METHOD("area_get_param", "area", "param"), &Physics2DServer::area_get_param);
- ClassDB::bind_method(D_METHOD("area_get_transform", "area"), &Physics2DServer::area_get_transform);
+ ClassDB::bind_method(D_METHOD("area_get_param", "area", "param"), &PhysicsServer2D::area_get_param);
+ ClassDB::bind_method(D_METHOD("area_get_transform", "area"), &PhysicsServer2D::area_get_transform);
- ClassDB::bind_method(D_METHOD("area_attach_object_instance_id", "area", "id"), &Physics2DServer::area_attach_object_instance_id);
- ClassDB::bind_method(D_METHOD("area_get_object_instance_id", "area"), &Physics2DServer::area_get_object_instance_id);
+ ClassDB::bind_method(D_METHOD("area_attach_object_instance_id", "area", "id"), &PhysicsServer2D::area_attach_object_instance_id);
+ ClassDB::bind_method(D_METHOD("area_get_object_instance_id", "area"), &PhysicsServer2D::area_get_object_instance_id);
- ClassDB::bind_method(D_METHOD("area_attach_canvas_instance_id", "area", "id"), &Physics2DServer::area_attach_canvas_instance_id);
- ClassDB::bind_method(D_METHOD("area_get_canvas_instance_id", "area"), &Physics2DServer::area_get_canvas_instance_id);
+ ClassDB::bind_method(D_METHOD("area_attach_canvas_instance_id", "area", "id"), &PhysicsServer2D::area_attach_canvas_instance_id);
+ ClassDB::bind_method(D_METHOD("area_get_canvas_instance_id", "area"), &PhysicsServer2D::area_get_canvas_instance_id);
- ClassDB::bind_method(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &Physics2DServer::area_set_monitor_callback);
- ClassDB::bind_method(D_METHOD("area_set_area_monitor_callback", "area", "receiver", "method"), &Physics2DServer::area_set_area_monitor_callback);
- ClassDB::bind_method(D_METHOD("area_set_monitorable", "area", "monitorable"), &Physics2DServer::area_set_monitorable);
+ ClassDB::bind_method(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &PhysicsServer2D::area_set_monitor_callback);
+ ClassDB::bind_method(D_METHOD("area_set_area_monitor_callback", "area", "receiver", "method"), &PhysicsServer2D::area_set_area_monitor_callback);
+ ClassDB::bind_method(D_METHOD("area_set_monitorable", "area", "monitorable"), &PhysicsServer2D::area_set_monitorable);
- ClassDB::bind_method(D_METHOD("body_create"), &Physics2DServer::body_create);
+ ClassDB::bind_method(D_METHOD("body_create"), &PhysicsServer2D::body_create);
- ClassDB::bind_method(D_METHOD("body_set_space", "body", "space"), &Physics2DServer::body_set_space);
- ClassDB::bind_method(D_METHOD("body_get_space", "body"), &Physics2DServer::body_get_space);
+ ClassDB::bind_method(D_METHOD("body_set_space", "body", "space"), &PhysicsServer2D::body_set_space);
+ ClassDB::bind_method(D_METHOD("body_get_space", "body"), &PhysicsServer2D::body_get_space);
- ClassDB::bind_method(D_METHOD("body_set_mode", "body", "mode"), &Physics2DServer::body_set_mode);
- ClassDB::bind_method(D_METHOD("body_get_mode", "body"), &Physics2DServer::body_get_mode);
+ ClassDB::bind_method(D_METHOD("body_set_mode", "body", "mode"), &PhysicsServer2D::body_set_mode);
+ ClassDB::bind_method(D_METHOD("body_get_mode", "body"), &PhysicsServer2D::body_get_mode);
- ClassDB::bind_method(D_METHOD("body_add_shape", "body", "shape", "transform", "disabled"), &Physics2DServer::body_add_shape, DEFVAL(Transform2D()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("body_set_shape", "body", "shape_idx", "shape"), &Physics2DServer::body_set_shape);
- ClassDB::bind_method(D_METHOD("body_set_shape_transform", "body", "shape_idx", "transform"), &Physics2DServer::body_set_shape_transform);
- ClassDB::bind_method(D_METHOD("body_set_shape_metadata", "body", "shape_idx", "metadata"), &Physics2DServer::body_set_shape_metadata);
+ ClassDB::bind_method(D_METHOD("body_add_shape", "body", "shape", "transform", "disabled"), &PhysicsServer2D::body_add_shape, DEFVAL(Transform2D()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("body_set_shape", "body", "shape_idx", "shape"), &PhysicsServer2D::body_set_shape);
+ ClassDB::bind_method(D_METHOD("body_set_shape_transform", "body", "shape_idx", "transform"), &PhysicsServer2D::body_set_shape_transform);
+ ClassDB::bind_method(D_METHOD("body_set_shape_metadata", "body", "shape_idx", "metadata"), &PhysicsServer2D::body_set_shape_metadata);
- ClassDB::bind_method(D_METHOD("body_get_shape_count", "body"), &Physics2DServer::body_get_shape_count);
- ClassDB::bind_method(D_METHOD("body_get_shape", "body", "shape_idx"), &Physics2DServer::body_get_shape);
- ClassDB::bind_method(D_METHOD("body_get_shape_transform", "body", "shape_idx"), &Physics2DServer::body_get_shape_transform);
- ClassDB::bind_method(D_METHOD("body_get_shape_metadata", "body", "shape_idx"), &Physics2DServer::body_get_shape_metadata);
+ ClassDB::bind_method(D_METHOD("body_get_shape_count", "body"), &PhysicsServer2D::body_get_shape_count);
+ ClassDB::bind_method(D_METHOD("body_get_shape", "body", "shape_idx"), &PhysicsServer2D::body_get_shape);
+ ClassDB::bind_method(D_METHOD("body_get_shape_transform", "body", "shape_idx"), &PhysicsServer2D::body_get_shape_transform);
+ ClassDB::bind_method(D_METHOD("body_get_shape_metadata", "body", "shape_idx"), &PhysicsServer2D::body_get_shape_metadata);
- ClassDB::bind_method(D_METHOD("body_remove_shape", "body", "shape_idx"), &Physics2DServer::body_remove_shape);
- ClassDB::bind_method(D_METHOD("body_clear_shapes", "body"), &Physics2DServer::body_clear_shapes);
+ ClassDB::bind_method(D_METHOD("body_remove_shape", "body", "shape_idx"), &PhysicsServer2D::body_remove_shape);
+ ClassDB::bind_method(D_METHOD("body_clear_shapes", "body"), &PhysicsServer2D::body_clear_shapes);
- ClassDB::bind_method(D_METHOD("body_set_shape_disabled", "body", "shape_idx", "disabled"), &Physics2DServer::body_set_shape_disabled);
- ClassDB::bind_method(D_METHOD("body_set_shape_as_one_way_collision", "body", "shape_idx", "enable", "margin"), &Physics2DServer::body_set_shape_as_one_way_collision);
+ ClassDB::bind_method(D_METHOD("body_set_shape_disabled", "body", "shape_idx", "disabled"), &PhysicsServer2D::body_set_shape_disabled);
+ ClassDB::bind_method(D_METHOD("body_set_shape_as_one_way_collision", "body", "shape_idx", "enable", "margin"), &PhysicsServer2D::body_set_shape_as_one_way_collision);
- ClassDB::bind_method(D_METHOD("body_attach_object_instance_id", "body", "id"), &Physics2DServer::body_attach_object_instance_id);
- ClassDB::bind_method(D_METHOD("body_get_object_instance_id", "body"), &Physics2DServer::body_get_object_instance_id);
+ ClassDB::bind_method(D_METHOD("body_attach_object_instance_id", "body", "id"), &PhysicsServer2D::body_attach_object_instance_id);
+ ClassDB::bind_method(D_METHOD("body_get_object_instance_id", "body"), &PhysicsServer2D::body_get_object_instance_id);
- ClassDB::bind_method(D_METHOD("body_attach_canvas_instance_id", "body", "id"), &Physics2DServer::body_attach_canvas_instance_id);
- ClassDB::bind_method(D_METHOD("body_get_canvas_instance_id", "body"), &Physics2DServer::body_get_canvas_instance_id);
+ ClassDB::bind_method(D_METHOD("body_attach_canvas_instance_id", "body", "id"), &PhysicsServer2D::body_attach_canvas_instance_id);
+ ClassDB::bind_method(D_METHOD("body_get_canvas_instance_id", "body"), &PhysicsServer2D::body_get_canvas_instance_id);
- ClassDB::bind_method(D_METHOD("body_set_continuous_collision_detection_mode", "body", "mode"), &Physics2DServer::body_set_continuous_collision_detection_mode);
- ClassDB::bind_method(D_METHOD("body_get_continuous_collision_detection_mode", "body"), &Physics2DServer::body_get_continuous_collision_detection_mode);
+ ClassDB::bind_method(D_METHOD("body_set_continuous_collision_detection_mode", "body", "mode"), &PhysicsServer2D::body_set_continuous_collision_detection_mode);
+ ClassDB::bind_method(D_METHOD("body_get_continuous_collision_detection_mode", "body"), &PhysicsServer2D::body_get_continuous_collision_detection_mode);
- ClassDB::bind_method(D_METHOD("body_set_collision_layer", "body", "layer"), &Physics2DServer::body_set_collision_layer);
- ClassDB::bind_method(D_METHOD("body_get_collision_layer", "body"), &Physics2DServer::body_get_collision_layer);
+ ClassDB::bind_method(D_METHOD("body_set_collision_layer", "body", "layer"), &PhysicsServer2D::body_set_collision_layer);
+ ClassDB::bind_method(D_METHOD("body_get_collision_layer", "body"), &PhysicsServer2D::body_get_collision_layer);
- ClassDB::bind_method(D_METHOD("body_set_collision_mask", "body", "mask"), &Physics2DServer::body_set_collision_mask);
- ClassDB::bind_method(D_METHOD("body_get_collision_mask", "body"), &Physics2DServer::body_get_collision_mask);
+ ClassDB::bind_method(D_METHOD("body_set_collision_mask", "body", "mask"), &PhysicsServer2D::body_set_collision_mask);
+ ClassDB::bind_method(D_METHOD("body_get_collision_mask", "body"), &PhysicsServer2D::body_get_collision_mask);
- ClassDB::bind_method(D_METHOD("body_set_param", "body", "param", "value"), &Physics2DServer::body_set_param);
- ClassDB::bind_method(D_METHOD("body_get_param", "body", "param"), &Physics2DServer::body_get_param);
+ ClassDB::bind_method(D_METHOD("body_set_param", "body", "param", "value"), &PhysicsServer2D::body_set_param);
+ ClassDB::bind_method(D_METHOD("body_get_param", "body", "param"), &PhysicsServer2D::body_get_param);
- ClassDB::bind_method(D_METHOD("body_set_state", "body", "state", "value"), &Physics2DServer::body_set_state);
- ClassDB::bind_method(D_METHOD("body_get_state", "body", "state"), &Physics2DServer::body_get_state);
+ ClassDB::bind_method(D_METHOD("body_set_state", "body", "state", "value"), &PhysicsServer2D::body_set_state);
+ ClassDB::bind_method(D_METHOD("body_get_state", "body", "state"), &PhysicsServer2D::body_get_state);
- ClassDB::bind_method(D_METHOD("body_apply_central_impulse", "body", "impulse"), &Physics2DServer::body_apply_central_impulse);
- ClassDB::bind_method(D_METHOD("body_apply_torque_impulse", "body", "impulse"), &Physics2DServer::body_apply_torque_impulse);
- ClassDB::bind_method(D_METHOD("body_apply_impulse", "body", "position", "impulse"), &Physics2DServer::body_apply_impulse);
- ClassDB::bind_method(D_METHOD("body_add_central_force", "body", "force"), &Physics2DServer::body_add_central_force);
- ClassDB::bind_method(D_METHOD("body_add_force", "body", "offset", "force"), &Physics2DServer::body_add_force);
- ClassDB::bind_method(D_METHOD("body_add_torque", "body", "torque"), &Physics2DServer::body_add_torque);
- ClassDB::bind_method(D_METHOD("body_set_axis_velocity", "body", "axis_velocity"), &Physics2DServer::body_set_axis_velocity);
+ ClassDB::bind_method(D_METHOD("body_apply_central_impulse", "body", "impulse"), &PhysicsServer2D::body_apply_central_impulse);
+ ClassDB::bind_method(D_METHOD("body_apply_torque_impulse", "body", "impulse"), &PhysicsServer2D::body_apply_torque_impulse);
+ ClassDB::bind_method(D_METHOD("body_apply_impulse", "body", "position", "impulse"), &PhysicsServer2D::body_apply_impulse);
+ ClassDB::bind_method(D_METHOD("body_add_central_force", "body", "force"), &PhysicsServer2D::body_add_central_force);
+ ClassDB::bind_method(D_METHOD("body_add_force", "body", "offset", "force"), &PhysicsServer2D::body_add_force);
+ ClassDB::bind_method(D_METHOD("body_add_torque", "body", "torque"), &PhysicsServer2D::body_add_torque);
+ ClassDB::bind_method(D_METHOD("body_set_axis_velocity", "body", "axis_velocity"), &PhysicsServer2D::body_set_axis_velocity);
- ClassDB::bind_method(D_METHOD("body_add_collision_exception", "body", "excepted_body"), &Physics2DServer::body_add_collision_exception);
- ClassDB::bind_method(D_METHOD("body_remove_collision_exception", "body", "excepted_body"), &Physics2DServer::body_remove_collision_exception);
+ ClassDB::bind_method(D_METHOD("body_add_collision_exception", "body", "excepted_body"), &PhysicsServer2D::body_add_collision_exception);
+ ClassDB::bind_method(D_METHOD("body_remove_collision_exception", "body", "excepted_body"), &PhysicsServer2D::body_remove_collision_exception);
- ClassDB::bind_method(D_METHOD("body_set_max_contacts_reported", "body", "amount"), &Physics2DServer::body_set_max_contacts_reported);
- ClassDB::bind_method(D_METHOD("body_get_max_contacts_reported", "body"), &Physics2DServer::body_get_max_contacts_reported);
+ ClassDB::bind_method(D_METHOD("body_set_max_contacts_reported", "body", "amount"), &PhysicsServer2D::body_set_max_contacts_reported);
+ ClassDB::bind_method(D_METHOD("body_get_max_contacts_reported", "body"), &PhysicsServer2D::body_get_max_contacts_reported);
- ClassDB::bind_method(D_METHOD("body_set_omit_force_integration", "body", "enable"), &Physics2DServer::body_set_omit_force_integration);
- ClassDB::bind_method(D_METHOD("body_is_omitting_force_integration", "body"), &Physics2DServer::body_is_omitting_force_integration);
+ ClassDB::bind_method(D_METHOD("body_set_omit_force_integration", "body", "enable"), &PhysicsServer2D::body_set_omit_force_integration);
+ ClassDB::bind_method(D_METHOD("body_is_omitting_force_integration", "body"), &PhysicsServer2D::body_is_omitting_force_integration);
- ClassDB::bind_method(D_METHOD("body_set_force_integration_callback", "body", "receiver", "method", "userdata"), &Physics2DServer::body_set_force_integration_callback, DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("body_set_force_integration_callback", "body", "receiver", "method", "userdata"), &PhysicsServer2D::body_set_force_integration_callback, DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("body_test_motion", "body", "from", "motion", "infinite_inertia", "margin", "result"), &Physics2DServer::_body_test_motion, DEFVAL(0.08), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("body_test_motion", "body", "from", "motion", "infinite_inertia", "margin", "result"), &PhysicsServer2D::_body_test_motion, DEFVAL(0.08), DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("body_get_direct_state", "body"), &Physics2DServer::body_get_direct_state);
+ ClassDB::bind_method(D_METHOD("body_get_direct_state", "body"), &PhysicsServer2D::body_get_direct_state);
/* JOINT API */
- ClassDB::bind_method(D_METHOD("joint_set_param", "joint", "param", "value"), &Physics2DServer::joint_set_param);
- ClassDB::bind_method(D_METHOD("joint_get_param", "joint", "param"), &Physics2DServer::joint_get_param);
+ ClassDB::bind_method(D_METHOD("joint_set_param", "joint", "param", "value"), &PhysicsServer2D::joint_set_param);
+ ClassDB::bind_method(D_METHOD("joint_get_param", "joint", "param"), &PhysicsServer2D::joint_get_param);
- ClassDB::bind_method(D_METHOD("pin_joint_create", "anchor", "body_a", "body_b"), &Physics2DServer::pin_joint_create, DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("groove_joint_create", "groove1_a", "groove2_a", "anchor_b", "body_a", "body_b"), &Physics2DServer::groove_joint_create, DEFVAL(RID()), DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("damped_spring_joint_create", "anchor_a", "anchor_b", "body_a", "body_b"), &Physics2DServer::damped_spring_joint_create, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("pin_joint_create", "anchor", "body_a", "body_b"), &PhysicsServer2D::pin_joint_create, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("groove_joint_create", "groove1_a", "groove2_a", "anchor_b", "body_a", "body_b"), &PhysicsServer2D::groove_joint_create, DEFVAL(RID()), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("damped_spring_joint_create", "anchor_a", "anchor_b", "body_a", "body_b"), &PhysicsServer2D::damped_spring_joint_create, DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("damped_string_joint_set_param", "joint", "param", "value"), &Physics2DServer::damped_string_joint_set_param);
- ClassDB::bind_method(D_METHOD("damped_string_joint_get_param", "joint", "param"), &Physics2DServer::damped_string_joint_get_param);
+ ClassDB::bind_method(D_METHOD("damped_string_joint_set_param", "joint", "param", "value"), &PhysicsServer2D::damped_string_joint_set_param);
+ ClassDB::bind_method(D_METHOD("damped_string_joint_get_param", "joint", "param"), &PhysicsServer2D::damped_string_joint_get_param);
- ClassDB::bind_method(D_METHOD("joint_get_type", "joint"), &Physics2DServer::joint_get_type);
+ ClassDB::bind_method(D_METHOD("joint_get_type", "joint"), &PhysicsServer2D::joint_get_type);
- ClassDB::bind_method(D_METHOD("free_rid", "rid"), &Physics2DServer::free);
+ ClassDB::bind_method(D_METHOD("free_rid", "rid"), &PhysicsServer2D::free);
- ClassDB::bind_method(D_METHOD("set_active", "active"), &Physics2DServer::set_active);
+ ClassDB::bind_method(D_METHOD("set_active", "active"), &PhysicsServer2D::set_active);
- ClassDB::bind_method(D_METHOD("get_process_info", "process_info"), &Physics2DServer::get_process_info);
+ ClassDB::bind_method(D_METHOD("get_process_info", "process_info"), &PhysicsServer2D::get_process_info);
BIND_ENUM_CONSTANT(SPACE_PARAM_CONTACT_RECYCLE_RADIUS);
BIND_ENUM_CONSTANT(SPACE_PARAM_CONTACT_MAX_SEPARATION);
@@ -764,22 +764,22 @@ void Physics2DServer::_bind_methods() {
BIND_ENUM_CONSTANT(INFO_ISLAND_COUNT);
}
-Physics2DServer::Physics2DServer() {
+PhysicsServer2D::PhysicsServer2D() {
singleton = this;
}
-Physics2DServer::~Physics2DServer() {
+PhysicsServer2D::~PhysicsServer2D() {
singleton = NULL;
}
-Vector<Physics2DServerManager::ClassInfo> Physics2DServerManager::physics_2d_servers;
-int Physics2DServerManager::default_server_id = -1;
-int Physics2DServerManager::default_server_priority = -1;
-const String Physics2DServerManager::setting_property_name("physics/2d/physics_engine");
+Vector<PhysicsServer2DManager::ClassInfo> PhysicsServer2DManager::physics_2d_servers;
+int PhysicsServer2DManager::default_server_id = -1;
+int PhysicsServer2DManager::default_server_priority = -1;
+const String PhysicsServer2DManager::setting_property_name("physics/2d/physics_engine");
-void Physics2DServerManager::on_servers_changed() {
+void PhysicsServer2DManager::on_servers_changed() {
String physics_servers("DEFAULT");
for (int i = get_servers_count() - 1; 0 <= i; --i) {
@@ -788,7 +788,7 @@ void Physics2DServerManager::on_servers_changed() {
ProjectSettings::get_singleton()->set_custom_property_info(setting_property_name, PropertyInfo(Variant::STRING, setting_property_name, PROPERTY_HINT_ENUM, physics_servers));
}
-void Physics2DServerManager::register_server(const String &p_name, CreatePhysics2DServerCallback p_creat_callback) {
+void PhysicsServer2DManager::register_server(const String &p_name, CreatePhysicsServer2DCallback p_creat_callback) {
ERR_FAIL_COND(!p_creat_callback);
ERR_FAIL_COND(find_server_id(p_name) != -1);
@@ -796,7 +796,7 @@ void Physics2DServerManager::register_server(const String &p_name, CreatePhysics
on_servers_changed();
}
-void Physics2DServerManager::set_default_server(const String &p_name, int p_priority) {
+void PhysicsServer2DManager::set_default_server(const String &p_name, int p_priority) {
const int id = find_server_id(p_name);
ERR_FAIL_COND(id == -1); // Not found
@@ -806,7 +806,7 @@ void Physics2DServerManager::set_default_server(const String &p_name, int p_prio
}
}
-int Physics2DServerManager::find_server_id(const String &p_name) {
+int PhysicsServer2DManager::find_server_id(const String &p_name) {
for (int i = physics_2d_servers.size() - 1; 0 <= i; --i) {
if (p_name == physics_2d_servers[i].name) {
@@ -816,21 +816,21 @@ int Physics2DServerManager::find_server_id(const String &p_name) {
return -1;
}
-int Physics2DServerManager::get_servers_count() {
+int PhysicsServer2DManager::get_servers_count() {
return physics_2d_servers.size();
}
-String Physics2DServerManager::get_server_name(int p_id) {
+String PhysicsServer2DManager::get_server_name(int p_id) {
ERR_FAIL_INDEX_V(p_id, get_servers_count(), "");
return physics_2d_servers[p_id].name;
}
-Physics2DServer *Physics2DServerManager::new_default_server() {
+PhysicsServer2D *PhysicsServer2DManager::new_default_server() {
ERR_FAIL_COND_V(default_server_id == -1, NULL);
return physics_2d_servers[default_server_id].create_callback();
}
-Physics2DServer *Physics2DServerManager::new_server(const String &p_name) {
+PhysicsServer2D *PhysicsServer2DManager::new_server(const String &p_name) {
int id = find_server_id(p_name);
if (id == -1) {
return NULL;
diff --git a/servers/physics_2d_server.h b/servers/physics_server_2d.h
index c923ef16b7..9fa3a7b71a 100644
--- a/servers/physics_2d_server.h
+++ b/servers/physics_server_2d.h
@@ -35,11 +35,11 @@
#include "core/reference.h"
#include "core/resource.h"
-class Physics2DDirectSpaceState;
+class PhysicsDirectSpaceState2D;
-class Physics2DDirectBodyState : public Object {
+class PhysicsDirectBodyState2D : public Object {
- GDCLASS(Physics2DDirectBodyState, Object);
+ GDCLASS(PhysicsDirectBodyState2D, Object);
protected:
static void _bind_methods();
@@ -88,18 +88,18 @@ public:
virtual real_t get_step() const = 0;
virtual void integrate_forces();
- virtual Physics2DDirectSpaceState *get_space_state() = 0;
+ virtual PhysicsDirectSpaceState2D *get_space_state() = 0;
- Physics2DDirectBodyState();
+ PhysicsDirectBodyState2D();
};
-class Physics2DShapeQueryResult;
+class PhysicsShapeQueryResult2D;
//used for script
-class Physics2DShapeQueryParameters : public Reference {
+class PhysicsShapeQueryParameters2D : public Reference {
- GDCLASS(Physics2DShapeQueryParameters, Reference);
- friend class Physics2DDirectSpaceState;
+ GDCLASS(PhysicsShapeQueryParameters2D, Reference);
+ friend class PhysicsDirectSpaceState2D;
RID shape;
Transform2D transform;
Vector2 motion;
@@ -139,21 +139,21 @@ public:
void set_exclude(const Vector<RID> &p_exclude);
Vector<RID> get_exclude() const;
- Physics2DShapeQueryParameters();
+ PhysicsShapeQueryParameters2D();
};
-class Physics2DDirectSpaceState : public Object {
+class PhysicsDirectSpaceState2D : public Object {
- GDCLASS(Physics2DDirectSpaceState, Object);
+ GDCLASS(PhysicsDirectSpaceState2D, Object);
Dictionary _intersect_ray(const Vector2 &p_from, const Vector2 &p_to, const Vector<RID> &p_exclude = Vector<RID>(), uint32_t p_layers = 0, bool p_collide_with_bodies = true, bool p_collide_with_areas = false);
Array _intersect_point(const Vector2 &p_point, int p_max_results = 32, const Vector<RID> &p_exclude = Vector<RID>(), uint32_t p_layers = 0, bool p_collide_with_bodies = true, bool p_collide_with_areas = false);
Array _intersect_point_on_canvas(const Vector2 &p_point, ObjectID p_canvas_intance_id, int p_max_results = 32, const Vector<RID> &p_exclude = Vector<RID>(), uint32_t p_layers = 0, bool p_collide_with_bodies = true, bool p_collide_with_areas = false);
Array _intersect_point_impl(const Vector2 &p_point, int p_max_results, const Vector<RID> &p_exclud, uint32_t p_layers, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_filter_by_canvas = false, ObjectID p_canvas_instance_id = ObjectID());
- Array _intersect_shape(const Ref<Physics2DShapeQueryParameters> &p_shape_query, int p_max_results = 32);
- Array _cast_motion(const Ref<Physics2DShapeQueryParameters> &p_shape_query);
- Array _collide_shape(const Ref<Physics2DShapeQueryParameters> &p_shape_query, int p_max_results = 32);
- Dictionary _get_rest_info(const Ref<Physics2DShapeQueryParameters> &p_shape_query);
+ Array _intersect_shape(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query, int p_max_results = 32);
+ Array _cast_motion(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query);
+ Array _collide_shape(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query, int p_max_results = 32);
+ Dictionary _get_rest_info(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query);
protected:
static void _bind_methods();
@@ -203,16 +203,16 @@ public:
virtual bool rest_info(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false) = 0;
- Physics2DDirectSpaceState();
+ PhysicsDirectSpaceState2D();
};
-class Physics2DShapeQueryResult : public Reference {
+class PhysicsShapeQueryResult2D : public Reference {
- GDCLASS(Physics2DShapeQueryResult, Reference);
+ GDCLASS(PhysicsShapeQueryResult2D, Reference);
- Vector<Physics2DDirectSpaceState::ShapeResult> result;
+ Vector<PhysicsDirectSpaceState2D::ShapeResult> result;
- friend class Physics2DDirectSpaceState;
+ friend class PhysicsDirectSpaceState2D;
protected:
static void _bind_methods();
@@ -224,16 +224,16 @@ public:
Object *get_result_object(int p_idx) const;
int get_result_object_shape(int p_idx) const;
- Physics2DShapeQueryResult();
+ PhysicsShapeQueryResult2D();
};
class Physics2DTestMotionResult;
-class Physics2DServer : public Object {
+class PhysicsServer2D : public Object {
- GDCLASS(Physics2DServer, Object);
+ GDCLASS(PhysicsServer2D, Object);
- static Physics2DServer *singleton;
+ static PhysicsServer2D *singleton;
virtual bool _body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, float p_margin = 0.08, const Ref<Physics2DTestMotionResult> &p_result = Ref<Physics2DTestMotionResult>());
@@ -241,7 +241,7 @@ protected:
static void _bind_methods();
public:
- static Physics2DServer *get_singleton();
+ static PhysicsServer2D *get_singleton();
enum ShapeType {
SHAPE_LINE, ///< plane:"plane"
@@ -296,7 +296,7 @@ public:
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const = 0;
// this function only works on physics process, errors and returns null otherwise
- virtual Physics2DDirectSpaceState *space_get_direct_state(RID p_space) = 0;
+ virtual PhysicsDirectSpaceState2D *space_get_direct_state(RID p_space) = 0;
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) = 0;
virtual Vector<Vector2> space_get_contacts(RID p_space) const = 0;
@@ -490,7 +490,7 @@ public:
virtual void body_set_pickable(RID p_body, bool p_pickable) = 0;
// this function only works on physics process, errors and returns null otherwise
- virtual Physics2DDirectBodyState *body_get_direct_state(RID p_body) = 0;
+ virtual PhysicsDirectBodyState2D *body_get_direct_state(RID p_body) = 0;
struct MotionResult {
@@ -602,23 +602,23 @@ public:
virtual int get_process_info(ProcessInfo p_info) = 0;
- Physics2DServer();
- ~Physics2DServer();
+ PhysicsServer2D();
+ ~PhysicsServer2D();
};
class Physics2DTestMotionResult : public Reference {
GDCLASS(Physics2DTestMotionResult, Reference);
- Physics2DServer::MotionResult result;
+ PhysicsServer2D::MotionResult result;
bool colliding;
- friend class Physics2DServer;
+ friend class PhysicsServer2D;
protected:
static void _bind_methods();
public:
- Physics2DServer::MotionResult *get_result_ptr() const { return const_cast<Physics2DServer::MotionResult *>(&result); }
+ PhysicsServer2D::MotionResult *get_result_ptr() const { return const_cast<PhysicsServer2D::MotionResult *>(&result); }
//bool is_colliding() const;
Vector2 get_motion() const;
@@ -635,18 +635,18 @@ public:
Physics2DTestMotionResult();
};
-typedef Physics2DServer *(*CreatePhysics2DServerCallback)();
+typedef PhysicsServer2D *(*CreatePhysicsServer2DCallback)();
-class Physics2DServerManager {
+class PhysicsServer2DManager {
struct ClassInfo {
String name;
- CreatePhysics2DServerCallback create_callback;
+ CreatePhysicsServer2DCallback create_callback;
ClassInfo() :
name(""),
create_callback(NULL) {}
- ClassInfo(String p_name, CreatePhysics2DServerCallback p_create_callback) :
+ ClassInfo(String p_name, CreatePhysicsServer2DCallback p_create_callback) :
name(p_name),
create_callback(p_create_callback) {}
@@ -672,28 +672,28 @@ private:
static void on_servers_changed();
public:
- static void register_server(const String &p_name, CreatePhysics2DServerCallback p_creat_callback);
+ static void register_server(const String &p_name, CreatePhysicsServer2DCallback p_creat_callback);
static void set_default_server(const String &p_name, int p_priority = 0);
static int find_server_id(const String &p_name);
static int get_servers_count();
static String get_server_name(int p_id);
- static Physics2DServer *new_default_server();
- static Physics2DServer *new_server(const String &p_name);
+ static PhysicsServer2D *new_default_server();
+ static PhysicsServer2D *new_server(const String &p_name);
};
-VARIANT_ENUM_CAST(Physics2DServer::ShapeType);
-VARIANT_ENUM_CAST(Physics2DServer::SpaceParameter);
-VARIANT_ENUM_CAST(Physics2DServer::AreaParameter);
-VARIANT_ENUM_CAST(Physics2DServer::AreaSpaceOverrideMode);
-VARIANT_ENUM_CAST(Physics2DServer::BodyMode);
-VARIANT_ENUM_CAST(Physics2DServer::BodyParameter);
-VARIANT_ENUM_CAST(Physics2DServer::BodyState);
-VARIANT_ENUM_CAST(Physics2DServer::CCDMode);
-VARIANT_ENUM_CAST(Physics2DServer::JointParam);
-VARIANT_ENUM_CAST(Physics2DServer::JointType);
-VARIANT_ENUM_CAST(Physics2DServer::DampedStringParam);
-//VARIANT_ENUM_CAST( Physics2DServer::ObjectType );
-VARIANT_ENUM_CAST(Physics2DServer::AreaBodyStatus);
-VARIANT_ENUM_CAST(Physics2DServer::ProcessInfo);
+VARIANT_ENUM_CAST(PhysicsServer2D::ShapeType);
+VARIANT_ENUM_CAST(PhysicsServer2D::SpaceParameter);
+VARIANT_ENUM_CAST(PhysicsServer2D::AreaParameter);
+VARIANT_ENUM_CAST(PhysicsServer2D::AreaSpaceOverrideMode);
+VARIANT_ENUM_CAST(PhysicsServer2D::BodyMode);
+VARIANT_ENUM_CAST(PhysicsServer2D::BodyParameter);
+VARIANT_ENUM_CAST(PhysicsServer2D::BodyState);
+VARIANT_ENUM_CAST(PhysicsServer2D::CCDMode);
+VARIANT_ENUM_CAST(PhysicsServer2D::JointParam);
+VARIANT_ENUM_CAST(PhysicsServer2D::JointType);
+VARIANT_ENUM_CAST(PhysicsServer2D::DampedStringParam);
+//VARIANT_ENUM_CAST( PhysicsServer2D::ObjectType );
+VARIANT_ENUM_CAST(PhysicsServer2D::AreaBodyStatus);
+VARIANT_ENUM_CAST(PhysicsServer2D::ProcessInfo);
#endif
diff --git a/servers/physics_server.cpp b/servers/physics_server_3d.cpp
index 57f3a7979e..ddc96d2722 100644
--- a/servers/physics_server.cpp
+++ b/servers/physics_server_3d.cpp
@@ -28,15 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "physics_server.h"
+#include "physics_server_3d.h"
#include "core/method_bind_ext.gen.inc"
#include "core/print_string.h"
#include "core/project_settings.h"
-PhysicsServer *PhysicsServer::singleton = NULL;
+PhysicsServer3D *PhysicsServer3D::singleton = NULL;
-void PhysicsDirectBodyState::integrate_forces() {
+void PhysicsDirectBodyState3D::integrate_forces() {
real_t step = get_step();
Vector3 lv = get_linear_velocity();
@@ -61,64 +61,64 @@ void PhysicsDirectBodyState::integrate_forces() {
set_angular_velocity(av);
}
-Object *PhysicsDirectBodyState::get_contact_collider_object(int p_contact_idx) const {
+Object *PhysicsDirectBodyState3D::get_contact_collider_object(int p_contact_idx) const {
ObjectID objid = get_contact_collider_id(p_contact_idx);
Object *obj = ObjectDB::get_instance(objid);
return obj;
}
-PhysicsServer *PhysicsServer::get_singleton() {
+PhysicsServer3D *PhysicsServer3D::get_singleton() {
return singleton;
}
-void PhysicsDirectBodyState::_bind_methods() {
+void PhysicsDirectBodyState3D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_total_gravity"), &PhysicsDirectBodyState::get_total_gravity);
- ClassDB::bind_method(D_METHOD("get_total_linear_damp"), &PhysicsDirectBodyState::get_total_linear_damp);
- ClassDB::bind_method(D_METHOD("get_total_angular_damp"), &PhysicsDirectBodyState::get_total_angular_damp);
+ ClassDB::bind_method(D_METHOD("get_total_gravity"), &PhysicsDirectBodyState3D::get_total_gravity);
+ ClassDB::bind_method(D_METHOD("get_total_linear_damp"), &PhysicsDirectBodyState3D::get_total_linear_damp);
+ ClassDB::bind_method(D_METHOD("get_total_angular_damp"), &PhysicsDirectBodyState3D::get_total_angular_damp);
- ClassDB::bind_method(D_METHOD("get_center_of_mass"), &PhysicsDirectBodyState::get_center_of_mass);
- ClassDB::bind_method(D_METHOD("get_principal_inertia_axes"), &PhysicsDirectBodyState::get_principal_inertia_axes);
+ ClassDB::bind_method(D_METHOD("get_center_of_mass"), &PhysicsDirectBodyState3D::get_center_of_mass);
+ ClassDB::bind_method(D_METHOD("get_principal_inertia_axes"), &PhysicsDirectBodyState3D::get_principal_inertia_axes);
- ClassDB::bind_method(D_METHOD("get_inverse_mass"), &PhysicsDirectBodyState::get_inverse_mass);
- ClassDB::bind_method(D_METHOD("get_inverse_inertia"), &PhysicsDirectBodyState::get_inverse_inertia);
+ ClassDB::bind_method(D_METHOD("get_inverse_mass"), &PhysicsDirectBodyState3D::get_inverse_mass);
+ ClassDB::bind_method(D_METHOD("get_inverse_inertia"), &PhysicsDirectBodyState3D::get_inverse_inertia);
- ClassDB::bind_method(D_METHOD("set_linear_velocity", "velocity"), &PhysicsDirectBodyState::set_linear_velocity);
- ClassDB::bind_method(D_METHOD("get_linear_velocity"), &PhysicsDirectBodyState::get_linear_velocity);
+ ClassDB::bind_method(D_METHOD("set_linear_velocity", "velocity"), &PhysicsDirectBodyState3D::set_linear_velocity);
+ ClassDB::bind_method(D_METHOD("get_linear_velocity"), &PhysicsDirectBodyState3D::get_linear_velocity);
- ClassDB::bind_method(D_METHOD("set_angular_velocity", "velocity"), &PhysicsDirectBodyState::set_angular_velocity);
- ClassDB::bind_method(D_METHOD("get_angular_velocity"), &PhysicsDirectBodyState::get_angular_velocity);
+ ClassDB::bind_method(D_METHOD("set_angular_velocity", "velocity"), &PhysicsDirectBodyState3D::set_angular_velocity);
+ ClassDB::bind_method(D_METHOD("get_angular_velocity"), &PhysicsDirectBodyState3D::get_angular_velocity);
- ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsDirectBodyState::set_transform);
- ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsDirectBodyState::get_transform);
+ ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsDirectBodyState3D::set_transform);
+ ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsDirectBodyState3D::get_transform);
- ClassDB::bind_method(D_METHOD("add_central_force", "force"), &PhysicsDirectBodyState::add_central_force);
- ClassDB::bind_method(D_METHOD("add_force", "force", "position"), &PhysicsDirectBodyState::add_force);
- ClassDB::bind_method(D_METHOD("add_torque", "torque"), &PhysicsDirectBodyState::add_torque);
- ClassDB::bind_method(D_METHOD("apply_central_impulse", "j"), &PhysicsDirectBodyState::apply_central_impulse);
- ClassDB::bind_method(D_METHOD("apply_impulse", "position", "j"), &PhysicsDirectBodyState::apply_impulse);
- ClassDB::bind_method(D_METHOD("apply_torque_impulse", "j"), &PhysicsDirectBodyState::apply_torque_impulse);
+ ClassDB::bind_method(D_METHOD("add_central_force", "force"), &PhysicsDirectBodyState3D::add_central_force);
+ ClassDB::bind_method(D_METHOD("add_force", "force", "position"), &PhysicsDirectBodyState3D::add_force);
+ ClassDB::bind_method(D_METHOD("add_torque", "torque"), &PhysicsDirectBodyState3D::add_torque);
+ ClassDB::bind_method(D_METHOD("apply_central_impulse", "j"), &PhysicsDirectBodyState3D::apply_central_impulse);
+ ClassDB::bind_method(D_METHOD("apply_impulse", "position", "j"), &PhysicsDirectBodyState3D::apply_impulse);
+ ClassDB::bind_method(D_METHOD("apply_torque_impulse", "j"), &PhysicsDirectBodyState3D::apply_torque_impulse);
- ClassDB::bind_method(D_METHOD("set_sleep_state", "enabled"), &PhysicsDirectBodyState::set_sleep_state);
- ClassDB::bind_method(D_METHOD("is_sleeping"), &PhysicsDirectBodyState::is_sleeping);
+ ClassDB::bind_method(D_METHOD("set_sleep_state", "enabled"), &PhysicsDirectBodyState3D::set_sleep_state);
+ ClassDB::bind_method(D_METHOD("is_sleeping"), &PhysicsDirectBodyState3D::is_sleeping);
- ClassDB::bind_method(D_METHOD("get_contact_count"), &PhysicsDirectBodyState::get_contact_count);
+ ClassDB::bind_method(D_METHOD("get_contact_count"), &PhysicsDirectBodyState3D::get_contact_count);
- ClassDB::bind_method(D_METHOD("get_contact_local_position", "contact_idx"), &PhysicsDirectBodyState::get_contact_local_position);
- ClassDB::bind_method(D_METHOD("get_contact_local_normal", "contact_idx"), &PhysicsDirectBodyState::get_contact_local_normal);
- ClassDB::bind_method(D_METHOD("get_contact_impulse", "contact_idx"), &PhysicsDirectBodyState::get_contact_impulse);
- ClassDB::bind_method(D_METHOD("get_contact_local_shape", "contact_idx"), &PhysicsDirectBodyState::get_contact_local_shape);
- ClassDB::bind_method(D_METHOD("get_contact_collider", "contact_idx"), &PhysicsDirectBodyState::get_contact_collider);
- ClassDB::bind_method(D_METHOD("get_contact_collider_position", "contact_idx"), &PhysicsDirectBodyState::get_contact_collider_position);
- ClassDB::bind_method(D_METHOD("get_contact_collider_id", "contact_idx"), &PhysicsDirectBodyState::get_contact_collider_id);
- ClassDB::bind_method(D_METHOD("get_contact_collider_object", "contact_idx"), &PhysicsDirectBodyState::get_contact_collider_object);
- ClassDB::bind_method(D_METHOD("get_contact_collider_shape", "contact_idx"), &PhysicsDirectBodyState::get_contact_collider_shape);
- ClassDB::bind_method(D_METHOD("get_contact_collider_velocity_at_position", "contact_idx"), &PhysicsDirectBodyState::get_contact_collider_velocity_at_position);
- ClassDB::bind_method(D_METHOD("get_step"), &PhysicsDirectBodyState::get_step);
- ClassDB::bind_method(D_METHOD("integrate_forces"), &PhysicsDirectBodyState::integrate_forces);
- ClassDB::bind_method(D_METHOD("get_space_state"), &PhysicsDirectBodyState::get_space_state);
+ ClassDB::bind_method(D_METHOD("get_contact_local_position", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_local_position);
+ ClassDB::bind_method(D_METHOD("get_contact_local_normal", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_local_normal);
+ ClassDB::bind_method(D_METHOD("get_contact_impulse", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_impulse);
+ ClassDB::bind_method(D_METHOD("get_contact_local_shape", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_local_shape);
+ ClassDB::bind_method(D_METHOD("get_contact_collider", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_collider);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_position", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_collider_position);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_id", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_collider_id);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_object", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_collider_object);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_shape", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_collider_shape);
+ ClassDB::bind_method(D_METHOD("get_contact_collider_velocity_at_position", "contact_idx"), &PhysicsDirectBodyState3D::get_contact_collider_velocity_at_position);
+ ClassDB::bind_method(D_METHOD("get_step"), &PhysicsDirectBodyState3D::get_step);
+ ClassDB::bind_method(D_METHOD("integrate_forces"), &PhysicsDirectBodyState3D::integrate_forces);
+ ClassDB::bind_method(D_METHOD("get_space_state"), &PhysicsDirectBodyState3D::get_space_state);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "", "get_step");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inverse_mass"), "", "get_inverse_mass");
@@ -134,62 +134,62 @@ void PhysicsDirectBodyState::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform"), "set_transform", "get_transform");
}
-PhysicsDirectBodyState::PhysicsDirectBodyState() {}
+PhysicsDirectBodyState3D::PhysicsDirectBodyState3D() {}
///////////////////////////////////////////////////////
-void PhysicsShapeQueryParameters::set_shape(const RES &p_shape) {
+void PhysicsShapeQueryParameters3D::set_shape(const RES &p_shape) {
ERR_FAIL_COND(p_shape.is_null());
shape = p_shape->get_rid();
}
-void PhysicsShapeQueryParameters::set_shape_rid(const RID &p_shape) {
+void PhysicsShapeQueryParameters3D::set_shape_rid(const RID &p_shape) {
shape = p_shape;
}
-RID PhysicsShapeQueryParameters::get_shape_rid() const {
+RID PhysicsShapeQueryParameters3D::get_shape_rid() const {
return shape;
}
-void PhysicsShapeQueryParameters::set_transform(const Transform &p_transform) {
+void PhysicsShapeQueryParameters3D::set_transform(const Transform &p_transform) {
transform = p_transform;
}
-Transform PhysicsShapeQueryParameters::get_transform() const {
+Transform PhysicsShapeQueryParameters3D::get_transform() const {
return transform;
}
-void PhysicsShapeQueryParameters::set_margin(float p_margin) {
+void PhysicsShapeQueryParameters3D::set_margin(float p_margin) {
margin = p_margin;
}
-float PhysicsShapeQueryParameters::get_margin() const {
+float PhysicsShapeQueryParameters3D::get_margin() const {
return margin;
}
-void PhysicsShapeQueryParameters::set_collision_mask(int p_collision_mask) {
+void PhysicsShapeQueryParameters3D::set_collision_mask(int p_collision_mask) {
collision_mask = p_collision_mask;
}
-int PhysicsShapeQueryParameters::get_collision_mask() const {
+int PhysicsShapeQueryParameters3D::get_collision_mask() const {
return collision_mask;
}
-void PhysicsShapeQueryParameters::set_exclude(const Vector<RID> &p_exclude) {
+void PhysicsShapeQueryParameters3D::set_exclude(const Vector<RID> &p_exclude) {
exclude.clear();
for (int i = 0; i < p_exclude.size(); i++)
exclude.insert(p_exclude[i]);
}
-Vector<RID> PhysicsShapeQueryParameters::get_exclude() const {
+Vector<RID> PhysicsShapeQueryParameters3D::get_exclude() const {
Vector<RID> ret;
ret.resize(exclude.size());
@@ -200,45 +200,45 @@ Vector<RID> PhysicsShapeQueryParameters::get_exclude() const {
return ret;
}
-void PhysicsShapeQueryParameters::set_collide_with_bodies(bool p_enable) {
+void PhysicsShapeQueryParameters3D::set_collide_with_bodies(bool p_enable) {
collide_with_bodies = p_enable;
}
-bool PhysicsShapeQueryParameters::is_collide_with_bodies_enabled() const {
+bool PhysicsShapeQueryParameters3D::is_collide_with_bodies_enabled() const {
return collide_with_bodies;
}
-void PhysicsShapeQueryParameters::set_collide_with_areas(bool p_enable) {
+void PhysicsShapeQueryParameters3D::set_collide_with_areas(bool p_enable) {
collide_with_areas = p_enable;
}
-bool PhysicsShapeQueryParameters::is_collide_with_areas_enabled() const {
+bool PhysicsShapeQueryParameters3D::is_collide_with_areas_enabled() const {
return collide_with_areas;
}
-void PhysicsShapeQueryParameters::_bind_methods() {
+void PhysicsShapeQueryParameters3D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_shape", "shape"), &PhysicsShapeQueryParameters::set_shape);
- ClassDB::bind_method(D_METHOD("set_shape_rid", "shape"), &PhysicsShapeQueryParameters::set_shape_rid);
- ClassDB::bind_method(D_METHOD("get_shape_rid"), &PhysicsShapeQueryParameters::get_shape_rid);
+ ClassDB::bind_method(D_METHOD("set_shape", "shape"), &PhysicsShapeQueryParameters3D::set_shape);
+ ClassDB::bind_method(D_METHOD("set_shape_rid", "shape"), &PhysicsShapeQueryParameters3D::set_shape_rid);
+ ClassDB::bind_method(D_METHOD("get_shape_rid"), &PhysicsShapeQueryParameters3D::get_shape_rid);
- ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsShapeQueryParameters::set_transform);
- ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsShapeQueryParameters::get_transform);
+ ClassDB::bind_method(D_METHOD("set_transform", "transform"), &PhysicsShapeQueryParameters3D::set_transform);
+ ClassDB::bind_method(D_METHOD("get_transform"), &PhysicsShapeQueryParameters3D::get_transform);
- ClassDB::bind_method(D_METHOD("set_margin", "margin"), &PhysicsShapeQueryParameters::set_margin);
- ClassDB::bind_method(D_METHOD("get_margin"), &PhysicsShapeQueryParameters::get_margin);
+ ClassDB::bind_method(D_METHOD("set_margin", "margin"), &PhysicsShapeQueryParameters3D::set_margin);
+ ClassDB::bind_method(D_METHOD("get_margin"), &PhysicsShapeQueryParameters3D::get_margin);
- ClassDB::bind_method(D_METHOD("set_collision_mask", "collision_mask"), &PhysicsShapeQueryParameters::set_collision_mask);
- ClassDB::bind_method(D_METHOD("get_collision_mask"), &PhysicsShapeQueryParameters::get_collision_mask);
+ ClassDB::bind_method(D_METHOD("set_collision_mask", "collision_mask"), &PhysicsShapeQueryParameters3D::set_collision_mask);
+ ClassDB::bind_method(D_METHOD("get_collision_mask"), &PhysicsShapeQueryParameters3D::get_collision_mask);
- ClassDB::bind_method(D_METHOD("set_exclude", "exclude"), &PhysicsShapeQueryParameters::set_exclude);
- ClassDB::bind_method(D_METHOD("get_exclude"), &PhysicsShapeQueryParameters::get_exclude);
+ ClassDB::bind_method(D_METHOD("set_exclude", "exclude"), &PhysicsShapeQueryParameters3D::set_exclude);
+ ClassDB::bind_method(D_METHOD("get_exclude"), &PhysicsShapeQueryParameters3D::get_exclude);
- ClassDB::bind_method(D_METHOD("set_collide_with_bodies", "enable"), &PhysicsShapeQueryParameters::set_collide_with_bodies);
- ClassDB::bind_method(D_METHOD("is_collide_with_bodies_enabled"), &PhysicsShapeQueryParameters::is_collide_with_bodies_enabled);
+ ClassDB::bind_method(D_METHOD("set_collide_with_bodies", "enable"), &PhysicsShapeQueryParameters3D::set_collide_with_bodies);
+ ClassDB::bind_method(D_METHOD("is_collide_with_bodies_enabled"), &PhysicsShapeQueryParameters3D::is_collide_with_bodies_enabled);
- ClassDB::bind_method(D_METHOD("set_collide_with_areas", "enable"), &PhysicsShapeQueryParameters::set_collide_with_areas);
- ClassDB::bind_method(D_METHOD("is_collide_with_areas_enabled"), &PhysicsShapeQueryParameters::is_collide_with_areas_enabled);
+ ClassDB::bind_method(D_METHOD("set_collide_with_areas", "enable"), &PhysicsShapeQueryParameters3D::set_collide_with_areas);
+ ClassDB::bind_method(D_METHOD("is_collide_with_areas_enabled"), &PhysicsShapeQueryParameters3D::is_collide_with_areas_enabled);
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "exclude", PROPERTY_HINT_NONE, itos(Variant::_RID) + ":"), "set_exclude", "get_exclude");
@@ -250,7 +250,7 @@ void PhysicsShapeQueryParameters::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with_areas"), "set_collide_with_areas", "is_collide_with_areas_enabled");
}
-PhysicsShapeQueryParameters::PhysicsShapeQueryParameters() {
+PhysicsShapeQueryParameters3D::PhysicsShapeQueryParameters3D() {
margin = 0;
collision_mask = 0x7FFFFFFF;
@@ -260,7 +260,7 @@ PhysicsShapeQueryParameters::PhysicsShapeQueryParameters() {
/////////////////////////////////////
-Dictionary PhysicsDirectSpaceState::_intersect_ray(const Vector3 &p_from, const Vector3 &p_to, const Vector<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+Dictionary PhysicsDirectSpaceState3D::_intersect_ray(const Vector3 &p_from, const Vector3 &p_to, const Vector<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
RayResult inters;
Set<RID> exclude;
@@ -283,7 +283,7 @@ Dictionary PhysicsDirectSpaceState::_intersect_ray(const Vector3 &p_from, const
return d;
}
-Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results) {
+Array PhysicsDirectSpaceState3D::_intersect_shape(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, int p_max_results) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
@@ -305,7 +305,7 @@ Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParam
return ret;
}
-Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameters> &p_shape_query, const Vector3 &p_motion) {
+Array PhysicsDirectSpaceState3D::_cast_motion(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, const Vector3 &p_motion) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
@@ -319,7 +319,7 @@ Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameter
ret[1] = closest_unsafe;
return ret;
}
-Array PhysicsDirectSpaceState::_collide_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results) {
+Array PhysicsDirectSpaceState3D::_collide_shape(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, int p_max_results) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
@@ -335,7 +335,7 @@ Array PhysicsDirectSpaceState::_collide_shape(const Ref<PhysicsShapeQueryParamet
r[i] = ret[i];
return r;
}
-Dictionary PhysicsDirectSpaceState::_get_rest_info(const Ref<PhysicsShapeQueryParameters> &p_shape_query) {
+Dictionary PhysicsDirectSpaceState3D::_get_rest_info(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query) {
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Dictionary());
@@ -356,176 +356,176 @@ Dictionary PhysicsDirectSpaceState::_get_rest_info(const Ref<PhysicsShapeQueryPa
return r;
}
-PhysicsDirectSpaceState::PhysicsDirectSpaceState() {
+PhysicsDirectSpaceState3D::PhysicsDirectSpaceState3D() {
}
-void PhysicsDirectSpaceState::_bind_methods() {
+void PhysicsDirectSpaceState3D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("intersect_ray", "from", "to", "exclude", "collision_mask", "collide_with_bodies", "collide_with_areas"), &PhysicsDirectSpaceState::_intersect_ray, DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("intersect_shape", "shape", "max_results"), &PhysicsDirectSpaceState::_intersect_shape, DEFVAL(32));
- ClassDB::bind_method(D_METHOD("cast_motion", "shape", "motion"), &PhysicsDirectSpaceState::_cast_motion);
- ClassDB::bind_method(D_METHOD("collide_shape", "shape", "max_results"), &PhysicsDirectSpaceState::_collide_shape, DEFVAL(32));
- ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &PhysicsDirectSpaceState::_get_rest_info);
+ ClassDB::bind_method(D_METHOD("intersect_ray", "from", "to", "exclude", "collision_mask", "collide_with_bodies", "collide_with_areas"), &PhysicsDirectSpaceState3D::_intersect_ray, DEFVAL(Array()), DEFVAL(0x7FFFFFFF), DEFVAL(true), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("intersect_shape", "shape", "max_results"), &PhysicsDirectSpaceState3D::_intersect_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("cast_motion", "shape", "motion"), &PhysicsDirectSpaceState3D::_cast_motion);
+ ClassDB::bind_method(D_METHOD("collide_shape", "shape", "max_results"), &PhysicsDirectSpaceState3D::_collide_shape, DEFVAL(32));
+ ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &PhysicsDirectSpaceState3D::_get_rest_info);
}
-int PhysicsShapeQueryResult::get_result_count() const {
+int PhysicsShapeQueryResult3D::get_result_count() const {
return result.size();
}
-RID PhysicsShapeQueryResult::get_result_rid(int p_idx) const {
+RID PhysicsShapeQueryResult3D::get_result_rid(int p_idx) const {
return result[p_idx].rid;
}
-ObjectID PhysicsShapeQueryResult::get_result_object_id(int p_idx) const {
+ObjectID PhysicsShapeQueryResult3D::get_result_object_id(int p_idx) const {
return result[p_idx].collider_id;
}
-Object *PhysicsShapeQueryResult::get_result_object(int p_idx) const {
+Object *PhysicsShapeQueryResult3D::get_result_object(int p_idx) const {
return result[p_idx].collider;
}
-int PhysicsShapeQueryResult::get_result_object_shape(int p_idx) const {
+int PhysicsShapeQueryResult3D::get_result_object_shape(int p_idx) const {
return result[p_idx].shape;
}
-PhysicsShapeQueryResult::PhysicsShapeQueryResult() {
+PhysicsShapeQueryResult3D::PhysicsShapeQueryResult3D() {
}
-void PhysicsShapeQueryResult::_bind_methods() {
+void PhysicsShapeQueryResult3D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_result_count"), &PhysicsShapeQueryResult::get_result_count);
- ClassDB::bind_method(D_METHOD("get_result_rid", "idx"), &PhysicsShapeQueryResult::get_result_rid);
- ClassDB::bind_method(D_METHOD("get_result_object_id", "idx"), &PhysicsShapeQueryResult::get_result_object_id);
- ClassDB::bind_method(D_METHOD("get_result_object", "idx"), &PhysicsShapeQueryResult::get_result_object);
- ClassDB::bind_method(D_METHOD("get_result_object_shape", "idx"), &PhysicsShapeQueryResult::get_result_object_shape);
+ ClassDB::bind_method(D_METHOD("get_result_count"), &PhysicsShapeQueryResult3D::get_result_count);
+ ClassDB::bind_method(D_METHOD("get_result_rid", "idx"), &PhysicsShapeQueryResult3D::get_result_rid);
+ ClassDB::bind_method(D_METHOD("get_result_object_id", "idx"), &PhysicsShapeQueryResult3D::get_result_object_id);
+ ClassDB::bind_method(D_METHOD("get_result_object", "idx"), &PhysicsShapeQueryResult3D::get_result_object);
+ ClassDB::bind_method(D_METHOD("get_result_object_shape", "idx"), &PhysicsShapeQueryResult3D::get_result_object_shape);
}
///////////////////////////////////////
-void PhysicsServer::_bind_methods() {
+void PhysicsServer3D::_bind_methods() {
#ifndef _3D_DISABLED
- ClassDB::bind_method(D_METHOD("shape_create", "type"), &PhysicsServer::shape_create);
- ClassDB::bind_method(D_METHOD("shape_set_data", "shape", "data"), &PhysicsServer::shape_set_data);
+ ClassDB::bind_method(D_METHOD("shape_create", "type"), &PhysicsServer3D::shape_create);
+ ClassDB::bind_method(D_METHOD("shape_set_data", "shape", "data"), &PhysicsServer3D::shape_set_data);
- ClassDB::bind_method(D_METHOD("shape_get_type", "shape"), &PhysicsServer::shape_get_type);
- ClassDB::bind_method(D_METHOD("shape_get_data", "shape"), &PhysicsServer::shape_get_data);
+ ClassDB::bind_method(D_METHOD("shape_get_type", "shape"), &PhysicsServer3D::shape_get_type);
+ ClassDB::bind_method(D_METHOD("shape_get_data", "shape"), &PhysicsServer3D::shape_get_data);
- ClassDB::bind_method(D_METHOD("space_create"), &PhysicsServer::space_create);
- ClassDB::bind_method(D_METHOD("space_set_active", "space", "active"), &PhysicsServer::space_set_active);
- ClassDB::bind_method(D_METHOD("space_is_active", "space"), &PhysicsServer::space_is_active);
- ClassDB::bind_method(D_METHOD("space_set_param", "space", "param", "value"), &PhysicsServer::space_set_param);
- ClassDB::bind_method(D_METHOD("space_get_param", "space", "param"), &PhysicsServer::space_get_param);
- ClassDB::bind_method(D_METHOD("space_get_direct_state", "space"), &PhysicsServer::space_get_direct_state);
+ ClassDB::bind_method(D_METHOD("space_create"), &PhysicsServer3D::space_create);
+ ClassDB::bind_method(D_METHOD("space_set_active", "space", "active"), &PhysicsServer3D::space_set_active);
+ ClassDB::bind_method(D_METHOD("space_is_active", "space"), &PhysicsServer3D::space_is_active);
+ ClassDB::bind_method(D_METHOD("space_set_param", "space", "param", "value"), &PhysicsServer3D::space_set_param);
+ ClassDB::bind_method(D_METHOD("space_get_param", "space", "param"), &PhysicsServer3D::space_get_param);
+ ClassDB::bind_method(D_METHOD("space_get_direct_state", "space"), &PhysicsServer3D::space_get_direct_state);
- ClassDB::bind_method(D_METHOD("area_create"), &PhysicsServer::area_create);
- ClassDB::bind_method(D_METHOD("area_set_space", "area", "space"), &PhysicsServer::area_set_space);
- ClassDB::bind_method(D_METHOD("area_get_space", "area"), &PhysicsServer::area_get_space);
+ ClassDB::bind_method(D_METHOD("area_create"), &PhysicsServer3D::area_create);
+ ClassDB::bind_method(D_METHOD("area_set_space", "area", "space"), &PhysicsServer3D::area_set_space);
+ ClassDB::bind_method(D_METHOD("area_get_space", "area"), &PhysicsServer3D::area_get_space);
- ClassDB::bind_method(D_METHOD("area_set_space_override_mode", "area", "mode"), &PhysicsServer::area_set_space_override_mode);
- ClassDB::bind_method(D_METHOD("area_get_space_override_mode", "area"), &PhysicsServer::area_get_space_override_mode);
+ ClassDB::bind_method(D_METHOD("area_set_space_override_mode", "area", "mode"), &PhysicsServer3D::area_set_space_override_mode);
+ ClassDB::bind_method(D_METHOD("area_get_space_override_mode", "area"), &PhysicsServer3D::area_get_space_override_mode);
- ClassDB::bind_method(D_METHOD("area_add_shape", "area", "shape", "transform", "disabled"), &PhysicsServer::area_add_shape, DEFVAL(Transform()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("area_set_shape", "area", "shape_idx", "shape"), &PhysicsServer::area_set_shape);
- ClassDB::bind_method(D_METHOD("area_set_shape_transform", "area", "shape_idx", "transform"), &PhysicsServer::area_set_shape_transform);
- ClassDB::bind_method(D_METHOD("area_set_shape_disabled", "area", "shape_idx", "disabled"), &PhysicsServer::area_set_shape_disabled);
+ ClassDB::bind_method(D_METHOD("area_add_shape", "area", "shape", "transform", "disabled"), &PhysicsServer3D::area_add_shape, DEFVAL(Transform()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("area_set_shape", "area", "shape_idx", "shape"), &PhysicsServer3D::area_set_shape);
+ ClassDB::bind_method(D_METHOD("area_set_shape_transform", "area", "shape_idx", "transform"), &PhysicsServer3D::area_set_shape_transform);
+ ClassDB::bind_method(D_METHOD("area_set_shape_disabled", "area", "shape_idx", "disabled"), &PhysicsServer3D::area_set_shape_disabled);
- ClassDB::bind_method(D_METHOD("area_get_shape_count", "area"), &PhysicsServer::area_get_shape_count);
- ClassDB::bind_method(D_METHOD("area_get_shape", "area", "shape_idx"), &PhysicsServer::area_get_shape);
- ClassDB::bind_method(D_METHOD("area_get_shape_transform", "area", "shape_idx"), &PhysicsServer::area_get_shape_transform);
+ ClassDB::bind_method(D_METHOD("area_get_shape_count", "area"), &PhysicsServer3D::area_get_shape_count);
+ ClassDB::bind_method(D_METHOD("area_get_shape", "area", "shape_idx"), &PhysicsServer3D::area_get_shape);
+ ClassDB::bind_method(D_METHOD("area_get_shape_transform", "area", "shape_idx"), &PhysicsServer3D::area_get_shape_transform);
- ClassDB::bind_method(D_METHOD("area_remove_shape", "area", "shape_idx"), &PhysicsServer::area_remove_shape);
- ClassDB::bind_method(D_METHOD("area_clear_shapes", "area"), &PhysicsServer::area_clear_shapes);
+ ClassDB::bind_method(D_METHOD("area_remove_shape", "area", "shape_idx"), &PhysicsServer3D::area_remove_shape);
+ ClassDB::bind_method(D_METHOD("area_clear_shapes", "area"), &PhysicsServer3D::area_clear_shapes);
- ClassDB::bind_method(D_METHOD("area_set_collision_layer", "area", "layer"), &PhysicsServer::area_set_collision_layer);
- ClassDB::bind_method(D_METHOD("area_set_collision_mask", "area", "mask"), &PhysicsServer::area_set_collision_mask);
+ ClassDB::bind_method(D_METHOD("area_set_collision_layer", "area", "layer"), &PhysicsServer3D::area_set_collision_layer);
+ ClassDB::bind_method(D_METHOD("area_set_collision_mask", "area", "mask"), &PhysicsServer3D::area_set_collision_mask);
- ClassDB::bind_method(D_METHOD("area_set_param", "area", "param", "value"), &PhysicsServer::area_set_param);
- ClassDB::bind_method(D_METHOD("area_set_transform", "area", "transform"), &PhysicsServer::area_set_transform);
+ ClassDB::bind_method(D_METHOD("area_set_param", "area", "param", "value"), &PhysicsServer3D::area_set_param);
+ ClassDB::bind_method(D_METHOD("area_set_transform", "area", "transform"), &PhysicsServer3D::area_set_transform);
- ClassDB::bind_method(D_METHOD("area_get_param", "area", "param"), &PhysicsServer::area_get_param);
- ClassDB::bind_method(D_METHOD("area_get_transform", "area"), &PhysicsServer::area_get_transform);
+ ClassDB::bind_method(D_METHOD("area_get_param", "area", "param"), &PhysicsServer3D::area_get_param);
+ ClassDB::bind_method(D_METHOD("area_get_transform", "area"), &PhysicsServer3D::area_get_transform);
- ClassDB::bind_method(D_METHOD("area_attach_object_instance_id", "area", "id"), &PhysicsServer::area_attach_object_instance_id);
- ClassDB::bind_method(D_METHOD("area_get_object_instance_id", "area"), &PhysicsServer::area_get_object_instance_id);
+ ClassDB::bind_method(D_METHOD("area_attach_object_instance_id", "area", "id"), &PhysicsServer3D::area_attach_object_instance_id);
+ ClassDB::bind_method(D_METHOD("area_get_object_instance_id", "area"), &PhysicsServer3D::area_get_object_instance_id);
- ClassDB::bind_method(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &PhysicsServer::area_set_monitor_callback);
- ClassDB::bind_method(D_METHOD("area_set_area_monitor_callback", "area", "receiver", "method"), &PhysicsServer::area_set_area_monitor_callback);
- ClassDB::bind_method(D_METHOD("area_set_monitorable", "area", "monitorable"), &PhysicsServer::area_set_monitorable);
+ ClassDB::bind_method(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &PhysicsServer3D::area_set_monitor_callback);
+ ClassDB::bind_method(D_METHOD("area_set_area_monitor_callback", "area", "receiver", "method"), &PhysicsServer3D::area_set_area_monitor_callback);
+ ClassDB::bind_method(D_METHOD("area_set_monitorable", "area", "monitorable"), &PhysicsServer3D::area_set_monitorable);
- ClassDB::bind_method(D_METHOD("area_set_ray_pickable", "area", "enable"), &PhysicsServer::area_set_ray_pickable);
- ClassDB::bind_method(D_METHOD("area_is_ray_pickable", "area"), &PhysicsServer::area_is_ray_pickable);
+ ClassDB::bind_method(D_METHOD("area_set_ray_pickable", "area", "enable"), &PhysicsServer3D::area_set_ray_pickable);
+ ClassDB::bind_method(D_METHOD("area_is_ray_pickable", "area"), &PhysicsServer3D::area_is_ray_pickable);
- ClassDB::bind_method(D_METHOD("body_create", "mode", "init_sleeping"), &PhysicsServer::body_create, DEFVAL(BODY_MODE_RIGID), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("body_create", "mode", "init_sleeping"), &PhysicsServer3D::body_create, DEFVAL(BODY_MODE_RIGID), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("body_set_space", "body", "space"), &PhysicsServer::body_set_space);
- ClassDB::bind_method(D_METHOD("body_get_space", "body"), &PhysicsServer::body_get_space);
+ ClassDB::bind_method(D_METHOD("body_set_space", "body", "space"), &PhysicsServer3D::body_set_space);
+ ClassDB::bind_method(D_METHOD("body_get_space", "body"), &PhysicsServer3D::body_get_space);
- ClassDB::bind_method(D_METHOD("body_set_mode", "body", "mode"), &PhysicsServer::body_set_mode);
- ClassDB::bind_method(D_METHOD("body_get_mode", "body"), &PhysicsServer::body_get_mode);
+ ClassDB::bind_method(D_METHOD("body_set_mode", "body", "mode"), &PhysicsServer3D::body_set_mode);
+ ClassDB::bind_method(D_METHOD("body_get_mode", "body"), &PhysicsServer3D::body_get_mode);
- ClassDB::bind_method(D_METHOD("body_set_collision_layer", "body", "layer"), &PhysicsServer::body_set_collision_layer);
- ClassDB::bind_method(D_METHOD("body_get_collision_layer", "body"), &PhysicsServer::body_get_collision_layer);
+ ClassDB::bind_method(D_METHOD("body_set_collision_layer", "body", "layer"), &PhysicsServer3D::body_set_collision_layer);
+ ClassDB::bind_method(D_METHOD("body_get_collision_layer", "body"), &PhysicsServer3D::body_get_collision_layer);
- ClassDB::bind_method(D_METHOD("body_set_collision_mask", "body", "mask"), &PhysicsServer::body_set_collision_mask);
- ClassDB::bind_method(D_METHOD("body_get_collision_mask", "body"), &PhysicsServer::body_get_collision_mask);
+ ClassDB::bind_method(D_METHOD("body_set_collision_mask", "body", "mask"), &PhysicsServer3D::body_set_collision_mask);
+ ClassDB::bind_method(D_METHOD("body_get_collision_mask", "body"), &PhysicsServer3D::body_get_collision_mask);
- ClassDB::bind_method(D_METHOD("body_add_shape", "body", "shape", "transform", "disabled"), &PhysicsServer::body_add_shape, DEFVAL(Transform()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("body_set_shape", "body", "shape_idx", "shape"), &PhysicsServer::body_set_shape);
- ClassDB::bind_method(D_METHOD("body_set_shape_transform", "body", "shape_idx", "transform"), &PhysicsServer::body_set_shape_transform);
- ClassDB::bind_method(D_METHOD("body_set_shape_disabled", "body", "shape_idx", "disabled"), &PhysicsServer::body_set_shape_disabled);
+ ClassDB::bind_method(D_METHOD("body_add_shape", "body", "shape", "transform", "disabled"), &PhysicsServer3D::body_add_shape, DEFVAL(Transform()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("body_set_shape", "body", "shape_idx", "shape"), &PhysicsServer3D::body_set_shape);
+ ClassDB::bind_method(D_METHOD("body_set_shape_transform", "body", "shape_idx", "transform"), &PhysicsServer3D::body_set_shape_transform);
+ ClassDB::bind_method(D_METHOD("body_set_shape_disabled", "body", "shape_idx", "disabled"), &PhysicsServer3D::body_set_shape_disabled);
- ClassDB::bind_method(D_METHOD("body_get_shape_count", "body"), &PhysicsServer::body_get_shape_count);
- ClassDB::bind_method(D_METHOD("body_get_shape", "body", "shape_idx"), &PhysicsServer::body_get_shape);
- ClassDB::bind_method(D_METHOD("body_get_shape_transform", "body", "shape_idx"), &PhysicsServer::body_get_shape_transform);
+ ClassDB::bind_method(D_METHOD("body_get_shape_count", "body"), &PhysicsServer3D::body_get_shape_count);
+ ClassDB::bind_method(D_METHOD("body_get_shape", "body", "shape_idx"), &PhysicsServer3D::body_get_shape);
+ ClassDB::bind_method(D_METHOD("body_get_shape_transform", "body", "shape_idx"), &PhysicsServer3D::body_get_shape_transform);
- ClassDB::bind_method(D_METHOD("body_remove_shape", "body", "shape_idx"), &PhysicsServer::body_remove_shape);
- ClassDB::bind_method(D_METHOD("body_clear_shapes", "body"), &PhysicsServer::body_clear_shapes);
+ ClassDB::bind_method(D_METHOD("body_remove_shape", "body", "shape_idx"), &PhysicsServer3D::body_remove_shape);
+ ClassDB::bind_method(D_METHOD("body_clear_shapes", "body"), &PhysicsServer3D::body_clear_shapes);
- ClassDB::bind_method(D_METHOD("body_attach_object_instance_id", "body", "id"), &PhysicsServer::body_attach_object_instance_id);
- ClassDB::bind_method(D_METHOD("body_get_object_instance_id", "body"), &PhysicsServer::body_get_object_instance_id);
+ ClassDB::bind_method(D_METHOD("body_attach_object_instance_id", "body", "id"), &PhysicsServer3D::body_attach_object_instance_id);
+ ClassDB::bind_method(D_METHOD("body_get_object_instance_id", "body"), &PhysicsServer3D::body_get_object_instance_id);
- ClassDB::bind_method(D_METHOD("body_set_enable_continuous_collision_detection", "body", "enable"), &PhysicsServer::body_set_enable_continuous_collision_detection);
- ClassDB::bind_method(D_METHOD("body_is_continuous_collision_detection_enabled", "body"), &PhysicsServer::body_is_continuous_collision_detection_enabled);
+ ClassDB::bind_method(D_METHOD("body_set_enable_continuous_collision_detection", "body", "enable"), &PhysicsServer3D::body_set_enable_continuous_collision_detection);
+ ClassDB::bind_method(D_METHOD("body_is_continuous_collision_detection_enabled", "body"), &PhysicsServer3D::body_is_continuous_collision_detection_enabled);
- ClassDB::bind_method(D_METHOD("body_set_param", "body", "param", "value"), &PhysicsServer::body_set_param);
- ClassDB::bind_method(D_METHOD("body_get_param", "body", "param"), &PhysicsServer::body_get_param);
+ ClassDB::bind_method(D_METHOD("body_set_param", "body", "param", "value"), &PhysicsServer3D::body_set_param);
+ ClassDB::bind_method(D_METHOD("body_get_param", "body", "param"), &PhysicsServer3D::body_get_param);
- ClassDB::bind_method(D_METHOD("body_set_kinematic_safe_margin", "body", "margin"), &PhysicsServer::body_set_kinematic_safe_margin);
- ClassDB::bind_method(D_METHOD("body_get_kinematic_safe_margin", "body"), &PhysicsServer::body_get_kinematic_safe_margin);
+ ClassDB::bind_method(D_METHOD("body_set_kinematic_safe_margin", "body", "margin"), &PhysicsServer3D::body_set_kinematic_safe_margin);
+ ClassDB::bind_method(D_METHOD("body_get_kinematic_safe_margin", "body"), &PhysicsServer3D::body_get_kinematic_safe_margin);
- ClassDB::bind_method(D_METHOD("body_set_state", "body", "state", "value"), &PhysicsServer::body_set_state);
- ClassDB::bind_method(D_METHOD("body_get_state", "body", "state"), &PhysicsServer::body_get_state);
+ ClassDB::bind_method(D_METHOD("body_set_state", "body", "state", "value"), &PhysicsServer3D::body_set_state);
+ ClassDB::bind_method(D_METHOD("body_get_state", "body", "state"), &PhysicsServer3D::body_get_state);
- ClassDB::bind_method(D_METHOD("body_add_central_force", "body", "force"), &PhysicsServer::body_add_central_force);
- ClassDB::bind_method(D_METHOD("body_add_force", "body", "force", "position"), &PhysicsServer::body_add_force);
- ClassDB::bind_method(D_METHOD("body_add_torque", "body", "torque"), &PhysicsServer::body_add_torque);
+ ClassDB::bind_method(D_METHOD("body_add_central_force", "body", "force"), &PhysicsServer3D::body_add_central_force);
+ ClassDB::bind_method(D_METHOD("body_add_force", "body", "force", "position"), &PhysicsServer3D::body_add_force);
+ ClassDB::bind_method(D_METHOD("body_add_torque", "body", "torque"), &PhysicsServer3D::body_add_torque);
- ClassDB::bind_method(D_METHOD("body_apply_central_impulse", "body", "impulse"), &PhysicsServer::body_apply_central_impulse);
- ClassDB::bind_method(D_METHOD("body_apply_impulse", "body", "position", "impulse"), &PhysicsServer::body_apply_impulse);
- ClassDB::bind_method(D_METHOD("body_apply_torque_impulse", "body", "impulse"), &PhysicsServer::body_apply_torque_impulse);
- ClassDB::bind_method(D_METHOD("body_set_axis_velocity", "body", "axis_velocity"), &PhysicsServer::body_set_axis_velocity);
+ ClassDB::bind_method(D_METHOD("body_apply_central_impulse", "body", "impulse"), &PhysicsServer3D::body_apply_central_impulse);
+ ClassDB::bind_method(D_METHOD("body_apply_impulse", "body", "position", "impulse"), &PhysicsServer3D::body_apply_impulse);
+ ClassDB::bind_method(D_METHOD("body_apply_torque_impulse", "body", "impulse"), &PhysicsServer3D::body_apply_torque_impulse);
+ ClassDB::bind_method(D_METHOD("body_set_axis_velocity", "body", "axis_velocity"), &PhysicsServer3D::body_set_axis_velocity);
- ClassDB::bind_method(D_METHOD("body_set_axis_lock", "body", "axis", "lock"), &PhysicsServer::body_set_axis_lock);
- ClassDB::bind_method(D_METHOD("body_is_axis_locked", "body", "axis"), &PhysicsServer::body_is_axis_locked);
+ ClassDB::bind_method(D_METHOD("body_set_axis_lock", "body", "axis", "lock"), &PhysicsServer3D::body_set_axis_lock);
+ ClassDB::bind_method(D_METHOD("body_is_axis_locked", "body", "axis"), &PhysicsServer3D::body_is_axis_locked);
- ClassDB::bind_method(D_METHOD("body_add_collision_exception", "body", "excepted_body"), &PhysicsServer::body_add_collision_exception);
- ClassDB::bind_method(D_METHOD("body_remove_collision_exception", "body", "excepted_body"), &PhysicsServer::body_remove_collision_exception);
+ ClassDB::bind_method(D_METHOD("body_add_collision_exception", "body", "excepted_body"), &PhysicsServer3D::body_add_collision_exception);
+ ClassDB::bind_method(D_METHOD("body_remove_collision_exception", "body", "excepted_body"), &PhysicsServer3D::body_remove_collision_exception);
- ClassDB::bind_method(D_METHOD("body_set_max_contacts_reported", "body", "amount"), &PhysicsServer::body_set_max_contacts_reported);
- ClassDB::bind_method(D_METHOD("body_get_max_contacts_reported", "body"), &PhysicsServer::body_get_max_contacts_reported);
+ ClassDB::bind_method(D_METHOD("body_set_max_contacts_reported", "body", "amount"), &PhysicsServer3D::body_set_max_contacts_reported);
+ ClassDB::bind_method(D_METHOD("body_get_max_contacts_reported", "body"), &PhysicsServer3D::body_get_max_contacts_reported);
- ClassDB::bind_method(D_METHOD("body_set_omit_force_integration", "body", "enable"), &PhysicsServer::body_set_omit_force_integration);
- ClassDB::bind_method(D_METHOD("body_is_omitting_force_integration", "body"), &PhysicsServer::body_is_omitting_force_integration);
+ ClassDB::bind_method(D_METHOD("body_set_omit_force_integration", "body", "enable"), &PhysicsServer3D::body_set_omit_force_integration);
+ ClassDB::bind_method(D_METHOD("body_is_omitting_force_integration", "body"), &PhysicsServer3D::body_is_omitting_force_integration);
- ClassDB::bind_method(D_METHOD("body_set_force_integration_callback", "body", "receiver", "method", "userdata"), &PhysicsServer::body_set_force_integration_callback, DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("body_set_force_integration_callback", "body", "receiver", "method", "userdata"), &PhysicsServer3D::body_set_force_integration_callback, DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("body_set_ray_pickable", "body", "enable"), &PhysicsServer::body_set_ray_pickable);
- ClassDB::bind_method(D_METHOD("body_is_ray_pickable", "body"), &PhysicsServer::body_is_ray_pickable);
+ ClassDB::bind_method(D_METHOD("body_set_ray_pickable", "body", "enable"), &PhysicsServer3D::body_set_ray_pickable);
+ ClassDB::bind_method(D_METHOD("body_is_ray_pickable", "body"), &PhysicsServer3D::body_is_ray_pickable);
- ClassDB::bind_method(D_METHOD("body_get_direct_state", "body"), &PhysicsServer::body_get_direct_state);
+ ClassDB::bind_method(D_METHOD("body_get_direct_state", "body"), &PhysicsServer3D::body_get_direct_state);
/* JOINT API */
@@ -535,15 +535,15 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(JOINT_CONE_TWIST);
BIND_ENUM_CONSTANT(JOINT_6DOF);
- ClassDB::bind_method(D_METHOD("joint_create_pin", "body_A", "local_A", "body_B", "local_B"), &PhysicsServer::joint_create_pin);
- ClassDB::bind_method(D_METHOD("pin_joint_set_param", "joint", "param", "value"), &PhysicsServer::pin_joint_set_param);
- ClassDB::bind_method(D_METHOD("pin_joint_get_param", "joint", "param"), &PhysicsServer::pin_joint_get_param);
+ ClassDB::bind_method(D_METHOD("joint_create_pin", "body_A", "local_A", "body_B", "local_B"), &PhysicsServer3D::joint_create_pin);
+ ClassDB::bind_method(D_METHOD("pin_joint_set_param", "joint", "param", "value"), &PhysicsServer3D::pin_joint_set_param);
+ ClassDB::bind_method(D_METHOD("pin_joint_get_param", "joint", "param"), &PhysicsServer3D::pin_joint_get_param);
- ClassDB::bind_method(D_METHOD("pin_joint_set_local_a", "joint", "local_A"), &PhysicsServer::pin_joint_set_local_a);
- ClassDB::bind_method(D_METHOD("pin_joint_get_local_a", "joint"), &PhysicsServer::pin_joint_get_local_a);
+ ClassDB::bind_method(D_METHOD("pin_joint_set_local_a", "joint", "local_A"), &PhysicsServer3D::pin_joint_set_local_a);
+ ClassDB::bind_method(D_METHOD("pin_joint_get_local_a", "joint"), &PhysicsServer3D::pin_joint_get_local_a);
- ClassDB::bind_method(D_METHOD("pin_joint_set_local_b", "joint", "local_B"), &PhysicsServer::pin_joint_set_local_b);
- ClassDB::bind_method(D_METHOD("pin_joint_get_local_b", "joint"), &PhysicsServer::pin_joint_get_local_b);
+ ClassDB::bind_method(D_METHOD("pin_joint_set_local_b", "joint", "local_B"), &PhysicsServer3D::pin_joint_set_local_b);
+ ClassDB::bind_method(D_METHOD("pin_joint_get_local_b", "joint"), &PhysicsServer3D::pin_joint_get_local_b);
BIND_ENUM_CONSTANT(PIN_JOINT_BIAS);
BIND_ENUM_CONSTANT(PIN_JOINT_DAMPING);
@@ -561,18 +561,18 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(HINGE_JOINT_FLAG_USE_LIMIT);
BIND_ENUM_CONSTANT(HINGE_JOINT_FLAG_ENABLE_MOTOR);
- ClassDB::bind_method(D_METHOD("joint_create_hinge", "body_A", "hinge_A", "body_B", "hinge_B"), &PhysicsServer::joint_create_hinge);
+ ClassDB::bind_method(D_METHOD("joint_create_hinge", "body_A", "hinge_A", "body_B", "hinge_B"), &PhysicsServer3D::joint_create_hinge);
- ClassDB::bind_method(D_METHOD("hinge_joint_set_param", "joint", "param", "value"), &PhysicsServer::hinge_joint_set_param);
- ClassDB::bind_method(D_METHOD("hinge_joint_get_param", "joint", "param"), &PhysicsServer::hinge_joint_get_param);
+ ClassDB::bind_method(D_METHOD("hinge_joint_set_param", "joint", "param", "value"), &PhysicsServer3D::hinge_joint_set_param);
+ ClassDB::bind_method(D_METHOD("hinge_joint_get_param", "joint", "param"), &PhysicsServer3D::hinge_joint_get_param);
- ClassDB::bind_method(D_METHOD("hinge_joint_set_flag", "joint", "flag", "enabled"), &PhysicsServer::hinge_joint_set_flag);
- ClassDB::bind_method(D_METHOD("hinge_joint_get_flag", "joint", "flag"), &PhysicsServer::hinge_joint_get_flag);
+ ClassDB::bind_method(D_METHOD("hinge_joint_set_flag", "joint", "flag", "enabled"), &PhysicsServer3D::hinge_joint_set_flag);
+ ClassDB::bind_method(D_METHOD("hinge_joint_get_flag", "joint", "flag"), &PhysicsServer3D::hinge_joint_get_flag);
- ClassDB::bind_method(D_METHOD("joint_create_slider", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer::joint_create_slider);
+ ClassDB::bind_method(D_METHOD("joint_create_slider", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer3D::joint_create_slider);
- ClassDB::bind_method(D_METHOD("slider_joint_set_param", "joint", "param", "value"), &PhysicsServer::slider_joint_set_param);
- ClassDB::bind_method(D_METHOD("slider_joint_get_param", "joint", "param"), &PhysicsServer::slider_joint_get_param);
+ ClassDB::bind_method(D_METHOD("slider_joint_set_param", "joint", "param", "value"), &PhysicsServer3D::slider_joint_set_param);
+ ClassDB::bind_method(D_METHOD("slider_joint_get_param", "joint", "param"), &PhysicsServer3D::slider_joint_get_param);
BIND_ENUM_CONSTANT(SLIDER_JOINT_LINEAR_LIMIT_UPPER);
BIND_ENUM_CONSTANT(SLIDER_JOINT_LINEAR_LIMIT_LOWER);
@@ -599,10 +599,10 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING);
BIND_ENUM_CONSTANT(SLIDER_JOINT_MAX);
- ClassDB::bind_method(D_METHOD("joint_create_cone_twist", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer::joint_create_cone_twist);
+ ClassDB::bind_method(D_METHOD("joint_create_cone_twist", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer3D::joint_create_cone_twist);
- ClassDB::bind_method(D_METHOD("cone_twist_joint_set_param", "joint", "param", "value"), &PhysicsServer::cone_twist_joint_set_param);
- ClassDB::bind_method(D_METHOD("cone_twist_joint_get_param", "joint", "param"), &PhysicsServer::cone_twist_joint_get_param);
+ ClassDB::bind_method(D_METHOD("cone_twist_joint_set_param", "joint", "param", "value"), &PhysicsServer3D::cone_twist_joint_set_param);
+ ClassDB::bind_method(D_METHOD("cone_twist_joint_get_param", "joint", "param"), &PhysicsServer3D::cone_twist_joint_get_param);
BIND_ENUM_CONSTANT(CONE_TWIST_JOINT_SWING_SPAN);
BIND_ENUM_CONSTANT(CONE_TWIST_JOINT_TWIST_SPAN);
@@ -632,24 +632,24 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_MOTOR);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR);
- ClassDB::bind_method(D_METHOD("joint_get_type", "joint"), &PhysicsServer::joint_get_type);
+ ClassDB::bind_method(D_METHOD("joint_get_type", "joint"), &PhysicsServer3D::joint_get_type);
- ClassDB::bind_method(D_METHOD("joint_set_solver_priority", "joint", "priority"), &PhysicsServer::joint_set_solver_priority);
- ClassDB::bind_method(D_METHOD("joint_get_solver_priority", "joint"), &PhysicsServer::joint_get_solver_priority);
+ ClassDB::bind_method(D_METHOD("joint_set_solver_priority", "joint", "priority"), &PhysicsServer3D::joint_set_solver_priority);
+ ClassDB::bind_method(D_METHOD("joint_get_solver_priority", "joint"), &PhysicsServer3D::joint_get_solver_priority);
- ClassDB::bind_method(D_METHOD("joint_create_generic_6dof", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer::joint_create_generic_6dof);
+ ClassDB::bind_method(D_METHOD("joint_create_generic_6dof", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer3D::joint_create_generic_6dof);
- ClassDB::bind_method(D_METHOD("generic_6dof_joint_set_param", "joint", "axis", "param", "value"), &PhysicsServer::generic_6dof_joint_set_param);
- ClassDB::bind_method(D_METHOD("generic_6dof_joint_get_param", "joint", "axis", "param"), &PhysicsServer::generic_6dof_joint_get_param);
+ ClassDB::bind_method(D_METHOD("generic_6dof_joint_set_param", "joint", "axis", "param", "value"), &PhysicsServer3D::generic_6dof_joint_set_param);
+ ClassDB::bind_method(D_METHOD("generic_6dof_joint_get_param", "joint", "axis", "param"), &PhysicsServer3D::generic_6dof_joint_get_param);
- ClassDB::bind_method(D_METHOD("generic_6dof_joint_set_flag", "joint", "axis", "flag", "enable"), &PhysicsServer::generic_6dof_joint_set_flag);
- ClassDB::bind_method(D_METHOD("generic_6dof_joint_get_flag", "joint", "axis", "flag"), &PhysicsServer::generic_6dof_joint_get_flag);
+ ClassDB::bind_method(D_METHOD("generic_6dof_joint_set_flag", "joint", "axis", "flag", "enable"), &PhysicsServer3D::generic_6dof_joint_set_flag);
+ ClassDB::bind_method(D_METHOD("generic_6dof_joint_get_flag", "joint", "axis", "flag"), &PhysicsServer3D::generic_6dof_joint_get_flag);
- ClassDB::bind_method(D_METHOD("free_rid", "rid"), &PhysicsServer::free);
+ ClassDB::bind_method(D_METHOD("free_rid", "rid"), &PhysicsServer3D::free);
- ClassDB::bind_method(D_METHOD("set_active", "active"), &PhysicsServer::set_active);
+ ClassDB::bind_method(D_METHOD("set_active", "active"), &PhysicsServer3D::set_active);
- ClassDB::bind_method(D_METHOD("get_process_info", "process_info"), &PhysicsServer::get_process_info);
+ ClassDB::bind_method(D_METHOD("get_process_info", "process_info"), &PhysicsServer3D::get_process_info);
BIND_ENUM_CONSTANT(SHAPE_PLANE);
BIND_ENUM_CONSTANT(SHAPE_RAY);
@@ -723,23 +723,23 @@ void PhysicsServer::_bind_methods() {
#endif
}
-PhysicsServer::PhysicsServer() {
+PhysicsServer3D::PhysicsServer3D() {
ERR_FAIL_COND(singleton != NULL);
singleton = this;
}
-PhysicsServer::~PhysicsServer() {
+PhysicsServer3D::~PhysicsServer3D() {
singleton = NULL;
}
-Vector<PhysicsServerManager::ClassInfo> PhysicsServerManager::physics_servers;
-int PhysicsServerManager::default_server_id = -1;
-int PhysicsServerManager::default_server_priority = -1;
-const String PhysicsServerManager::setting_property_name("physics/3d/physics_engine");
+Vector<PhysicsServer3DManager::ClassInfo> PhysicsServer3DManager::physics_servers;
+int PhysicsServer3DManager::default_server_id = -1;
+int PhysicsServer3DManager::default_server_priority = -1;
+const String PhysicsServer3DManager::setting_property_name("physics/3d/physics_engine");
-void PhysicsServerManager::on_servers_changed() {
+void PhysicsServer3DManager::on_servers_changed() {
String physics_servers2("DEFAULT");
for (int i = get_servers_count() - 1; 0 <= i; --i) {
@@ -748,7 +748,7 @@ void PhysicsServerManager::on_servers_changed() {
ProjectSettings::get_singleton()->set_custom_property_info(setting_property_name, PropertyInfo(Variant::STRING, setting_property_name, PROPERTY_HINT_ENUM, physics_servers2));
}
-void PhysicsServerManager::register_server(const String &p_name, CreatePhysicsServerCallback p_creat_callback) {
+void PhysicsServer3DManager::register_server(const String &p_name, CreatePhysicsServer3DCallback p_creat_callback) {
ERR_FAIL_COND(!p_creat_callback);
ERR_FAIL_COND(find_server_id(p_name) != -1);
@@ -756,7 +756,7 @@ void PhysicsServerManager::register_server(const String &p_name, CreatePhysicsSe
on_servers_changed();
}
-void PhysicsServerManager::set_default_server(const String &p_name, int p_priority) {
+void PhysicsServer3DManager::set_default_server(const String &p_name, int p_priority) {
const int id = find_server_id(p_name);
ERR_FAIL_COND(id == -1); // Not found
@@ -766,7 +766,7 @@ void PhysicsServerManager::set_default_server(const String &p_name, int p_priori
}
}
-int PhysicsServerManager::find_server_id(const String &p_name) {
+int PhysicsServer3DManager::find_server_id(const String &p_name) {
for (int i = physics_servers.size() - 1; 0 <= i; --i) {
if (p_name == physics_servers[i].name) {
@@ -776,21 +776,21 @@ int PhysicsServerManager::find_server_id(const String &p_name) {
return -1;
}
-int PhysicsServerManager::get_servers_count() {
+int PhysicsServer3DManager::get_servers_count() {
return physics_servers.size();
}
-String PhysicsServerManager::get_server_name(int p_id) {
+String PhysicsServer3DManager::get_server_name(int p_id) {
ERR_FAIL_INDEX_V(p_id, get_servers_count(), "");
return physics_servers[p_id].name;
}
-PhysicsServer *PhysicsServerManager::new_default_server() {
+PhysicsServer3D *PhysicsServer3DManager::new_default_server() {
ERR_FAIL_COND_V(default_server_id == -1, NULL);
return physics_servers[default_server_id].create_callback();
}
-PhysicsServer *PhysicsServerManager::new_server(const String &p_name) {
+PhysicsServer3D *PhysicsServer3DManager::new_server(const String &p_name) {
int id = find_server_id(p_name);
if (id == -1) {
return NULL;
diff --git a/servers/physics_server.h b/servers/physics_server_3d.h
index f1388c8758..9bb7bfe3f4 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server_3d.h
@@ -34,11 +34,11 @@
#include "core/object.h"
#include "core/resource.h"
-class PhysicsDirectSpaceState;
+class PhysicsDirectSpaceState3D;
-class PhysicsDirectBodyState : public Object {
+class PhysicsDirectBodyState3D : public Object {
- GDCLASS(PhysicsDirectBodyState, Object);
+ GDCLASS(PhysicsDirectBodyState3D, Object);
protected:
static void _bind_methods();
@@ -90,17 +90,17 @@ public:
virtual real_t get_step() const = 0;
virtual void integrate_forces();
- virtual PhysicsDirectSpaceState *get_space_state() = 0;
+ virtual PhysicsDirectSpaceState3D *get_space_state() = 0;
- PhysicsDirectBodyState();
+ PhysicsDirectBodyState3D();
};
-class PhysicsShapeQueryResult;
+class PhysicsShapeQueryResult3D;
-class PhysicsShapeQueryParameters : public Reference {
+class PhysicsShapeQueryParameters3D : public Reference {
- GDCLASS(PhysicsShapeQueryParameters, Reference);
- friend class PhysicsDirectSpaceState;
+ GDCLASS(PhysicsShapeQueryParameters3D, Reference);
+ friend class PhysicsDirectSpaceState3D;
RID shape;
Transform transform;
@@ -137,19 +137,19 @@ public:
void set_collide_with_areas(bool p_enable);
bool is_collide_with_areas_enabled() const;
- PhysicsShapeQueryParameters();
+ PhysicsShapeQueryParameters3D();
};
-class PhysicsDirectSpaceState : public Object {
+class PhysicsDirectSpaceState3D : public Object {
- GDCLASS(PhysicsDirectSpaceState, Object);
+ GDCLASS(PhysicsDirectSpaceState3D, Object);
private:
Dictionary _intersect_ray(const Vector3 &p_from, const Vector3 &p_to, const Vector<RID> &p_exclude = Vector<RID>(), uint32_t p_collision_mask = 0, bool p_collide_with_bodies = true, bool p_collide_with_areas = false);
- Array _intersect_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results = 32);
- Array _cast_motion(const Ref<PhysicsShapeQueryParameters> &p_shape_query, const Vector3 &p_motion);
- Array _collide_shape(const Ref<PhysicsShapeQueryParameters> &p_shape_query, int p_max_results = 32);
- Dictionary _get_rest_info(const Ref<PhysicsShapeQueryParameters> &p_shape_query);
+ Array _intersect_shape(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, int p_max_results = 32);
+ Array _cast_motion(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, const Vector3 &p_motion);
+ Array _collide_shape(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, int p_max_results = 32);
+ Dictionary _get_rest_info(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query);
protected:
static void _bind_methods();
@@ -197,16 +197,16 @@ public:
virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const = 0;
- PhysicsDirectSpaceState();
+ PhysicsDirectSpaceState3D();
};
-class PhysicsShapeQueryResult : public Reference {
+class PhysicsShapeQueryResult3D : public Reference {
- GDCLASS(PhysicsShapeQueryResult, Reference);
+ GDCLASS(PhysicsShapeQueryResult3D, Reference);
- Vector<PhysicsDirectSpaceState::ShapeResult> result;
+ Vector<PhysicsDirectSpaceState3D::ShapeResult> result;
- friend class PhysicsDirectSpaceState;
+ friend class PhysicsDirectSpaceState3D;
protected:
static void _bind_methods();
@@ -218,20 +218,20 @@ public:
Object *get_result_object(int p_idx) const;
int get_result_object_shape(int p_idx) const;
- PhysicsShapeQueryResult();
+ PhysicsShapeQueryResult3D();
};
-class PhysicsServer : public Object {
+class PhysicsServer3D : public Object {
- GDCLASS(PhysicsServer, Object);
+ GDCLASS(PhysicsServer3D, Object);
- static PhysicsServer *singleton;
+ static PhysicsServer3D *singleton;
protected:
static void _bind_methods();
public:
- static PhysicsServer *get_singleton();
+ static PhysicsServer3D *get_singleton();
enum ShapeType {
SHAPE_PLANE, ///< plane:"plane"
@@ -281,7 +281,7 @@ public:
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const = 0;
// this function only works on physics process, errors and returns null otherwise
- virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space) = 0;
+ virtual PhysicsDirectSpaceState3D *space_get_direct_state(RID p_space) = 0;
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) = 0;
virtual Vector<Vector3> space_get_contacts(RID p_space) const = 0;
@@ -478,7 +478,7 @@ public:
virtual bool body_is_ray_pickable(RID p_body) const = 0;
// this function only works on physics process, errors and returns null otherwise
- virtual PhysicsDirectBodyState *body_get_direct_state(RID p_body) = 0;
+ virtual PhysicsDirectBodyState3D *body_get_direct_state(RID p_body) = 0;
struct MotionResult {
@@ -521,7 +521,7 @@ public:
virtual RID soft_body_create(bool p_init_sleeping = false) = 0;
- virtual void soft_body_update_visual_server(RID p_body, class SoftBodyVisualServerHandler *p_visual_server_handler) = 0;
+ virtual void soft_body_update_rendering_server(RID p_body, class SoftBodyRenderingServerHandler *p_rendering_server_handler) = 0;
virtual void soft_body_set_space(RID p_body, RID p_space) = 0;
virtual RID soft_body_get_space(RID p_body) const = 0;
@@ -772,22 +772,22 @@ public:
virtual int get_process_info(ProcessInfo p_info) = 0;
- PhysicsServer();
- ~PhysicsServer();
+ PhysicsServer3D();
+ ~PhysicsServer3D();
};
-typedef PhysicsServer *(*CreatePhysicsServerCallback)();
+typedef PhysicsServer3D *(*CreatePhysicsServer3DCallback)();
-class PhysicsServerManager {
+class PhysicsServer3DManager {
struct ClassInfo {
String name;
- CreatePhysicsServerCallback create_callback;
+ CreatePhysicsServer3DCallback create_callback;
ClassInfo() :
name(""),
create_callback(NULL) {}
- ClassInfo(String p_name, CreatePhysicsServerCallback p_create_callback) :
+ ClassInfo(String p_name, CreatePhysicsServer3DCallback p_create_callback) :
name(p_name),
create_callback(p_create_callback) {}
@@ -813,32 +813,32 @@ private:
static void on_servers_changed();
public:
- static void register_server(const String &p_name, CreatePhysicsServerCallback p_creat_callback);
+ static void register_server(const String &p_name, CreatePhysicsServer3DCallback p_creat_callback);
static void set_default_server(const String &p_name, int p_priority = 0);
static int find_server_id(const String &p_name);
static int get_servers_count();
static String get_server_name(int p_id);
- static PhysicsServer *new_default_server();
- static PhysicsServer *new_server(const String &p_name);
+ static PhysicsServer3D *new_default_server();
+ static PhysicsServer3D *new_server(const String &p_name);
};
-VARIANT_ENUM_CAST(PhysicsServer::ShapeType);
-VARIANT_ENUM_CAST(PhysicsServer::SpaceParameter);
-VARIANT_ENUM_CAST(PhysicsServer::AreaParameter);
-VARIANT_ENUM_CAST(PhysicsServer::AreaSpaceOverrideMode);
-VARIANT_ENUM_CAST(PhysicsServer::BodyMode);
-VARIANT_ENUM_CAST(PhysicsServer::BodyParameter);
-VARIANT_ENUM_CAST(PhysicsServer::BodyState);
-VARIANT_ENUM_CAST(PhysicsServer::BodyAxis);
-VARIANT_ENUM_CAST(PhysicsServer::PinJointParam);
-VARIANT_ENUM_CAST(PhysicsServer::JointType);
-VARIANT_ENUM_CAST(PhysicsServer::HingeJointParam);
-VARIANT_ENUM_CAST(PhysicsServer::HingeJointFlag);
-VARIANT_ENUM_CAST(PhysicsServer::SliderJointParam);
-VARIANT_ENUM_CAST(PhysicsServer::ConeTwistJointParam);
-VARIANT_ENUM_CAST(PhysicsServer::G6DOFJointAxisParam);
-VARIANT_ENUM_CAST(PhysicsServer::G6DOFJointAxisFlag);
-VARIANT_ENUM_CAST(PhysicsServer::AreaBodyStatus);
-VARIANT_ENUM_CAST(PhysicsServer::ProcessInfo);
+VARIANT_ENUM_CAST(PhysicsServer3D::ShapeType);
+VARIANT_ENUM_CAST(PhysicsServer3D::SpaceParameter);
+VARIANT_ENUM_CAST(PhysicsServer3D::AreaParameter);
+VARIANT_ENUM_CAST(PhysicsServer3D::AreaSpaceOverrideMode);
+VARIANT_ENUM_CAST(PhysicsServer3D::BodyMode);
+VARIANT_ENUM_CAST(PhysicsServer3D::BodyParameter);
+VARIANT_ENUM_CAST(PhysicsServer3D::BodyState);
+VARIANT_ENUM_CAST(PhysicsServer3D::BodyAxis);
+VARIANT_ENUM_CAST(PhysicsServer3D::PinJointParam);
+VARIANT_ENUM_CAST(PhysicsServer3D::JointType);
+VARIANT_ENUM_CAST(PhysicsServer3D::HingeJointParam);
+VARIANT_ENUM_CAST(PhysicsServer3D::HingeJointFlag);
+VARIANT_ENUM_CAST(PhysicsServer3D::SliderJointParam);
+VARIANT_ENUM_CAST(PhysicsServer3D::ConeTwistJointParam);
+VARIANT_ENUM_CAST(PhysicsServer3D::G6DOFJointAxisParam);
+VARIANT_ENUM_CAST(PhysicsServer3D::G6DOFJointAxisFlag);
+VARIANT_ENUM_CAST(PhysicsServer3D::AreaBodyStatus);
+VARIANT_ENUM_CAST(PhysicsServer3D::ProcessInfo);
#endif
diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp
index 574b373c30..fa2a5f23dd 100644
--- a/servers/register_server_types.cpp
+++ b/servers/register_server_types.cpp
@@ -58,30 +58,30 @@
#include "camera/camera_feed.h"
#include "camera_server.h"
#include "display_server.h"
-#include "navigation_2d_server.h"
-#include "navigation_server.h"
-#include "physics/physics_server_sw.h"
-#include "physics_2d/physics_2d_server_sw.h"
-#include "physics_2d/physics_2d_server_wrap_mt.h"
-#include "physics_2d_server.h"
-#include "physics_server.h"
-#include "visual/shader_types.h"
-#include "visual_server.h"
+#include "navigation_server_2d.h"
+#include "navigation_server_3d.h"
+#include "physics_2d/physics_server_2d_sw.h"
+#include "physics_2d/physics_server_2d_wrap_mt.h"
+#include "physics_3d/physics_server_3d_sw.h"
+#include "physics_server_2d.h"
+#include "physics_server_3d.h"
+#include "rendering_server.h"
+#include "servers/rendering/shader_types.h"
ShaderTypes *shader_types = NULL;
-PhysicsServer *_createGodotPhysicsCallback() {
- return memnew(PhysicsServerSW);
+PhysicsServer3D *_createGodotPhysicsCallback() {
+ return memnew(PhysicsServer3DSW);
}
-Physics2DServer *_createGodotPhysics2DCallback() {
- return Physics2DServerWrapMT::init_server<Physics2DServerSW>();
+PhysicsServer2D *_createGodotPhysics2DCallback() {
+ return PhysicsServer2DWrapMT::init_server<PhysicsServer2DSW>();
}
static bool has_server_feature_callback(const String &p_feature) {
- if (VisualServer::get_singleton()) {
- if (VisualServer::get_singleton()->has_os_feature(p_feature)) {
+ if (RenderingServer::get_singleton()) {
+ if (RenderingServer::get_singleton()->has_os_feature(p_feature)) {
return true;
}
}
@@ -98,10 +98,10 @@ void register_server_types() {
OS::get_singleton()->set_has_server_feature_callback(has_server_feature_callback);
ClassDB::register_virtual_class<DisplayServer>();
- ClassDB::register_virtual_class<VisualServer>();
+ ClassDB::register_virtual_class<RenderingServer>();
ClassDB::register_class<AudioServer>();
- ClassDB::register_virtual_class<PhysicsServer>();
- ClassDB::register_virtual_class<Physics2DServer>();
+ ClassDB::register_virtual_class<PhysicsServer3D>();
+ ClassDB::register_virtual_class<PhysicsServer2D>();
ClassDB::register_class<ARVRServer>();
ClassDB::register_class<CameraServer>();
@@ -159,30 +159,30 @@ void register_server_types() {
ClassDB::register_class<CameraFeed>();
- ClassDB::register_virtual_class<Physics2DDirectBodyState>();
- ClassDB::register_virtual_class<Physics2DDirectSpaceState>();
- ClassDB::register_virtual_class<Physics2DShapeQueryResult>();
+ ClassDB::register_virtual_class<PhysicsDirectBodyState2D>();
+ ClassDB::register_virtual_class<PhysicsDirectSpaceState2D>();
+ ClassDB::register_virtual_class<PhysicsShapeQueryResult2D>();
ClassDB::register_class<Physics2DTestMotionResult>();
- ClassDB::register_class<Physics2DShapeQueryParameters>();
+ ClassDB::register_class<PhysicsShapeQueryParameters2D>();
- ClassDB::register_class<PhysicsShapeQueryParameters>();
- ClassDB::register_virtual_class<PhysicsDirectBodyState>();
- ClassDB::register_virtual_class<PhysicsDirectSpaceState>();
- ClassDB::register_virtual_class<PhysicsShapeQueryResult>();
+ ClassDB::register_class<PhysicsShapeQueryParameters3D>();
+ ClassDB::register_virtual_class<PhysicsDirectBodyState3D>();
+ ClassDB::register_virtual_class<PhysicsDirectSpaceState3D>();
+ ClassDB::register_virtual_class<PhysicsShapeQueryResult3D>();
// Physics 2D
- GLOBAL_DEF(Physics2DServerManager::setting_property_name, "DEFAULT");
- ProjectSettings::get_singleton()->set_custom_property_info(Physics2DServerManager::setting_property_name, PropertyInfo(Variant::STRING, Physics2DServerManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT"));
+ GLOBAL_DEF(PhysicsServer2DManager::setting_property_name, "DEFAULT");
+ ProjectSettings::get_singleton()->set_custom_property_info(PhysicsServer2DManager::setting_property_name, PropertyInfo(Variant::STRING, PhysicsServer2DManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT"));
- Physics2DServerManager::register_server("GodotPhysics", &_createGodotPhysics2DCallback);
- Physics2DServerManager::set_default_server("GodotPhysics");
+ PhysicsServer2DManager::register_server("GodotPhysics", &_createGodotPhysics2DCallback);
+ PhysicsServer2DManager::set_default_server("GodotPhysics");
// Physics 3D
- GLOBAL_DEF(PhysicsServerManager::setting_property_name, "DEFAULT");
- ProjectSettings::get_singleton()->set_custom_property_info(PhysicsServerManager::setting_property_name, PropertyInfo(Variant::STRING, PhysicsServerManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT"));
+ GLOBAL_DEF(PhysicsServer3DManager::setting_property_name, "DEFAULT");
+ ProjectSettings::get_singleton()->set_custom_property_info(PhysicsServer3DManager::setting_property_name, PropertyInfo(Variant::STRING, PhysicsServer3DManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT"));
- PhysicsServerManager::register_server("GodotPhysics", &_createGodotPhysicsCallback);
- PhysicsServerManager::set_default_server("GodotPhysics");
+ PhysicsServer3DManager::register_server("GodotPhysics", &_createGodotPhysicsCallback);
+ PhysicsServer3DManager::set_default_server("GodotPhysics");
}
void unregister_server_types() {
@@ -192,12 +192,12 @@ void unregister_server_types() {
void register_server_singletons() {
- Engine::get_singleton()->add_singleton(Engine::Singleton("VisualServer", VisualServer::get_singleton()));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("RenderingServer", RenderingServer::get_singleton()));
Engine::get_singleton()->add_singleton(Engine::Singleton("AudioServer", AudioServer::get_singleton()));
- Engine::get_singleton()->add_singleton(Engine::Singleton("PhysicsServer", PhysicsServer::get_singleton()));
- Engine::get_singleton()->add_singleton(Engine::Singleton("Physics2DServer", Physics2DServer::get_singleton()));
- Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationServer", NavigationServer::get_singleton_mut()));
- Engine::get_singleton()->add_singleton(Engine::Singleton("Navigation2DServer", Navigation2DServer::get_singleton_mut()));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("PhysicsServer3D", PhysicsServer3D::get_singleton()));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("PhysicsServer2D", PhysicsServer2D::get_singleton()));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationServer", NavigationServer3D::get_singleton_mut()));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationServer2D", NavigationServer2D::get_singleton_mut()));
Engine::get_singleton()->add_singleton(Engine::Singleton("ARVRServer", ARVRServer::get_singleton()));
Engine::get_singleton()->add_singleton(Engine::Singleton("CameraServer", CameraServer::get_singleton()));
}
diff --git a/servers/visual/SCsub b/servers/rendering/SCsub
index fca18bfea0..fca18bfea0 100644
--- a/servers/visual/SCsub
+++ b/servers/rendering/SCsub
diff --git a/servers/visual/rasterizer.cpp b/servers/rendering/rasterizer.cpp
index a3f93a3f8c..a3f93a3f8c 100644
--- a/servers/visual/rasterizer.cpp
+++ b/servers/rendering/rasterizer.cpp
diff --git a/servers/visual/rasterizer.h b/servers/rendering/rasterizer.h
index d5d32c8d47..f63d1077bb 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/rendering/rasterizer.h
@@ -32,7 +32,7 @@
#define RASTERIZER_H
#include "core/math/camera_matrix.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#include "core/pair.h"
#include "core/self_list.h"
@@ -55,35 +55,35 @@ public:
virtual RID sky_create() = 0;
virtual void sky_set_radiance_size(RID p_sky, int p_radiance_size) = 0;
- virtual void sky_set_mode(RID p_sky, VS::SkyMode p_samples) = 0;
+ virtual void sky_set_mode(RID p_sky, RS::SkyMode p_samples) = 0;
virtual void sky_set_material(RID p_sky, RID p_material) = 0;
/* ENVIRONMENT API */
virtual RID environment_create() = 0;
- virtual void environment_set_background(RID p_env, VS::EnvironmentBG p_bg) = 0;
+ virtual void environment_set_background(RID p_env, RS::EnvironmentBG p_bg) = 0;
virtual void environment_set_sky(RID p_env, RID p_sky) = 0;
virtual void environment_set_sky_custom_fov(RID p_env, float p_scale) = 0;
virtual void environment_set_sky_orientation(RID p_env, const Basis &p_orientation) = 0;
virtual void environment_set_bg_color(RID p_env, const Color &p_color) = 0;
virtual void environment_set_bg_energy(RID p_env, float p_energy) = 0;
virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer) = 0;
- virtual void environment_set_ambient_light(RID p_env, const Color &p_color, VS::EnvironmentAmbientSource p_ambient = VS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, VS::EnvironmentReflectionSource p_reflection_source = VS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) = 0;
+ virtual void environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient = RS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, RS::EnvironmentReflectionSource p_reflection_source = RS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) = 0;
// FIXME: Disabled during Vulkan refactoring, should be ported.
#if 0
virtual void environment_set_camera_feed_id(RID p_env, int p_camera_feed_id) = 0;
#endif
- virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) = 0;
+ virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) = 0;
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) = 0;
virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) = 0;
- virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) = 0;
+ virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) = 0;
- virtual void environment_set_ssao_quality(VS::EnvironmentSSAOQuality p_quality, bool p_half_size) = 0;
+ virtual void environment_set_ssao_quality(RS::EnvironmentSSAOQuality p_quality, bool p_half_size) = 0;
- virtual void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) = 0;
+ virtual void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) = 0;
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) = 0;
@@ -92,13 +92,13 @@ public:
virtual void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) = 0;
virtual bool is_environment(RID p_env) const = 0;
- virtual VS::EnvironmentBG environment_get_background(RID p_env) const = 0;
+ virtual RS::EnvironmentBG environment_get_background(RID p_env) const = 0;
virtual int environment_get_canvas_max_layer(RID p_env) const = 0;
virtual RID camera_effects_create() = 0;
- virtual void camera_effects_set_dof_blur_quality(VS::DOFBlurQuality p_quality, bool p_use_jitter) = 0;
- virtual void camera_effects_set_dof_blur_bokeh_shape(VS::DOFBokehShape p_shape) = 0;
+ virtual void camera_effects_set_dof_blur_quality(RS::DOFBlurQuality p_quality, bool p_use_jitter) = 0;
+ virtual void camera_effects_set_dof_blur_bokeh_shape(RS::DOFBokehShape p_shape) = 0;
virtual void camera_effects_set_dof_blur(RID p_camera_effects, bool p_far_enable, float p_far_distance, float p_far_transition, bool p_near_enable, float p_near_distance, float p_near_transition, float p_amount) = 0;
virtual void camera_effects_set_custom_exposure(RID p_camera_effects, bool p_enable, float p_exposure) = 0;
@@ -119,7 +119,7 @@ public:
struct InstanceBase {
- VS::InstanceType base_type;
+ RS::InstanceType base_type;
RID base;
RID skeleton;
@@ -142,7 +142,7 @@ public:
Vector<float> blend_values;
- VS::ShadowCastingSetting cast_shadows;
+ RS::ShadowCastingSetting cast_shadows;
//fit in 32 bits
bool mirror : 8;
@@ -208,8 +208,8 @@ public:
InstanceBase() :
dependency_item(this) {
- base_type = VS::INSTANCE_NONE;
- cast_shadows = VS::SHADOW_CASTING_SETTING_ON;
+ base_type = RS::INSTANCE_NONE;
+ cast_shadows = RS::SHADOW_CASTING_SETTING_ON;
receive_shadows = true;
visible = true;
depth_layer = 0;
@@ -255,10 +255,10 @@ public:
virtual void set_scene_pass(uint64_t p_pass) = 0;
virtual void set_time(double p_time, double p_step) = 0;
- virtual void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) = 0;
+ virtual void set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw) = 0;
virtual RID render_buffers_create() = 0;
- virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, VS::ViewportMSAA p_msaa) = 0;
+ virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa) = 0;
virtual void screen_space_roughness_limiter_set_active(bool p_enable, float p_curve) = 0;
virtual bool screen_space_roughness_limiter_is_active() const = 0;
@@ -277,7 +277,7 @@ public:
/* TEXTURE API */
virtual RID texture_2d_create(const Ref<Image> &p_image) = 0;
- virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, VS::TextureLayeredType p_layered_type) = 0;
+ virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type) = 0;
virtual RID texture_3d_create(const Vector<Ref<Image>> &p_slices) = 0; //all slices, then all the mipmaps, must be coherent
virtual RID texture_proxy_create(RID p_base) = 0; //all slices, then all the mipmaps, must be coherent
@@ -305,11 +305,11 @@ public:
virtual void texture_set_path(RID p_texture, const String &p_path) = 0;
virtual String texture_get_path(RID p_texture) const = 0;
- virtual void texture_set_detect_3d_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) = 0;
- virtual void texture_set_detect_normal_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) = 0;
- virtual void texture_set_detect_roughness_callback(RID p_texture, VS::TextureDetectRoughnessCallback p_callback, void *p_userdata) = 0;
+ virtual void texture_set_detect_3d_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) = 0;
+ virtual void texture_set_detect_normal_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) = 0;
+ virtual void texture_set_detect_roughness_callback(RID p_texture, RS::TextureDetectRoughnessCallback p_callback, void *p_userdata) = 0;
- virtual void texture_debug_usage(List<VS::TextureInfo> *r_info) = 0;
+ virtual void texture_debug_usage(List<RS::TextureInfo> *r_info) = 0;
virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) = 0;
@@ -349,19 +349,19 @@ public:
virtual RID mesh_create() = 0;
/// Returns stride
- virtual void mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_surface) = 0;
+ virtual void mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) = 0;
virtual int mesh_get_blend_shape_count(RID p_mesh) const = 0;
- virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) = 0;
- virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const = 0;
+ virtual void mesh_set_blend_shape_mode(RID p_mesh, RS::BlendShapeMode p_mode) = 0;
+ virtual RS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const = 0;
virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const Vector<uint8_t> &p_data) = 0;
virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) = 0;
virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const = 0;
- virtual VS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const = 0;
+ virtual RS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const = 0;
virtual int mesh_get_surface_count(RID p_mesh) const = 0;
@@ -376,7 +376,7 @@ public:
virtual RID multimesh_create() = 0;
- virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false) = 0;
+ virtual void multimesh_allocate(RID p_multimesh, int p_instances, RS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false) = 0;
virtual int multimesh_get_instance_count(RID p_multimesh) const = 0;
@@ -404,7 +404,7 @@ public:
/* IMMEDIATE API */
virtual RID immediate_create() = 0;
- virtual void immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture = RID()) = 0;
+ virtual void immediate_begin(RID p_immediate, RS::PrimitiveType p_rimitive, RID p_texture = RID()) = 0;
virtual void immediate_vertex(RID p_immediate, const Vector3 &p_vertex) = 0;
virtual void immediate_normal(RID p_immediate, const Vector3 &p_normal) = 0;
virtual void immediate_tangent(RID p_immediate, const Plane &p_tangent) = 0;
@@ -430,14 +430,14 @@ public:
/* Light API */
- virtual RID light_create(VS::LightType p_type) = 0;
+ virtual RID light_create(RS::LightType p_type) = 0;
- RID directional_light_create() { return light_create(VS::LIGHT_DIRECTIONAL); }
- RID omni_light_create() { return light_create(VS::LIGHT_OMNI); }
- RID spot_light_create() { return light_create(VS::LIGHT_SPOT); }
+ RID directional_light_create() { return light_create(RS::LIGHT_DIRECTIONAL); }
+ RID omni_light_create() { return light_create(RS::LIGHT_OMNI); }
+ RID spot_light_create() { return light_create(RS::LIGHT_SPOT); }
virtual void light_set_color(RID p_light, const Color &p_color) = 0;
- virtual void light_set_param(RID p_light, VS::LightParam p_param, float p_value) = 0;
+ virtual void light_set_param(RID p_light, RS::LightParam p_param, float p_value) = 0;
virtual void light_set_shadow(RID p_light, bool p_enabled) = 0;
virtual void light_set_shadow_color(RID p_light, const Color &p_color) = 0;
virtual void light_set_projector(RID p_light, RID p_texture) = 0;
@@ -446,22 +446,22 @@ public:
virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) = 0;
virtual void light_set_use_gi(RID p_light, bool p_enable) = 0;
- virtual void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) = 0;
+ virtual void light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode) = 0;
- virtual void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) = 0;
+ virtual void light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode) = 0;
virtual void light_directional_set_blend_splits(RID p_light, bool p_enable) = 0;
virtual bool light_directional_get_blend_splits(RID p_light) const = 0;
- virtual void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode) = 0;
- virtual VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const = 0;
+ virtual void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) = 0;
+ virtual RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const = 0;
- virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) = 0;
- virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) = 0;
+ virtual RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) = 0;
+ virtual RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) = 0;
virtual bool light_has_shadow(RID p_light) const = 0;
- virtual VS::LightType light_get_type(RID p_light) const = 0;
+ virtual RS::LightType light_get_type(RID p_light) const = 0;
virtual AABB light_get_aabb(RID p_light) const = 0;
- virtual float light_get_param(RID p_light, VS::LightParam p_param) = 0;
+ virtual float light_get_param(RID p_light, RS::LightParam p_param) = 0;
virtual Color light_get_color(RID p_light) = 0;
virtual bool light_get_use_gi(RID p_light) = 0;
virtual uint64_t light_get_version(RID p_light) const = 0;
@@ -470,7 +470,7 @@ public:
virtual RID reflection_probe_create() = 0;
- virtual void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode) = 0;
+ virtual void reflection_probe_set_update_mode(RID p_probe, RS::ReflectionProbeUpdateMode p_mode) = 0;
virtual void reflection_probe_set_resolution(RID p_probe, int p_resolution) = 0;
virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity) = 0;
virtual void reflection_probe_set_interior_ambient(RID p_probe, const Color &p_ambient) = 0;
@@ -485,7 +485,7 @@ public:
virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) = 0;
virtual AABB reflection_probe_get_aabb(RID p_probe) const = 0;
- virtual VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const = 0;
+ virtual RS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const = 0;
virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const = 0;
virtual Vector3 reflection_probe_get_extents(RID p_probe) const = 0;
virtual Vector3 reflection_probe_get_origin_offset(RID p_probe) const = 0;
@@ -591,7 +591,7 @@ public:
virtual bool particles_is_inactive(RID p_particles) const = 0;
- virtual void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) = 0;
+ virtual void particles_set_draw_order(RID p_particles, RS::ParticlesDrawOrder p_order) = 0;
virtual void particles_set_draw_passes(RID p_particles, int p_count) = 0;
virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) = 0;
@@ -628,7 +628,7 @@ public:
virtual void render_target_disable_clear_request(RID p_render_target) = 0;
virtual void render_target_do_clear_request(RID p_render_target) = 0;
- virtual VS::InstanceType get_base_type(RID p_rid) const = 0;
+ virtual RS::InstanceType get_base_type(RID p_rid) const = 0;
virtual bool free(RID p_rid) = 0;
virtual bool has_os_feature(const String &p_feature) const = 0;
@@ -639,9 +639,9 @@ public:
virtual void render_info_begin_capture() = 0;
virtual void render_info_end_capture() = 0;
- virtual int get_captured_render_info(VS::RenderInfo p_info) = 0;
+ virtual int get_captured_render_info(RS::RenderInfo p_info) = 0;
- virtual int get_render_info(VS::RenderInfo p_info) = 0;
+ virtual int get_render_info(RS::RenderInfo p_info) = 0;
virtual String get_video_adapter_name() const = 0;
virtual String get_video_adapter_vendor() const = 0;
@@ -656,12 +656,12 @@ public:
}
#define TIMESTAMP_BEGIN() \
{ \
- if (VSG::storage->capturing_timestamps) VSG::storage->capture_timestamps_begin(); \
+ if (RSG::storage->capturing_timestamps) RSG::storage->capture_timestamps_begin(); \
}
#define RENDER_TIMESTAMP(m_text) \
{ \
- if (VSG::storage->capturing_timestamps) VSG::storage->capture_timestamp(m_text); \
+ if (RSG::storage->capturing_timestamps) RSG::storage->capture_timestamp(m_text); \
}
bool capturing_timestamps = false;
@@ -706,13 +706,13 @@ public:
int layer_max;
int item_mask;
int item_shadow_mask;
- VS::CanvasLightMode mode;
+ RS::CanvasLightMode mode;
RID texture;
Vector2 texture_offset;
RID canvas;
bool use_shadow;
int shadow_buffer_size;
- VS::CanvasLightShadowFilter shadow_filter;
+ RS::CanvasLightShadowFilter shadow_filter;
Color shadow_color;
float shadow_smooth;
@@ -749,14 +749,14 @@ public:
scale = 1.0;
energy = 1.0;
item_shadow_mask = -1;
- mode = VS::CANVAS_LIGHT_MODE_ADD;
+ mode = RS::CANVAS_LIGHT_MODE_ADD;
// texture_cache = NULL;
next_ptr = NULL;
mask_next_ptr = NULL;
filter_next_ptr = NULL;
use_shadow = false;
shadow_buffer_size = 2048;
- shadow_filter = VS::CANVAS_LIGHT_FILTER_NONE;
+ shadow_filter = RS::CANVAS_LIGHT_FILTER_NONE;
shadow_smooth = 0.0;
render_index_cache = -1;
}
@@ -764,7 +764,7 @@ public:
typedef uint64_t TextureBindingID;
- virtual TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VS::CanvasItemTextureFilter p_filter, VS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) = 0;
+ virtual TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, RS::CanvasItemTextureFilter p_filter, RS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) = 0;
virtual void free_texture_binding(TextureBindingID p_binding) = 0;
//easier wrap to avoid mistakes
@@ -775,14 +775,14 @@ public:
TextureBindingID binding_id;
- _FORCE_INLINE_ void create(VS::CanvasItemTextureFilter p_item_filter, VS::CanvasItemTextureRepeat p_item_repeat, RID p_texture, RID p_normalmap, RID p_specular, VS::CanvasItemTextureFilter p_filter, VS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) {
- if (p_filter == VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT) {
+ _FORCE_INLINE_ void create(RS::CanvasItemTextureFilter p_item_filter, RS::CanvasItemTextureRepeat p_item_repeat, RID p_texture, RID p_normalmap, RID p_specular, RS::CanvasItemTextureFilter p_filter, RS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) {
+ if (p_filter == RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT) {
p_filter = p_item_filter;
}
- if (p_repeat == VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) {
+ if (p_repeat == RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) {
p_repeat = p_item_repeat;
}
- if (p_texture != RID() || p_normalmap != RID() || p_specular != RID() || p_filter != VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT || p_repeat != VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT || p_multimesh.is_valid()) {
+ if (p_texture != RID() || p_normalmap != RID() || p_specular != RID() || p_filter != RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT || p_repeat != RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT || p_multimesh.is_valid()) {
ERR_FAIL_COND(binding_id != 0);
binding_id = singleton->request_texture_binding(p_texture, p_normalmap, p_specular, p_filter, p_repeat, p_multimesh);
}
@@ -882,8 +882,8 @@ public:
float margin[4];
bool draw_center;
Color color;
- VS::NinePatchAxisMode axis_x;
- VS::NinePatchAxisMode axis_y;
+ RS::NinePatchAxisMode axis_x;
+ RS::NinePatchAxisMode axis_y;
Color specular_shininess;
TextureBinding texture_binding;
CommandNinePatch() {
@@ -894,7 +894,7 @@ public:
struct CommandPolygon : public Command {
- VS::PrimitiveType primitive;
+ RS::PrimitiveType primitive;
Polygon polygon;
Color specular_shininess;
TextureBinding texture_binding;
@@ -958,7 +958,7 @@ public:
};
struct ViewportRender {
- VisualServer *owner;
+ RenderingServer *owner;
void *udata;
Rect2 rect;
};
@@ -968,7 +968,7 @@ public:
bool visible;
bool behind;
bool update_when_visible;
- //VS::MaterialBlendMode blend_mode;
+ //RS::MaterialBlendMode blend_mode;
int light_mask;
int z_final;
@@ -1241,7 +1241,7 @@ public:
Transform2D xform;
Transform2D xform_cache;
int light_mask;
- VS::CanvasOccluderPolygonCullMode cull_cache;
+ RS::CanvasOccluderPolygonCullMode cull_cache;
LightOccluderInstance *next;
@@ -1249,7 +1249,7 @@ public:
enabled = true;
next = NULL;
light_mask = 1;
- cull_cache = VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
+ cull_cache = RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
}
};
@@ -1260,7 +1260,7 @@ public:
virtual RID occluder_polygon_create() = 0;
virtual void occluder_polygon_set_shape_as_lines(RID p_occluder, const Vector<Vector2> &p_lines) = 0;
- virtual void occluder_polygon_set_cull_mode(RID p_occluder, VS::CanvasOccluderPolygonCullMode p_mode) = 0;
+ virtual void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) = 0;
virtual void draw_window_margins(int *p_margins, RID *p_margin_textures) = 0;
diff --git a/servers/visual/rasterizer_rd/SCsub b/servers/rendering/rasterizer_rd/SCsub
index cc17feeb05..cc17feeb05 100644
--- a/servers/visual/rasterizer_rd/SCsub
+++ b/servers/rendering/rasterizer_rd/SCsub
diff --git a/servers/visual/rasterizer_rd/cubemap_coeffs.h b/servers/rendering/rasterizer_rd/cubemap_coeffs.h
index 1db03ce7c4..1db03ce7c4 100644
--- a/servers/visual/rasterizer_rd/cubemap_coeffs.h
+++ b/servers/rendering/rasterizer_rd/cubemap_coeffs.h
diff --git a/servers/visual/rasterizer_rd/light_cluster_builder.cpp b/servers/rendering/rasterizer_rd/light_cluster_builder.cpp
index 943ef1c7fa..943ef1c7fa 100644
--- a/servers/visual/rasterizer_rd/light_cluster_builder.cpp
+++ b/servers/rendering/rasterizer_rd/light_cluster_builder.cpp
diff --git a/servers/visual/rasterizer_rd/light_cluster_builder.h b/servers/rendering/rasterizer_rd/light_cluster_builder.h
index 83014a7dd0..3411ed07a0 100644
--- a/servers/visual/rasterizer_rd/light_cluster_builder.h
+++ b/servers/rendering/rasterizer_rd/light_cluster_builder.h
@@ -31,7 +31,7 @@
#ifndef LIGHT_CLUSTER_BUILDER_H
#define LIGHT_CLUSTER_BUILDER_H
-#include "servers/visual/rasterizer_rd/rasterizer_storage_rd.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_storage_rd.h"
class LightClusterBuilder {
public:
diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_canvas_rd.cpp
index 38b1e3b3a6..8d52ffd7b9 100644
--- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_canvas_rd.cpp
@@ -104,7 +104,7 @@ void RasterizerCanvasRD::_update_specular_shininess(const Color &p_transform, ui
*r_ss |= uint32_t(CLAMP(p_transform.r * 255.0, 0, 255));
}
-RID RasterizerCanvasRD::_create_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat, RID p_multimesh) {
+RID RasterizerCanvasRD::_create_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat, RID p_multimesh) {
Vector<RD::Uniform> uniform_set;
@@ -168,13 +168,13 @@ RID RasterizerCanvasRD::_create_texture_binding(RID p_texture, RID p_normalmap,
return RD::get_singleton()->uniform_set_create(uniform_set, shader.default_version_rd_shader, 0);
}
-RasterizerCanvas::TextureBindingID RasterizerCanvasRD::request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat, RID p_multimesh) {
+RasterizerCanvas::TextureBindingID RasterizerCanvasRD::request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat, RID p_multimesh) {
- if (p_filter == VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT) {
+ if (p_filter == RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT) {
p_filter = default_samplers.default_filter;
}
- if (p_repeat == VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) {
+ if (p_repeat == RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT) {
p_repeat = default_samplers.default_repeat;
}
@@ -287,7 +287,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32_SFLOAT;
vd.offset = base_offset * sizeof(float);
- vd.location = VS::ARRAY_VERTEX;
+ vd.location = RS::ARRAY_VERTEX;
vd.stride = stride * sizeof(float);
descriptions.write[0] = vd;
@@ -307,7 +307,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32B32A32_SFLOAT;
vd.offset = base_offset * sizeof(float);
- vd.location = VS::ARRAY_COLOR;
+ vd.location = RS::ARRAY_COLOR;
vd.stride = stride * sizeof(float);
descriptions.write[1] = vd;
@@ -335,7 +335,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32B32A32_SFLOAT;
vd.offset = 0;
- vd.location = VS::ARRAY_COLOR;
+ vd.location = RS::ARRAY_COLOR;
vd.stride = 0;
descriptions.write[1] = vd;
@@ -347,7 +347,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32_SFLOAT;
vd.offset = base_offset * sizeof(float);
- vd.location = VS::ARRAY_TEX_UV;
+ vd.location = RS::ARRAY_TEX_UV;
vd.stride = stride * sizeof(float);
descriptions.write[2] = vd;
@@ -363,7 +363,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32_SFLOAT;
vd.offset = 0;
- vd.location = VS::ARRAY_TEX_UV;
+ vd.location = RS::ARRAY_TEX_UV;
vd.stride = 0;
descriptions.write[2] = vd;
@@ -375,7 +375,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32B32A32_UINT;
vd.offset = base_offset * sizeof(float);
- vd.location = VS::ARRAY_BONES;
+ vd.location = RS::ARRAY_BONES;
vd.stride = stride * sizeof(float);
descriptions.write[3] = vd;
@@ -404,7 +404,7 @@ RasterizerCanvas::PolygonID RasterizerCanvasRD::request_polygon(const Vector<int
RD::VertexDescription vd;
vd.format = RD::DATA_FORMAT_R32G32B32A32_UINT;
vd.offset = 0;
- vd.location = VS::ARRAY_BONES;
+ vd.location = RS::ARRAY_BONES;
vd.stride = 0;
descriptions.write[3] = vd;
@@ -558,7 +558,7 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
light_cache[light_count] = light;
light_count++;
- if (light->mode == VS::CANVAS_LIGHT_MODE_MASK) {
+ if (light->mode == RS::CANVAS_LIGHT_MODE_MASK) {
base_flags |= FLAGS_USING_LIGHT_MASK;
}
if (light_count == state.max_lights_per_item) {
@@ -888,13 +888,13 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
ERR_CONTINUE(!pb);
//bind pipeline
{
- static const PipelineVariant variant[VS::PRIMITIVE_MAX] = { PIPELINE_VARIANT_ATTRIBUTE_POINTS, PIPELINE_VARIANT_ATTRIBUTE_LINES, PIPELINE_VARIANT_ATTRIBUTE_LINES_STRIP, PIPELINE_VARIANT_ATTRIBUTE_TRIANGLES, PIPELINE_VARIANT_ATTRIBUTE_TRIANGLE_STRIP };
- ERR_CONTINUE(polygon->primitive < 0 || polygon->primitive >= VS::PRIMITIVE_MAX);
+ static const PipelineVariant variant[RS::PRIMITIVE_MAX] = { PIPELINE_VARIANT_ATTRIBUTE_POINTS, PIPELINE_VARIANT_ATTRIBUTE_LINES, PIPELINE_VARIANT_ATTRIBUTE_LINES_STRIP, PIPELINE_VARIANT_ATTRIBUTE_TRIANGLES, PIPELINE_VARIANT_ATTRIBUTE_TRIANGLE_STRIP };
+ ERR_CONTINUE(polygon->primitive < 0 || polygon->primitive >= RS::PRIMITIVE_MAX);
RID pipeline = pipeline_variants->variants[light_mode][variant[polygon->primitive]].get_render_pipeline(pb->vertex_format_id, p_framebuffer_format);
RD::get_singleton()->draw_list_bind_render_pipeline(p_draw_list, pipeline);
}
- if (polygon->primitive == VS::PRIMITIVE_LINES) {
+ if (polygon->primitive == RS::PRIMITIVE_LINES) {
//not supported in most hardware, so pointless
//RD::get_singleton()->draw_list_set_line_width(p_draw_list, polygon->line_width);
}
@@ -1024,7 +1024,7 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
// materials are ignored in 2D meshes, could be added but many things (ie, lighting mode, reading from screen, etc) would break as they are not meant be set up at this point of drawing
glBindVertexArray(s->array_id);
- glVertexAttrib4f(VS::ARRAY_COLOR, mesh->modulate.r, mesh->modulate.g, mesh->modulate.b, mesh->modulate.a);
+ glVertexAttrib4f(RS::ARRAY_COLOR, mesh->modulate.r, mesh->modulate.g, mesh->modulate.b, mesh->modulate.a);
if (s->index_array_len) {
glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->array_len >= (1 << 16)) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, 0);
@@ -1054,7 +1054,7 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(mmesh->texture, mmesh->normal_map);
- state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCE_CUSTOM, multi_mesh->custom_data_format != VS::MULTIMESH_CUSTOM_DATA_NONE);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCE_CUSTOM, multi_mesh->custom_data_format != RS::MULTIMESH_CUSTOM_DATA_NONE);
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCING, true);
//reset shader and force rebind
state.using_texture_rect = true;
@@ -1088,7 +1088,7 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
int color_ofs;
- if (multi_mesh->transform_format == VS::MULTIMESH_TRANSFORM_3D) {
+ if (multi_mesh->transform_format == RS::MULTIMESH_TRANSFORM_3D) {
glEnableVertexAttribArray(10);
glVertexAttribPointer(10, 4, GL_FLOAT, GL_FALSE, stride, CAST_INT_TO_UCHAR_PTR(8 * 4));
glVertexAttribDivisor(10, 1);
@@ -1103,18 +1103,18 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
switch (multi_mesh->color_format) {
- case VS::MULTIMESH_COLOR_NONE: {
+ case RS::MULTIMESH_COLOR_NONE: {
glDisableVertexAttribArray(11);
glVertexAttrib4f(11, 1, 1, 1, 1);
} break;
- case VS::MULTIMESH_COLOR_8BIT: {
+ case RS::MULTIMESH_COLOR_8BIT: {
glEnableVertexAttribArray(11);
glVertexAttribPointer(11, 4, GL_UNSIGNED_BYTE, GL_TRUE, stride, CAST_INT_TO_UCHAR_PTR(color_ofs));
glVertexAttribDivisor(11, 1);
custom_data_ofs += 4;
} break;
- case VS::MULTIMESH_COLOR_FLOAT: {
+ case RS::MULTIMESH_COLOR_FLOAT: {
glEnableVertexAttribArray(11);
glVertexAttribPointer(11, 4, GL_FLOAT, GL_FALSE, stride, CAST_INT_TO_UCHAR_PTR(color_ofs));
glVertexAttribDivisor(11, 1);
@@ -1124,17 +1124,17 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
switch (multi_mesh->custom_data_format) {
- case VS::MULTIMESH_CUSTOM_DATA_NONE: {
+ case RS::MULTIMESH_CUSTOM_DATA_NONE: {
glDisableVertexAttribArray(12);
glVertexAttrib4f(12, 1, 1, 1, 1);
} break;
- case VS::MULTIMESH_CUSTOM_DATA_8BIT: {
+ case RS::MULTIMESH_CUSTOM_DATA_8BIT: {
glEnableVertexAttribArray(12);
glVertexAttribPointer(12, 4, GL_UNSIGNED_BYTE, GL_TRUE, stride, CAST_INT_TO_UCHAR_PTR(custom_data_ofs));
glVertexAttribDivisor(12, 1);
} break;
- case VS::MULTIMESH_CUSTOM_DATA_FLOAT: {
+ case RS::MULTIMESH_CUSTOM_DATA_FLOAT: {
glEnableVertexAttribArray(12);
glVertexAttribPointer(12, 4, GL_FLOAT, GL_FALSE, stride, CAST_INT_TO_UCHAR_PTR(custom_data_ofs));
glVertexAttribDivisor(12, 1);
@@ -1167,9 +1167,9 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
if (particles->inactive && !particles->emitting)
break;
- glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1); //not used, so keep white
+ glVertexAttrib4f(RS::ARRAY_COLOR, 1, 1, 1, 1); //not used, so keep white
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
storage->particles_request_process(particles_cmd->particles);
//enable instancing
@@ -1208,7 +1208,7 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
int amount = particles->amount;
- if (particles->draw_order != VS::PARTICLES_DRAW_ORDER_LIFETIME) {
+ if (particles->draw_order != RS::PARTICLES_DRAW_ORDER_LIFETIME) {
glEnableVertexAttribArray(8); //xform x
glVertexAttribPointer(8, 4, GL_FLOAT, GL_FALSE, stride, CAST_INT_TO_UCHAR_PTR(sizeof(float) * 4 * 3));
@@ -1712,7 +1712,7 @@ RID RasterizerCanvasRD::occluder_polygon_create() {
OccluderPolygon occluder;
occluder.point_count = 0;
- occluder.cull_mode = VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
+ occluder.cull_mode = RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
return occluder_polygon_owner.make_rid(occluder);
}
@@ -1805,7 +1805,7 @@ void RasterizerCanvasRD::occluder_polygon_set_shape_as_lines(RID p_occluder, con
}
}
}
-void RasterizerCanvasRD::occluder_polygon_set_cull_mode(RID p_occluder, VS::CanvasOccluderPolygonCullMode p_mode) {
+void RasterizerCanvasRD::occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) {
OccluderPolygon *oc = occluder_polygon_owner.getornull(p_occluder);
ERR_FAIL_COND(!oc);
oc->cull_mode = p_mode;
@@ -1849,7 +1849,7 @@ void RasterizerCanvasRD::ShaderData::set_code(const String &p_code) {
RasterizerCanvasRD *canvas_singleton = (RasterizerCanvasRD *)RasterizerCanvas::singleton;
- Error err = canvas_singleton->shader.compiler.compile(VS::SHADER_CANVAS_ITEM, code, &actions, path, gen_code);
+ Error err = canvas_singleton->shader.compiler.compile(RS::SHADER_CANVAS_ITEM, code, &actions, path, gen_code);
ERR_FAIL_COND(err != OK);
@@ -2138,18 +2138,18 @@ void RasterizerCanvasRD::MaterialData::update_parameters(const Map<StringName, V
u.binding = 0;
u.ids.resize(12);
RID *ids_ptr = u.ids.ptrw();
- ids_ptr[0] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[1] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[2] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[3] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[4] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[5] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[6] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[7] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[8] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[9] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[10] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[11] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[0] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[1] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[2] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[3] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[4] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[5] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[6] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[7] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[8] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[9] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[10] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[11] = canvas_singleton->storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
uniforms.push_back(u);
}
@@ -2204,8 +2204,8 @@ RasterizerCanvasRD::RasterizerCanvasRD(RasterizerStorageRD *p_storage) {
{ //create default samplers
- default_samplers.default_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
- default_samplers.default_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
+ default_samplers.default_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
+ default_samplers.default_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
}
{ //shader variants
@@ -2418,7 +2418,7 @@ RasterizerCanvasRD::RasterizerCanvasRD(RasterizerStorageRD *p_storage) {
{ //bindings
bindings.id_generator = 0;
//generate for 0
- bindings.default_empty = request_texture_binding(RID(), RID(), RID(), VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, RID());
+ bindings.default_empty = request_texture_binding(RID(), RID(), RID(), RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, RID());
{ //state allocate
state.canvas_state_buffer = RD::get_singleton()->uniform_buffer_create(sizeof(State::Buffer));
diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.h b/servers/rendering/rasterizer_rd/rasterizer_canvas_rd.h
index 894a00a436..0c151975bc 100644
--- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.h
+++ b/servers/rendering/rasterizer_rd/rasterizer_canvas_rd.h
@@ -31,13 +31,13 @@
#ifndef RASTERIZER_CANVAS_RD_H
#define RASTERIZER_CANVAS_RD_H
-#include "servers/visual/rasterizer.h"
-#include "servers/visual/rasterizer_rd/rasterizer_storage_rd.h"
-#include "servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h"
-#include "servers/visual/rasterizer_rd/shader_compiler_rd.h"
-#include "servers/visual/rasterizer_rd/shaders/canvas.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/canvas_occlusion.glsl.gen.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_storage_rd.h"
+#include "servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h"
+#include "servers/rendering/rasterizer_rd/shader_compiler_rd.h"
+#include "servers/rendering/rasterizer_rd/shaders/canvas.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/canvas_occlusion.glsl.gen.h"
+#include "servers/rendering/rendering_device.h"
class RasterizerCanvasRD : public RasterizerCanvas {
@@ -229,8 +229,8 @@ class RasterizerCanvasRD : public RasterizerCanvas {
RID normalmap;
RID specular;
RID multimesh;
- VS::CanvasItemTextureFilter texture_filter;
- VS::CanvasItemTextureRepeat texture_repeat;
+ RS::CanvasItemTextureFilter texture_filter;
+ RS::CanvasItemTextureRepeat texture_repeat;
bool operator==(const TextureBindingKey &p_key) const {
return texture == p_key.texture && normalmap == p_key.normalmap && specular == p_key.specular && multimesh == p_key.specular && texture_filter == p_key.texture_filter && texture_repeat == p_key.texture_repeat;
}
@@ -269,12 +269,12 @@ class RasterizerCanvasRD : public RasterizerCanvas {
TextureBindingID default_empty;
} bindings;
- RID _create_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat, RID p_multimesh);
+ RID _create_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat, RID p_multimesh);
void _dispose_bindings();
struct {
- VS::CanvasItemTextureFilter default_filter;
- VS::CanvasItemTextureRepeat default_repeat;
+ RS::CanvasItemTextureFilter default_filter;
+ RS::CanvasItemTextureRepeat default_repeat;
} default_samplers;
/******************/
@@ -332,7 +332,7 @@ class RasterizerCanvasRD : public RasterizerCanvas {
struct OccluderPolygon {
- VS::CanvasOccluderPolygonCullMode cull_mode;
+ RS::CanvasOccluderPolygonCullMode cull_mode;
int point_count;
RID vertex_buffer;
RID vertex_array;
@@ -470,7 +470,7 @@ class RasterizerCanvasRD : public RasterizerCanvas {
_FORCE_INLINE_ void _update_specular_shininess(const Color &p_transform, uint32_t *r_ss);
public:
- TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VS::CanvasItemTextureFilter p_filter, VS::CanvasItemTextureRepeat p_repeat, RID p_multimesh);
+ TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, RS::CanvasItemTextureFilter p_filter, RS::CanvasItemTextureRepeat p_repeat, RID p_multimesh);
void free_texture_binding(TextureBindingID p_binding);
PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>());
@@ -483,7 +483,7 @@ public:
RID occluder_polygon_create();
void occluder_polygon_set_shape_as_lines(RID p_occluder, const Vector<Vector2> &p_lines);
- void occluder_polygon_set_cull_mode(RID p_occluder, VS::CanvasOccluderPolygonCullMode p_mode);
+ void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode);
void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, const Transform2D &p_canvas_transform);
diff --git a/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp
index 355ebfa409..cc94815152 100644
--- a/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp
@@ -365,7 +365,7 @@ void RasterizerEffectsRD::luminance_reduction(RID p_source_texture, const Size2i
RD::get_singleton()->compute_list_end();
}
-void RasterizerEffectsRD::bokeh_dof(RID p_base_texture, RID p_depth_texture, const Size2i &p_base_texture_size, RID p_secondary_texture, RID p_halfsize_texture1, RID p_halfsize_texture2, bool p_dof_far, float p_dof_far_begin, float p_dof_far_size, bool p_dof_near, float p_dof_near_begin, float p_dof_near_size, float p_bokeh_size, VisualServer::DOFBokehShape p_bokeh_shape, VS::DOFBlurQuality p_quality, bool p_use_jitter, float p_cam_znear, float p_cam_zfar, bool p_cam_orthogonal) {
+void RasterizerEffectsRD::bokeh_dof(RID p_base_texture, RID p_depth_texture, const Size2i &p_base_texture_size, RID p_secondary_texture, RID p_halfsize_texture1, RID p_halfsize_texture2, bool p_dof_far, float p_dof_far_begin, float p_dof_far_size, bool p_dof_near, float p_dof_near_begin, float p_dof_near_size, float p_bokeh_size, RenderingServer::DOFBokehShape p_bokeh_shape, RS::DOFBlurQuality p_quality, bool p_use_jitter, float p_cam_znear, float p_cam_zfar, bool p_cam_orthogonal) {
bokeh.push_constant.blur_far_active = p_dof_far;
bokeh.push_constant.blur_far_begin = p_dof_far_begin;
@@ -408,16 +408,16 @@ void RasterizerEffectsRD::bokeh_dof(RID p_base_texture, RID p_depth_texture, con
RD::get_singleton()->compute_list_dispatch(compute_list, x_groups, y_groups, 1);
RD::get_singleton()->compute_list_add_barrier(compute_list);
- if (p_bokeh_shape == VS::DOF_BOKEH_BOX || p_bokeh_shape == VS::DOF_BOKEH_HEXAGON) {
+ if (p_bokeh_shape == RS::DOF_BOKEH_BOX || p_bokeh_shape == RS::DOF_BOKEH_HEXAGON) {
//second pass
- RD::get_singleton()->compute_list_bind_compute_pipeline(compute_list, bokeh.pipelines[p_bokeh_shape == VS::DOF_BOKEH_BOX ? BOKEH_GEN_BOKEH_BOX : BOKEH_GEN_BOKEH_HEXAGONAL]);
+ RD::get_singleton()->compute_list_bind_compute_pipeline(compute_list, bokeh.pipelines[p_bokeh_shape == RS::DOF_BOKEH_BOX ? BOKEH_GEN_BOKEH_BOX : BOKEH_GEN_BOKEH_HEXAGONAL]);
static const int quality_samples[4] = { 6, 12, 12, 24 };
bokeh.push_constant.steps = quality_samples[p_quality];
- if (p_quality == VS::DOF_BLUR_QUALITY_VERY_LOW || p_quality == VS::DOF_BLUR_QUALITY_LOW) {
+ if (p_quality == RS::DOF_BLUR_QUALITY_VERY_LOW || p_quality == RS::DOF_BLUR_QUALITY_LOW) {
//box and hexagon are more or less the same, and they can work in either half (very low and low quality) or full (medium and high quality_ sizes)
RD::get_singleton()->compute_list_bind_uniform_set(compute_list, _get_uniform_set_from_image(p_halfsize_texture1), 0);
@@ -444,7 +444,7 @@ void RasterizerEffectsRD::bokeh_dof(RID p_base_texture, RID p_depth_texture, con
//third pass
bokeh.push_constant.second_pass = true;
- if (p_quality == VS::DOF_BLUR_QUALITY_VERY_LOW || p_quality == VS::DOF_BLUR_QUALITY_LOW) {
+ if (p_quality == RS::DOF_BLUR_QUALITY_VERY_LOW || p_quality == RS::DOF_BLUR_QUALITY_LOW) {
RD::get_singleton()->compute_list_bind_uniform_set(compute_list, _get_uniform_set_from_image(p_halfsize_texture2), 0);
RD::get_singleton()->compute_list_bind_uniform_set(compute_list, _get_compute_uniform_set_from_texture(p_halfsize_texture1), 1);
@@ -458,7 +458,7 @@ void RasterizerEffectsRD::bokeh_dof(RID p_base_texture, RID p_depth_texture, con
RD::get_singleton()->compute_list_dispatch(compute_list, x_groups, y_groups, 1);
RD::get_singleton()->compute_list_add_barrier(compute_list);
- if (p_quality == VS::DOF_BLUR_QUALITY_VERY_LOW || p_quality == VS::DOF_BLUR_QUALITY_LOW) {
+ if (p_quality == RS::DOF_BLUR_QUALITY_VERY_LOW || p_quality == RS::DOF_BLUR_QUALITY_LOW) {
//forth pass, upscale for low quality
RD::get_singleton()->compute_list_bind_compute_pipeline(compute_list, bokeh.pipelines[BOKEH_COMPOSITE]);
@@ -528,7 +528,7 @@ void RasterizerEffectsRD::bokeh_dof(RID p_base_texture, RID p_depth_texture, con
RD::get_singleton()->compute_list_end();
}
-void RasterizerEffectsRD::generate_ssao(RID p_depth_buffer, RID p_normal_buffer, const Size2i &p_depth_buffer_size, RID p_depth_mipmaps_texture, const Vector<RID> &depth_mipmaps, RID p_ao1, bool p_half_size, RID p_ao2, RID p_upscale_buffer, float p_intensity, float p_radius, float p_bias, const CameraMatrix &p_projection, VS::EnvironmentSSAOQuality p_quality, VS::EnvironmentSSAOBlur p_blur, float p_edge_sharpness) {
+void RasterizerEffectsRD::generate_ssao(RID p_depth_buffer, RID p_normal_buffer, const Size2i &p_depth_buffer_size, RID p_depth_mipmaps_texture, const Vector<RID> &depth_mipmaps, RID p_ao1, bool p_half_size, RID p_ao2, RID p_upscale_buffer, float p_intensity, float p_radius, float p_bias, const CameraMatrix &p_projection, RS::EnvironmentSSAOQuality p_quality, RS::EnvironmentSSAOBlur p_blur, float p_edge_sharpness) {
//minify first
ssao.minify_push_constant.orthogonal = p_projection.is_orthogonal();
@@ -628,7 +628,7 @@ void RasterizerEffectsRD::generate_ssao(RID p_depth_buffer, RID p_normal_buffer,
ssao.blur_push_constant.axis[0] = 1;
ssao.blur_push_constant.axis[1] = 0;
- if (p_blur != VS::ENV_SSAO_BLUR_DISABLED) {
+ if (p_blur != RS::ENV_SSAO_BLUR_DISABLED) {
RD::get_singleton()->compute_list_bind_compute_pipeline(compute_list, ssao.pipelines[p_half_size ? SSAO_BLUR_PASS_HALF : SSAO_BLUR_PASS]);
RD::get_singleton()->compute_list_bind_uniform_set(compute_list, _get_compute_uniform_set_from_texture(p_ao1), 0);
diff --git a/servers/visual/rasterizer_rd/rasterizer_effects_rd.h b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.h
index 562a7b674b..69da5dc6d4 100644
--- a/servers/visual/rasterizer_rd/rasterizer_effects_rd.h
+++ b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.h
@@ -32,21 +32,21 @@
#define RASTERIZER_EFFECTS_RD_H
#include "core/math/camera_matrix.h"
-#include "servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h"
-#include "servers/visual/rasterizer_rd/shaders/blur.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/bokeh_dof.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/copy.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/cubemap_downsampler.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/cubemap_filter.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/cubemap_roughness.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/luminance_reduce.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/roughness_limiter.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/ssao.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/ssao_blur.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/ssao_minify.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/tonemap.glsl.gen.h"
-
-#include "servers/visual_server.h"
+#include "servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h"
+#include "servers/rendering/rasterizer_rd/shaders/blur.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/bokeh_dof.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/copy.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/cubemap_downsampler.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/cubemap_filter.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/cubemap_roughness.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/luminance_reduce.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/roughness_limiter.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/ssao.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/ssao_blur.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/ssao_minify.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/tonemap.glsl.gen.h"
+
+#include "servers/rendering_server.h"
class RasterizerEffectsRD {
@@ -404,7 +404,7 @@ public:
void make_mipmap(RID p_source_rd_texture, RID p_framebuffer_half, const Vector2 &p_pixel_size);
void copy_cubemap_to_dp(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2 &p_rect, float p_z_near, float p_z_far, float p_bias, bool p_dp_flip);
void luminance_reduction(RID p_source_texture, const Size2i p_source_size, const Vector<RID> p_reduce, RID p_prev_luminance, float p_min_luminance, float p_max_luminance, float p_adjust, bool p_set = false);
- void bokeh_dof(RID p_base_texture, RID p_depth_texture, const Size2i &p_base_texture_size, RID p_secondary_texture, RID p_bokeh_texture1, RID p_bokeh_texture2, bool p_dof_far, float p_dof_far_begin, float p_dof_far_size, bool p_dof_near, float p_dof_near_begin, float p_dof_near_size, float p_bokeh_size, VS::DOFBokehShape p_bokeh_shape, VS::DOFBlurQuality p_quality, bool p_use_jitter, float p_cam_znear, float p_cam_zfar, bool p_cam_orthogonal);
+ void bokeh_dof(RID p_base_texture, RID p_depth_texture, const Size2i &p_base_texture_size, RID p_secondary_texture, RID p_bokeh_texture1, RID p_bokeh_texture2, bool p_dof_far, float p_dof_far_begin, float p_dof_far_size, bool p_dof_near, float p_dof_near_begin, float p_dof_near_size, float p_bokeh_size, RS::DOFBokehShape p_bokeh_shape, RS::DOFBlurQuality p_quality, bool p_use_jitter, float p_cam_znear, float p_cam_zfar, bool p_cam_orthogonal);
struct TonemapSettings {
@@ -424,7 +424,7 @@ public:
bool glow_use_bicubic_upscale = false;
RID glow_texture;
- VS::EnvironmentToneMapper tonemap_mode = VS::ENV_TONE_MAPPER_LINEAR;
+ RS::EnvironmentToneMapper tonemap_mode = RS::ENV_TONE_MAPPER_LINEAR;
float exposure = 1.0;
float white = 1.0;
@@ -443,7 +443,7 @@ public:
void tonemapper(RID p_source_color, RID p_dst_framebuffer, const TonemapSettings &p_settings);
- void generate_ssao(RID p_depth_buffer, RID p_normal_buffer, const Size2i &p_depth_buffer_size, RID p_depth_mipmaps_texture, const Vector<RID> &depth_mipmaps, RID p_ao1, bool p_half_size, RID p_ao2, RID p_upscale_buffer, float p_intensity, float p_radius, float p_bias, const CameraMatrix &p_projection, VS::EnvironmentSSAOQuality p_quality, VS::EnvironmentSSAOBlur p_blur, float p_edge_sharpness);
+ void generate_ssao(RID p_depth_buffer, RID p_normal_buffer, const Size2i &p_depth_buffer_size, RID p_depth_mipmaps_texture, const Vector<RID> &depth_mipmaps, RID p_ao1, bool p_half_size, RID p_ao2, RID p_upscale_buffer, float p_intensity, float p_radius, float p_bias, const CameraMatrix &p_projection, RS::EnvironmentSSAOQuality p_quality, RS::EnvironmentSSAOBlur p_blur, float p_edge_sharpness);
void roughness_limit(RID p_source_normal, RID p_roughness, const Size2i &p_size, float p_curve);
void cubemap_downsample(RID p_source_cubemap, RID p_dest_cubemap, const Size2i &p_size);
diff --git a/servers/visual/rasterizer_rd/rasterizer_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_rd.cpp
index 9c54f0caae..9c54f0caae 100644
--- a/servers/visual/rasterizer_rd/rasterizer_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_rd.cpp
diff --git a/servers/visual/rasterizer_rd/rasterizer_rd.h b/servers/rendering/rasterizer_rd/rasterizer_rd.h
index bbcf9bfefe..756b9499ca 100644
--- a/servers/visual/rasterizer_rd/rasterizer_rd.h
+++ b/servers/rendering/rasterizer_rd/rasterizer_rd.h
@@ -33,10 +33,10 @@
#include "core/os/os.h"
#include "core/thread_work_pool.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual/rasterizer_rd/rasterizer_canvas_rd.h"
-#include "servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.h"
-#include "servers/visual/rasterizer_rd/rasterizer_storage_rd.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_canvas_rd.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_storage_rd.h"
class RasterizerRD : public Rasterizer {
protected:
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.cpp
index 70219a3981..bf3cd045f1 100644
--- a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.cpp
@@ -30,8 +30,8 @@
#include "rasterizer_scene_high_end_rd.h"
#include "core/project_settings.h"
-#include "servers/visual/rendering_device.h"
-#include "servers/visual/visual_server_raster.h"
+#include "servers/rendering/rendering_device.h"
+#include "servers/rendering/rendering_server_raster.h"
static _FORCE_INLINE_ void store_transform(const Transform &p_mtx, float *p_array) {
p_array[0] = p_mtx.basis.elements[0][0];
@@ -163,7 +163,7 @@ void RasterizerSceneHighEndRD::ShaderData::set_code(const String &p_code) {
RasterizerSceneHighEndRD *scene_singleton = (RasterizerSceneHighEndRD *)RasterizerSceneHighEndRD::singleton;
- Error err = scene_singleton->shader.compiler.compile(VS::SHADER_SPATIAL, code, &actions, path, gen_code);
+ Error err = scene_singleton->shader.compiler.compile(RS::SHADER_SPATIAL, code, &actions, path, gen_code);
ERR_FAIL_COND(err != OK);
@@ -273,9 +273,9 @@ void RasterizerSceneHighEndRD::ShaderData::set_code(const String &p_code) {
RD::PolygonCullMode cull_mode_rd = cull_mode_rd_table[i][cull];
- for (int j = 0; j < VS::PRIMITIVE_MAX; j++) {
+ for (int j = 0; j < RS::PRIMITIVE_MAX; j++) {
- RD::RenderPrimitive primitive_rd_table[VS::PRIMITIVE_MAX] = {
+ RD::RenderPrimitive primitive_rd_table[RS::PRIMITIVE_MAX] = {
RD::RENDER_PRIMITIVE_POINTS,
RD::RENDER_PRIMITIVE_LINES,
RD::RENDER_PRIMITIVE_LINESTRIPS,
@@ -413,7 +413,7 @@ RasterizerStorageRD::ShaderData *RasterizerSceneHighEndRD::_create_shader_func()
}
void RasterizerSceneHighEndRD::MaterialData::set_render_priority(int p_priority) {
- priority = p_priority - VS::MATERIAL_RENDER_PRIORITY_MIN; //8 bits
+ priority = p_priority - RS::MATERIAL_RENDER_PRIORITY_MIN; //8 bits
}
void RasterizerSceneHighEndRD::MaterialData::set_next_pass(RID p_pass) {
@@ -569,7 +569,7 @@ void RasterizerSceneHighEndRD::RenderBufferDataHighEnd::clear() {
}
}
-void RasterizerSceneHighEndRD::RenderBufferDataHighEnd::configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, VS::ViewportMSAA p_msaa) {
+void RasterizerSceneHighEndRD::RenderBufferDataHighEnd::configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa) {
clear();
width = p_width;
@@ -659,10 +659,10 @@ void RasterizerSceneHighEndRD::_fill_instances(RenderList::Element **p_elements,
id.flags = 0;
id.mask = e->instance->layer_mask;
- if (e->instance->base_type == VS::INSTANCE_MULTIMESH) {
+ if (e->instance->base_type == RS::INSTANCE_MULTIMESH) {
id.flags |= INSTANCE_DATA_FLAG_MULTIMESH;
uint32_t stride;
- if (storage->multimesh_get_transform_format(e->instance->base) == VS::MULTIMESH_TRANSFORM_2D) {
+ if (storage->multimesh_get_transform_format(e->instance->base) == RS::MULTIMESH_TRANSFORM_2D) {
id.flags |= INSTANCE_DATA_FLAG_MULTIMESH_FORMAT_2D;
stride = 2;
} else {
@@ -678,7 +678,7 @@ void RasterizerSceneHighEndRD::_fill_instances(RenderList::Element **p_elements,
}
id.flags |= (stride << INSTANCE_DATA_FLAGS_MULTIMESH_STRIDE_SHIFT);
- } else if (e->instance->base_type == VS::INSTANCE_MESH) {
+ } else if (e->instance->base_type == RS::INSTANCE_MESH) {
if (e->instance->skeleton.is_valid()) {
id.flags |= INSTANCE_DATA_FLAG_SKELETON;
}
@@ -769,7 +769,7 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
//find cull variant
ShaderData::CullVariant cull_variant;
- if ((p_pass_mode == PASS_MODE_SHADOW || p_pass_mode == PASS_MODE_SHADOW_DP) && e->instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
+ if ((p_pass_mode == PASS_MODE_SHADOW || p_pass_mode == PASS_MODE_SHADOW_DP) && e->instance->cast_shadows == RS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
cull_variant = ShaderData::CULL_VARIANT_DOUBLE_SIDED;
} else {
bool mirror = e->instance->mirror;
@@ -780,16 +780,16 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
}
//find primitive and vertex format
- VS::PrimitiveType primitive;
+ RS::PrimitiveType primitive;
switch (e->instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
primitive = storage->mesh_surface_get_primitive(e->instance->base, e->surface_index);
if (e->instance->skeleton.is_valid()) {
xforms_uniform_set = storage->skeleton_get_3d_uniform_set(e->instance->skeleton, default_shader_rd, TRANSFORMS_UNIFORM_SET);
}
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
RID mesh = storage->multimesh_get_mesh(e->instance->base);
ERR_CONTINUE(!mesh.is_valid()); //should be a bug
primitive = storage->mesh_surface_get_primitive(mesh, e->surface_index);
@@ -797,10 +797,10 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
xforms_uniform_set = storage->multimesh_get_3d_uniform_set(e->instance->base, default_shader_rd, TRANSFORMS_UNIFORM_SET);
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
ERR_CONTINUE(true); //should be a bug
} break;
- case VS::INSTANCE_PARTICLES: {
+ case RS::INSTANCE_PARTICLES: {
ERR_CONTINUE(true); //should be a bug
} break;
default: {
@@ -857,18 +857,18 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
RID index_array_rd;
switch (e->instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
storage->mesh_surface_get_arrays_and_format(e->instance->base, e->surface_index, pipeline->get_vertex_input_mask(), vertex_array_rd, index_array_rd, vertex_format);
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
RID mesh = storage->multimesh_get_mesh(e->instance->base);
ERR_CONTINUE(!mesh.is_valid()); //should be a bug
storage->mesh_surface_get_arrays_and_format(mesh, e->surface_index, pipeline->get_vertex_input_mask(), vertex_array_rd, index_array_rd, vertex_format);
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
ERR_CONTINUE(true); //should be a bug
} break;
- case VS::INSTANCE_PARTICLES: {
+ case RS::INSTANCE_PARTICLES: {
ERR_CONTINUE(true); //should be a bug
} break;
default: {
@@ -915,17 +915,17 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
RD::get_singleton()->draw_list_set_push_constant(draw_list, &push_constant, sizeof(PushConstant));
switch (e->instance->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
RD::get_singleton()->draw_list_draw(draw_list, index_array_rd.is_valid());
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
uint32_t instances = storage->multimesh_get_instances_to_draw(e->instance->base);
RD::get_singleton()->draw_list_draw(draw_list, index_array_rd.is_valid(), instances);
} break;
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
} break;
- case VS::INSTANCE_PARTICLES: {
+ case RS::INSTANCE_PARTICLES: {
} break;
default: {
@@ -968,7 +968,7 @@ void RasterizerSceneHighEndRD::_setup_environment(RID p_environment, const Camer
//time global variables
scene_state.ubo.time = time;
- if (get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
+ if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
scene_state.ubo.use_ambient_light = true;
scene_state.ubo.ambient_light_color_energy[0] = 1;
@@ -981,8 +981,8 @@ void RasterizerSceneHighEndRD::_setup_environment(RID p_environment, const Camer
} else if (is_environment(p_environment)) {
- VS::EnvironmentBG env_bg = environment_get_background(p_environment);
- VS::EnvironmentAmbientSource ambient_src = environment_get_ambient_light_ambient_source(p_environment);
+ RS::EnvironmentBG env_bg = environment_get_background(p_environment);
+ RS::EnvironmentAmbientSource ambient_src = environment_get_ambient_light_ambient_source(p_environment);
float bg_energy = environment_get_bg_energy(p_environment);
scene_state.ubo.ambient_light_color_energy[3] = bg_energy;
@@ -990,9 +990,9 @@ void RasterizerSceneHighEndRD::_setup_environment(RID p_environment, const Camer
scene_state.ubo.ambient_color_sky_mix = environment_get_ambient_sky_contribution(p_environment);
//ambient
- if (ambient_src == VS::ENV_AMBIENT_SOURCE_BG && (env_bg == VS::ENV_BG_CLEAR_COLOR || env_bg == VS::ENV_BG_COLOR)) {
+ if (ambient_src == RS::ENV_AMBIENT_SOURCE_BG && (env_bg == RS::ENV_BG_CLEAR_COLOR || env_bg == RS::ENV_BG_COLOR)) {
- Color color = env_bg == VS::ENV_BG_CLEAR_COLOR ? p_default_bg_color : environment_get_bg_color(p_environment);
+ Color color = env_bg == RS::ENV_BG_CLEAR_COLOR ? p_default_bg_color : environment_get_bg_color(p_environment);
color = color.to_linear();
scene_state.ubo.ambient_light_color_energy[0] = color.r * bg_energy;
@@ -1013,13 +1013,13 @@ void RasterizerSceneHighEndRD::_setup_environment(RID p_environment, const Camer
sky_transform = sky_transform.inverse() * p_cam_transform.basis;
store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform);
- scene_state.ubo.use_ambient_cubemap = (ambient_src == VS::ENV_AMBIENT_SOURCE_BG && env_bg == VS::ENV_BG_SKY) || ambient_src == VS::ENV_AMBIENT_SOURCE_SKY;
- scene_state.ubo.use_ambient_light = scene_state.ubo.use_ambient_cubemap || ambient_src == VS::ENV_AMBIENT_SOURCE_COLOR;
+ scene_state.ubo.use_ambient_cubemap = (ambient_src == RS::ENV_AMBIENT_SOURCE_BG && env_bg == RS::ENV_BG_SKY) || ambient_src == RS::ENV_AMBIENT_SOURCE_SKY;
+ scene_state.ubo.use_ambient_light = scene_state.ubo.use_ambient_cubemap || ambient_src == RS::ENV_AMBIENT_SOURCE_COLOR;
}
//specular
- VS::EnvironmentReflectionSource ref_src = environment_get_reflection_source(p_environment);
- if ((ref_src == VS::ENV_REFLECTION_SOURCE_BG && env_bg == VS::ENV_BG_SKY) || ref_src == VS::ENV_REFLECTION_SOURCE_SKY) {
+ RS::EnvironmentReflectionSource ref_src = environment_get_reflection_source(p_environment);
+ if ((ref_src == RS::ENV_REFLECTION_SOURCE_BG && env_bg == RS::ENV_BG_SKY) || ref_src == RS::ENV_REFLECTION_SOURCE_SKY) {
scene_state.ubo.use_reflection_cubemap = true;
} else {
scene_state.ubo.use_reflection_cubemap = false;
@@ -1064,12 +1064,12 @@ void RasterizerSceneHighEndRD::_add_geometry(InstanceBase *p_instance, uint32_t
m_src = p_instance->material_override.is_valid() ? p_instance->material_override : p_material;
- if (unlikely(get_debug_draw_mode() != VS::VIEWPORT_DEBUG_DRAW_DISABLED)) {
- if (get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) {
+ if (unlikely(get_debug_draw_mode() != RS::VIEWPORT_DEBUG_DRAW_DISABLED)) {
+ if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_OVERDRAW) {
m_src = overdraw_material;
- } else if (get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_WIREFRAME) {
+ } else if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME) {
m_src = wireframe_material;
- } else if (get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_LIGHTING) {
+ } else if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_LIGHTING) {
m_src = default_material;
}
}
@@ -1126,7 +1126,7 @@ void RasterizerSceneHighEndRD::_add_geometry_with_material(InstanceBase *p_insta
if (p_pass_mode != PASS_MODE_COLOR && p_pass_mode != PASS_MODE_COLOR_SPECULAR) {
- if (has_blend_alpha || has_read_screen_alpha || (has_base_alpha && !p_material->shader_data->uses_depth_pre_pass) || p_material->shader_data->depth_draw == ShaderData::DEPTH_DRAW_DISABLED || p_material->shader_data->depth_test == ShaderData::DEPTH_TEST_DISABLED || p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_OFF) {
+ if (has_blend_alpha || has_read_screen_alpha || (has_base_alpha && !p_material->shader_data->uses_depth_pre_pass) || p_material->shader_data->depth_draw == ShaderData::DEPTH_DRAW_DISABLED || p_material->shader_data->depth_test == ShaderData::DEPTH_TEST_DISABLED || p_instance->cast_shadows == RS::SHADOW_CASTING_SETTING_OFF) {
//conditions in which no depth pass should be processed
return;
}
@@ -1169,7 +1169,7 @@ void RasterizerSceneHighEndRD::_add_geometry_with_material(InstanceBase *p_insta
}
e->geometry_index = p_geometry_index;
e->material_index = e->material->index;
- e->uses_instancing = e->instance->base_type == VS::INSTANCE_MULTIMESH;
+ e->uses_instancing = e->instance->base_type == RS::INSTANCE_MULTIMESH;
e->uses_lightmap = e->instance->lightmap.is_valid();
e->uses_vct = e->instance->gi_probe_instances.size();
e->shader_index = e->shader_index;
@@ -1177,7 +1177,7 @@ void RasterizerSceneHighEndRD::_add_geometry_with_material(InstanceBase *p_insta
e->priority = p_material->priority;
if (p_material->shader_data->uses_time) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
}
@@ -1201,7 +1201,7 @@ void RasterizerSceneHighEndRD::_fill_render_list(InstanceBase **p_cull_result, i
//add geometry for drawing
switch (inst->base_type) {
- case VS::INSTANCE_MESH: {
+ case RS::INSTANCE_MESH: {
const RID *materials = NULL;
uint32_t surface_count;
@@ -1225,7 +1225,7 @@ void RasterizerSceneHighEndRD::_fill_render_list(InstanceBase **p_cull_result, i
} break;
- case VS::INSTANCE_MULTIMESH: {
+ case RS::INSTANCE_MULTIMESH: {
if (storage->multimesh_get_instances_to_draw(inst->base) == 0) {
//not visible, 0 instances
@@ -1253,7 +1253,7 @@ void RasterizerSceneHighEndRD::_fill_render_list(InstanceBase **p_cull_result, i
} break;
#if 0
- case VS::INSTANCE_IMMEDIATE: {
+ case RS::INSTANCE_IMMEDIATE: {
RasterizerStorageGLES3::Immediate *immediate = storage->immediate_owner.getornull(inst->base);
ERR_CONTINUE(!immediate);
@@ -1261,7 +1261,7 @@ void RasterizerSceneHighEndRD::_fill_render_list(InstanceBase **p_cull_result, i
_add_geometry(immediate, inst, NULL, -1, p_depth_pass, p_shadow_pass);
} break;
- case VS::INSTANCE_PARTICLES: {
+ case RS::INSTANCE_PARTICLES: {
RasterizerStorageGLES3::Particles *particles = storage->particles_owner.getornull(inst->base);
ERR_CONTINUE(!particles);
@@ -1439,10 +1439,10 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
ERR_CONTINUE(base.is_null());
- VS::LightType type = storage->light_get_type(base);
+ RS::LightType type = storage->light_get_type(base);
switch (type) {
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
if (scene_state.ubo.directional_light_count >= scene_state.max_directional_lights) {
continue;
@@ -1460,14 +1460,14 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
float sign = storage->light_is_negative(base) ? -1 : 1;
- light_data.energy = sign * storage->light_get_param(base, VS::LIGHT_PARAM_ENERGY) * Math_PI;
+ light_data.energy = sign * storage->light_get_param(base, RS::LIGHT_PARAM_ENERGY) * Math_PI;
Color linear_col = storage->light_get_color(base).to_linear();
light_data.color[0] = linear_col.r;
light_data.color[1] = linear_col.g;
light_data.color[2] = linear_col.b;
- light_data.specular = storage->light_get_param(base, VS::LIGHT_PARAM_SPECULAR);
+ light_data.specular = storage->light_get_param(base, RS::LIGHT_PARAM_SPECULAR);
light_data.mask = storage->light_get_cull_mask(base);
Color shadow_col = storage->light_get_shadow_color(base).to_linear();
@@ -1480,9 +1480,9 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
if (light_data.shadow_enabled) {
- VS::LightDirectionalShadowMode smode = storage->light_directional_get_shadow_mode(base);
+ RS::LightDirectionalShadowMode smode = storage->light_directional_get_shadow_mode(base);
- int limit = smode == VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL ? 0 : (smode == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS ? 1 : 3);
+ int limit = smode == RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL ? 0 : (smode == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS ? 1 : 3);
light_data.blend_splits = storage->light_directional_get_blend_splits(base);
for (int j = 0; j < 4; j++) {
Rect2 atlas_rect = light_instance_get_directional_shadow_atlas_rect(li, j);
@@ -1501,7 +1501,7 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
store_camera(shadow_mtx, light_data.shadow_matrices[j]);
}
- float fade_start = storage->light_get_param(base, VS::LIGHT_PARAM_SHADOW_FADE_START);
+ float fade_start = storage->light_get_param(base, RS::LIGHT_PARAM_SHADOW_FADE_START);
light_data.fade_from = -light_data.shadow_split_offsets[3] * MIN(fade_start, 0.999); //using 1.0 would break smoothstep
light_data.fade_to = -light_data.shadow_split_offsets[3];
}
@@ -1529,8 +1529,8 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
scene_state.ubo.directional_light_count++;
} break;
- case VS::LIGHT_SPOT:
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_SPOT:
+ case RS::LIGHT_OMNI: {
if (light_count >= scene_state.max_lights) {
continue;
@@ -1543,15 +1543,15 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
float sign = storage->light_is_negative(base) ? -1 : 1;
Color linear_col = storage->light_get_color(base).to_linear();
- light_data.attenuation_energy[0] = Math::make_half_float(storage->light_get_param(base, VS::LIGHT_PARAM_ATTENUATION));
- light_data.attenuation_energy[1] = Math::make_half_float(sign * storage->light_get_param(base, VS::LIGHT_PARAM_ENERGY) * Math_PI);
+ light_data.attenuation_energy[0] = Math::make_half_float(storage->light_get_param(base, RS::LIGHT_PARAM_ATTENUATION));
+ light_data.attenuation_energy[1] = Math::make_half_float(sign * storage->light_get_param(base, RS::LIGHT_PARAM_ENERGY) * Math_PI);
light_data.color_specular[0] = MIN(uint32_t(linear_col.r * 255), 255);
light_data.color_specular[1] = MIN(uint32_t(linear_col.g * 255), 255);
light_data.color_specular[2] = MIN(uint32_t(linear_col.b * 255), 255);
- light_data.color_specular[3] = MIN(uint32_t(storage->light_get_param(base, VS::LIGHT_PARAM_SPECULAR) * 255), 255);
+ light_data.color_specular[3] = MIN(uint32_t(storage->light_get_param(base, RS::LIGHT_PARAM_SPECULAR) * 255), 255);
- float radius = MAX(0.001, storage->light_get_param(base, VS::LIGHT_PARAM_RANGE));
+ float radius = MAX(0.001, storage->light_get_param(base, RS::LIGHT_PARAM_RANGE));
light_data.inv_radius = 1.0 / radius;
Vector3 pos = p_camera_inverse_transform.xform(light_transform.origin);
@@ -1566,8 +1566,8 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
light_data.direction[1] = direction.y;
light_data.direction[2] = direction.z;
- light_data.cone_attenuation_angle[0] = Math::make_half_float(storage->light_get_param(base, VS::LIGHT_PARAM_SPOT_ATTENUATION));
- float spot_angle = storage->light_get_param(base, VS::LIGHT_PARAM_SPOT_ANGLE);
+ light_data.cone_attenuation_angle[0] = Math::make_half_float(storage->light_get_param(base, RS::LIGHT_PARAM_SPOT_ATTENUATION));
+ float spot_angle = storage->light_get_param(base, RS::LIGHT_PARAM_SPOT_ANGLE);
light_data.cone_attenuation_angle[1] = Math::make_half_float(Math::cos(Math::deg2rad(spot_angle)));
light_data.mask = storage->light_get_cull_mask(base);
@@ -1590,7 +1590,7 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
Rect2 rect = light_instance_get_shadow_atlas_rect(li, p_shadow_atlas);
- if (type == VS::LIGHT_OMNI) {
+ if (type == RS::LIGHT_OMNI) {
light_data.atlas_rect[0] = rect.position.x;
light_data.atlas_rect[1] = rect.position.y;
@@ -1600,7 +1600,7 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
Transform proj = (p_camera_inverse_transform * light_transform).inverse();
store_transform(proj, light_data.shadow_matrix);
- } else if (type == VS::LIGHT_SPOT) {
+ } else if (type == RS::LIGHT_SPOT) {
Transform modelview = (p_camera_inverse_transform * light_transform).inverse();
CameraMatrix bias;
@@ -1615,7 +1615,7 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
light_instance_set_index(li, light_count);
- cluster_builder.add_light(type == VS::LIGHT_SPOT ? LightClusterBuilder::LIGHT_TYPE_SPOT : LightClusterBuilder::LIGHT_TYPE_OMNI, light_transform, radius, spot_angle);
+ cluster_builder.add_light(type == RS::LIGHT_SPOT ? LightClusterBuilder::LIGHT_TYPE_SPOT : LightClusterBuilder::LIGHT_TYPE_OMNI, light_transform, radius, spot_angle);
light_count++;
} break;
@@ -1670,7 +1670,7 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor
RENDER_TIMESTAMP("Setup 3D Scene");
- if (get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
+ if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
p_light_cull_count = 0;
p_reflection_probe_cull_count = 0;
p_gi_probe_cull_count = 0;
@@ -1720,7 +1720,7 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor
//we need to allocate both these, if not allocated
_allocate_normal_texture(render_buffer);
_allocate_roughness_texture(render_buffer);
- } else if (p_environment.is_valid() && (environment_is_ssao_enabled(p_environment) || get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_NORMAL_BUFFER)) {
+ } else if (p_environment.is_valid() && (environment_is_ssao_enabled(p_environment) || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_NORMAL_BUFFER)) {
depth_pass_mode = PASS_MODE_DEPTH_NORMAL;
}
@@ -1785,25 +1785,25 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor
Color clear_color;
bool keep_color = false;
- if (get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) {
+ if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_OVERDRAW) {
clear_color = Color(0, 0, 0, 1); //in overdraw mode, BG should always be black
} else if (is_environment(p_environment)) {
- VS::EnvironmentBG bg_mode = environment_get_background(p_environment);
+ RS::EnvironmentBG bg_mode = environment_get_background(p_environment);
float bg_energy = environment_get_bg_energy(p_environment);
switch (bg_mode) {
- case VS::ENV_BG_CLEAR_COLOR: {
+ case RS::ENV_BG_CLEAR_COLOR: {
clear_color = p_default_bg_color;
clear_color.r *= bg_energy;
clear_color.g *= bg_energy;
clear_color.b *= bg_energy;
} break;
- case VS::ENV_BG_COLOR: {
+ case RS::ENV_BG_COLOR: {
clear_color = environment_get_bg_color(p_environment);
clear_color.r *= bg_energy;
clear_color.g *= bg_energy;
clear_color.b *= bg_energy;
} break;
- case VS::ENV_BG_SKY: {
+ case RS::ENV_BG_SKY: {
RID sky = environment_get_sky(p_environment);
if (sky.is_valid()) {
@@ -1822,13 +1822,13 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor
draw_sky = true;
}
} break;
- case VS::ENV_BG_CANVAS: {
+ case RS::ENV_BG_CANVAS: {
keep_color = true;
} break;
- case VS::ENV_BG_KEEP: {
+ case RS::ENV_BG_KEEP: {
keep_color = true;
} break;
- case VS::ENV_BG_CAMERA_FEED: {
+ case RS::ENV_BG_CAMERA_FEED: {
} break;
default: {
@@ -1846,7 +1846,7 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor
_fill_instances(render_list.elements, render_list.element_count, false);
bool can_continue = true; //unless the middle buffers are needed
- bool debug_giprobes = get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_GI_PROBE_ALBEDO || get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_GI_PROBE_LIGHTING || get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_GI_PROBE_EMISSION;
+ bool debug_giprobes = get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_ALBEDO || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_LIGHTING || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_EMISSION;
bool using_separate_specular = false;
bool depth_pre_pass = depth_framebuffer.is_valid();
@@ -1896,7 +1896,7 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor
CameraMatrix cm = (dc * p_cam_projection) * CameraMatrix(p_cam_transform.affine_inverse());
RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(opaque_framebuffer, RD::INITIAL_ACTION_CONTINUE, will_continue ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CONTINUE, will_continue ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ);
for (int i = 0; i < p_gi_probe_cull_count; i++) {
- _debug_giprobe(p_gi_probe_cull_result[i], draw_list, opaque_framebuffer, cm, get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_GI_PROBE_LIGHTING, get_debug_draw_mode() == VS::VIEWPORT_DEBUG_DRAW_GI_PROBE_EMISSION, 1.0);
+ _debug_giprobe(p_gi_probe_cull_result[i], draw_list, opaque_framebuffer, cm, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_LIGHTING, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_EMISSION, 1.0);
}
RD::get_singleton()->draw_list_end();
}
@@ -2105,18 +2105,18 @@ void RasterizerSceneHighEndRD::_update_render_base_uniform_set() {
u.binding = 1;
u.ids.resize(12);
RID *ids_ptr = u.ids.ptrw();
- ids_ptr[0] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[1] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[2] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[3] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[4] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[5] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[6] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[7] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[8] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[9] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[10] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[11] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[0] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[1] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[2] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[3] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[4] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[5] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[6] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[7] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[8] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[9] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[10] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[11] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
uniforms.push_back(u);
}
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.h b/servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.h
index 960b95ee86..4c3422cedb 100644
--- a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.h
+++ b/servers/rendering/rasterizer_rd/rasterizer_scene_high_end_rd.h
@@ -31,11 +31,11 @@
#ifndef RASTERIZER_SCENE_HIGHEND_RD_H
#define RASTERIZER_SCENE_HIGHEND_RD_H
-#include "servers/visual/rasterizer_rd/light_cluster_builder.h"
-#include "servers/visual/rasterizer_rd/rasterizer_scene_rd.h"
-#include "servers/visual/rasterizer_rd/rasterizer_storage_rd.h"
-#include "servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h"
-#include "servers/visual/rasterizer_rd/shaders/scene_high_end.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/light_cluster_builder.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_scene_rd.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_storage_rd.h"
+#include "servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h"
+#include "servers/rendering/rasterizer_rd/shaders/scene_high_end.glsl.gen.h"
class RasterizerSceneHighEndRD : public RasterizerSceneRD {
@@ -111,7 +111,7 @@ class RasterizerSceneHighEndRD : public RasterizerSceneRD {
bool valid;
RID version;
uint32_t vertex_input_mask;
- RenderPipelineVertexFormatCacheRD pipelines[CULL_VARIANT_MAX][VS::PRIMITIVE_MAX][SHADER_VERSION_MAX];
+ RenderPipelineVertexFormatCacheRD pipelines[CULL_VARIANT_MAX][RS::PRIMITIVE_MAX][SHADER_VERSION_MAX];
String path;
@@ -211,7 +211,7 @@ class RasterizerSceneHighEndRD : public RasterizerSceneRD {
void ensure_specular();
void clear();
- virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, VS::ViewportMSAA p_msaa);
+ virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa);
RID uniform_set;
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
index 395b73ca9b..842f7046c9 100644
--- a/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
@@ -32,7 +32,7 @@
#include "core/os/os.h"
#include "core/project_settings.h"
-#include "servers/visual/visual_server_raster.h"
+#include "servers/rendering/rendering_server_raster.h"
uint64_t RasterizerSceneRD::auto_exposure_counter = 2;
@@ -212,7 +212,7 @@ void RasterizerSceneRD::sky_set_radiance_size(RID p_sky, int p_radiance_size) {
}
sky->radiance_size = p_radiance_size;
- if (sky->mode == VS::SKY_MODE_REALTIME && sky->radiance_size != 256) {
+ if (sky->mode == RS::SKY_MODE_REALTIME && sky->radiance_size != 256) {
WARN_PRINT("Realtime Skies can only use a radiance size of 256. Radiance size will be set to 256 internally.");
sky->radiance_size = 256;
}
@@ -225,7 +225,7 @@ void RasterizerSceneRD::sky_set_radiance_size(RID p_sky, int p_radiance_size) {
_clear_reflection_data(sky->reflection);
}
-void RasterizerSceneRD::sky_set_mode(RID p_sky, VS::SkyMode p_mode) {
+void RasterizerSceneRD::sky_set_mode(RID p_sky, RS::SkyMode p_mode) {
Sky *sky = sky_owner.getornull(p_sky);
ERR_FAIL_COND(!sky);
@@ -235,7 +235,7 @@ void RasterizerSceneRD::sky_set_mode(RID p_sky, VS::SkyMode p_mode) {
sky->mode = p_mode;
- if (sky->mode == VS::SKY_MODE_REALTIME && sky->radiance_size != 256) {
+ if (sky->mode == RS::SKY_MODE_REALTIME && sky->radiance_size != 256) {
WARN_PRINT("Realtime Skies can only use a radiance size of 256. Radiance size will be set to 256 internally.");
sky_set_radiance_size(p_sky, 256);
}
@@ -267,7 +267,7 @@ void RasterizerSceneRD::_update_dirty_skys() {
uint32_t w = sky->radiance_size, h = sky->radiance_size;
int layers = roughness_layers;
- if (sky->mode == VS::SKY_MODE_REALTIME) {
+ if (sky->mode == RS::SKY_MODE_REALTIME) {
layers = 8;
if (roughness_layers != 8) {
WARN_PRINT("When using REALTIME skies, roughness_layers should be set to 8 in the project settings for best quality reflections");
@@ -287,7 +287,7 @@ void RasterizerSceneRD::_update_dirty_skys() {
sky->radiance = RD::get_singleton()->texture_create(tf, RD::TextureView());
- _update_reflection_data(sky->reflection, sky->radiance_size, mipmaps, true, sky->radiance, 0, sky->mode == VS::SKY_MODE_REALTIME);
+ _update_reflection_data(sky->reflection, sky->radiance_size, mipmaps, true, sky->radiance, 0, sky->mode == RS::SKY_MODE_REALTIME);
} else {
//regular cubemap, lower quality (aliasing, less memory)
@@ -302,7 +302,7 @@ void RasterizerSceneRD::_update_dirty_skys() {
sky->radiance = RD::get_singleton()->texture_create(tf, RD::TextureView());
- _update_reflection_data(sky->reflection, sky->radiance_size, MIN(mipmaps, layers), false, sky->radiance, 0, sky->mode == VS::SKY_MODE_REALTIME);
+ _update_reflection_data(sky->reflection, sky->radiance_size, MIN(mipmaps, layers), false, sky->radiance, 0, sky->mode == RS::SKY_MODE_REALTIME);
}
texture_set_dirty = true;
}
@@ -604,7 +604,7 @@ void RasterizerSceneRD::_setup_sky(RID p_environment, const Vector3 &p_position,
sky->prev_time = time;
sky->reflection.dirty = true;
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
if (material != sky->prev_material) {
@@ -785,7 +785,7 @@ void RasterizerSceneRD::_update_sky(RID p_environment, const CameraMatrix &p_pro
RD::get_singleton()->draw_list_end();
}
if (sky_use_cubemap_array) {
- if (sky->mode == VS::SKY_MODE_QUALITY) {
+ if (sky->mode == RS::SKY_MODE_QUALITY) {
for (int i = 1; i < sky->reflection.layers.size(); i++) {
_create_reflection_importance_sample(sky->reflection, sky_use_cubemap_array, 10, i);
}
@@ -795,7 +795,7 @@ void RasterizerSceneRD::_update_sky(RID p_environment, const CameraMatrix &p_pro
_update_reflection_mipmaps(sky->reflection);
} else {
- if (sky->mode == VS::SKY_MODE_QUALITY) {
+ if (sky->mode == RS::SKY_MODE_QUALITY) {
for (int i = 1; i < sky->reflection.layers[0].mipmaps.size(); i++) {
_create_reflection_importance_sample(sky->reflection, sky_use_cubemap_array, 10, i);
}
@@ -857,7 +857,7 @@ void RasterizerSceneRD::SkyShaderData::set_code(const String &p_code) {
RasterizerSceneRD *scene_singleton = (RasterizerSceneRD *)RasterizerSceneRD::singleton;
- Error err = scene_singleton->sky_shader.compiler.compile(VS::SHADER_SKY, code, &actions, path, gen_code);
+ Error err = scene_singleton->sky_shader.compiler.compile(RS::SHADER_SKY, code, &actions, path, gen_code);
ERR_FAIL_COND(err != OK);
@@ -1082,7 +1082,7 @@ RID RasterizerSceneRD::environment_create() {
return environment_owner.make_rid(Environent());
}
-void RasterizerSceneRD::environment_set_background(RID p_env, VS::EnvironmentBG p_bg) {
+void RasterizerSceneRD::environment_set_background(RID p_env, RS::EnvironmentBG p_bg) {
Environent *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->background = p_bg;
@@ -1117,7 +1117,7 @@ void RasterizerSceneRD::environment_set_canvas_max_layer(RID p_env, int p_max_la
ERR_FAIL_COND(!env);
env->canvas_max_layer = p_max_layer;
}
-void RasterizerSceneRD::environment_set_ambient_light(RID p_env, const Color &p_color, VS::EnvironmentAmbientSource p_ambient, float p_energy, float p_sky_contribution, VS::EnvironmentReflectionSource p_reflection_source, const Color &p_ao_color) {
+void RasterizerSceneRD::environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient, float p_energy, float p_sky_contribution, RS::EnvironmentReflectionSource p_reflection_source, const Color &p_ao_color) {
Environent *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->ambient_light = p_color;
@@ -1128,9 +1128,9 @@ void RasterizerSceneRD::environment_set_ambient_light(RID p_env, const Color &p_
env->ao_color = p_ao_color;
}
-VS::EnvironmentBG RasterizerSceneRD::environment_get_background(RID p_env) const {
+RS::EnvironmentBG RasterizerSceneRD::environment_get_background(RID p_env) const {
Environent *env = environment_owner.getornull(p_env);
- ERR_FAIL_COND_V(!env, VS::ENV_BG_MAX);
+ ERR_FAIL_COND_V(!env, RS::ENV_BG_MAX);
return env->background;
}
RID RasterizerSceneRD::environment_get_sky(RID p_env) const {
@@ -1168,9 +1168,9 @@ Color RasterizerSceneRD::environment_get_ambient_light_color(RID p_env) const {
ERR_FAIL_COND_V(!env, Color());
return env->ambient_light;
}
-VS::EnvironmentAmbientSource RasterizerSceneRD::environment_get_ambient_light_ambient_source(RID p_env) const {
+RS::EnvironmentAmbientSource RasterizerSceneRD::environment_get_ambient_light_ambient_source(RID p_env) const {
Environent *env = environment_owner.getornull(p_env);
- ERR_FAIL_COND_V(!env, VS::ENV_AMBIENT_SOURCE_BG);
+ ERR_FAIL_COND_V(!env, RS::ENV_AMBIENT_SOURCE_BG);
return env->ambient_source;
}
float RasterizerSceneRD::environment_get_ambient_light_ambient_energy(RID p_env) const {
@@ -1183,9 +1183,9 @@ float RasterizerSceneRD::environment_get_ambient_sky_contribution(RID p_env) con
ERR_FAIL_COND_V(!env, 0);
return env->ambient_sky_contribution;
}
-VS::EnvironmentReflectionSource RasterizerSceneRD::environment_get_reflection_source(RID p_env) const {
+RS::EnvironmentReflectionSource RasterizerSceneRD::environment_get_reflection_source(RID p_env) const {
Environent *env = environment_owner.getornull(p_env);
- ERR_FAIL_COND_V(!env, VS::ENV_REFLECTION_SOURCE_DISABLED);
+ ERR_FAIL_COND_V(!env, RS::ENV_REFLECTION_SOURCE_DISABLED);
return env->reflection_source;
}
@@ -1195,7 +1195,7 @@ Color RasterizerSceneRD::environment_get_ao_color(RID p_env) const {
return env->ao_color;
}
-void RasterizerSceneRD::environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {
+void RasterizerSceneRD::environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {
Environent *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->exposure = p_exposure;
@@ -1211,7 +1211,7 @@ void RasterizerSceneRD::environment_set_tonemap(RID p_env, VS::EnvironmentToneMa
env->auto_exp_scale = p_auto_exp_scale;
}
-void RasterizerSceneRD::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {
+void RasterizerSceneRD::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {
Environent *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -1228,7 +1228,7 @@ void RasterizerSceneRD::environment_set_glow(RID p_env, bool p_enable, int p_lev
env->glow_bicubic_upscale = p_bicubic_upscale;
}
-void RasterizerSceneRD::environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {
+void RasterizerSceneRD::environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {
Environent *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
@@ -1242,7 +1242,7 @@ void RasterizerSceneRD::environment_set_ssao(RID p_env, bool p_enable, float p_r
env->ssao_blur = p_blur;
}
-void RasterizerSceneRD::environment_set_ssao_quality(VS::EnvironmentSSAOQuality p_quality, bool p_half_size) {
+void RasterizerSceneRD::environment_set_ssao_quality(RS::EnvironmentSSAOQuality p_quality, bool p_half_size) {
ssao_quality = p_quality;
ssao_half_size = p_half_size;
}
@@ -1363,7 +1363,7 @@ bool RasterizerSceneRD::reflection_probe_instance_needs_redraw(RID p_instance) {
return true;
}
- if (storage->reflection_probe_get_update_mode(rpi->probe) == VS::REFLECTION_PROBE_UPDATE_ALWAYS) {
+ if (storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS) {
return true;
}
@@ -1387,12 +1387,12 @@ bool RasterizerSceneRD::reflection_probe_instance_begin_render(RID p_instance, R
ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance);
ERR_FAIL_COND_V(!rpi, false);
- if (storage->reflection_probe_get_update_mode(rpi->probe) == VS::REFLECTION_PROBE_UPDATE_ALWAYS && atlas->reflection.is_valid() && atlas->size != 256) {
+ if (storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS && atlas->reflection.is_valid() && atlas->size != 256) {
WARN_PRINT("ReflectionProbes set to UPDATE_ALWAYS must have an atlas size of 256. Please update the atlas size in the ProjectSettings.");
reflection_atlas_set_size(p_reflection_atlas, 256, atlas->count);
}
- if (storage->reflection_probe_get_update_mode(rpi->probe) == VS::REFLECTION_PROBE_UPDATE_ALWAYS && atlas->reflection.is_valid() && atlas->reflections[0].data.layers[0].mipmaps.size() != 8) {
+ if (storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS && atlas->reflection.is_valid() && atlas->reflections[0].data.layers[0].mipmaps.size() != 8) {
// Invalidate reflection atlas, need to regenerate
RD::get_singleton()->free(atlas->reflection);
atlas->reflection = RID();
@@ -1409,7 +1409,7 @@ bool RasterizerSceneRD::reflection_probe_instance_begin_render(RID p_instance, R
if (atlas->reflection.is_null()) {
int mipmaps = MIN(roughness_layers, Image::get_image_required_mipmaps(atlas->size, atlas->size, Image::FORMAT_RGBAH) + 1);
- mipmaps = storage->reflection_probe_get_update_mode(rpi->probe) == VS::REFLECTION_PROBE_UPDATE_ALWAYS ? 8 : mipmaps; // always use 8 mipmaps with real time filtering
+ mipmaps = storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS ? 8 : mipmaps; // always use 8 mipmaps with real time filtering
{
//reflection atlas was unused, create:
RD::TextureFormat tf;
@@ -1434,7 +1434,7 @@ bool RasterizerSceneRD::reflection_probe_instance_begin_render(RID p_instance, R
}
atlas->reflections.resize(atlas->count);
for (int i = 0; i < atlas->count; i++) {
- _update_reflection_data(atlas->reflections.write[i].data, atlas->size, mipmaps, false, atlas->reflection, i * 6, storage->reflection_probe_get_update_mode(rpi->probe) == VS::REFLECTION_PROBE_UPDATE_ALWAYS);
+ _update_reflection_data(atlas->reflections.write[i].data, atlas->size, mipmaps, false, atlas->reflection, i * 6, storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS);
for (int j = 0; j < 6; j++) {
Vector<RID> fb;
fb.push_back(atlas->reflections.write[i].data.layers[0].mipmaps[0].views[j]);
@@ -1493,7 +1493,7 @@ bool RasterizerSceneRD::reflection_probe_instance_postprocess_step(RID p_instanc
return false;
}
- if (storage->reflection_probe_get_update_mode(rpi->probe) == VS::REFLECTION_PROBE_UPDATE_ALWAYS) {
+ if (storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS) {
// Using real time reflections, all roughness is done in one step
_create_reflection_fast_filter(atlas->reflections.write[rpi->atlas_index].data, false);
rpi->rendering = false;
@@ -1937,10 +1937,10 @@ int RasterizerSceneRD::get_directional_light_shadow_size(RID p_light_intance) {
ERR_FAIL_COND_V(!light_instance, 0);
switch (storage->light_directional_get_shadow_mode(light_instance->light)) {
- case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL:
+ case RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL:
break; //none
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: r.size.height /= 2; break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: r.size /= 2; break;
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: r.size.height /= 2; break;
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: r.size /= 2; break;
}
return MAX(r.size.width, r.size.height);
@@ -1953,13 +1953,13 @@ RID RasterizerSceneRD::camera_effects_create() {
return camera_effects_owner.make_rid(CameraEffects());
}
-void RasterizerSceneRD::camera_effects_set_dof_blur_quality(VS::DOFBlurQuality p_quality, bool p_use_jitter) {
+void RasterizerSceneRD::camera_effects_set_dof_blur_quality(RS::DOFBlurQuality p_quality, bool p_use_jitter) {
dof_blur_quality = p_quality;
dof_blur_use_jitter = p_use_jitter;
}
-void RasterizerSceneRD::camera_effects_set_dof_blur_bokeh_shape(VS::DOFBokehShape p_shape) {
+void RasterizerSceneRD::camera_effects_set_dof_blur_bokeh_shape(RS::DOFBokehShape p_shape) {
dof_blur_bokeh_shape = p_shape;
}
@@ -2014,7 +2014,7 @@ void RasterizerSceneRD::light_instance_set_shadow_transform(RID p_light_instance
LightInstance *light_instance = light_instance_owner.getornull(p_light_instance);
ERR_FAIL_COND(!light_instance);
- if (storage->light_get_type(light_instance->light) != VS::LIGHT_DIRECTIONAL) {
+ if (storage->light_get_type(light_instance->light) != RS::LIGHT_DIRECTIONAL) {
p_pass = 0;
}
@@ -2257,7 +2257,7 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 10;
- u.ids.push_back(storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
+ u.ids.push_back(storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
uniforms.push_back(u);
}
@@ -2446,7 +2446,7 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 10;
- u.ids.push_back(storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
+ u.ids.push_back(storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
uniforms.push_back(u);
}
{
@@ -2516,7 +2516,7 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 10;
- u.ids.push_back(storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
+ u.ids.push_back(storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
uniforms.push_back(u);
}
@@ -2589,16 +2589,16 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
RID light = light_instance_get_base_light(light_instance);
l.type = storage->light_get_type(light);
- l.attenuation = storage->light_get_param(light, VS::LIGHT_PARAM_ATTENUATION);
- l.energy = storage->light_get_param(light, VS::LIGHT_PARAM_ENERGY) * storage->light_get_param(light, VS::LIGHT_PARAM_INDIRECT_ENERGY);
- l.radius = to_cell.basis.xform(Vector3(storage->light_get_param(light, VS::LIGHT_PARAM_RANGE), 0, 0)).length();
+ l.attenuation = storage->light_get_param(light, RS::LIGHT_PARAM_ATTENUATION);
+ l.energy = storage->light_get_param(light, RS::LIGHT_PARAM_ENERGY) * storage->light_get_param(light, RS::LIGHT_PARAM_INDIRECT_ENERGY);
+ l.radius = to_cell.basis.xform(Vector3(storage->light_get_param(light, RS::LIGHT_PARAM_RANGE), 0, 0)).length();
Color color = storage->light_get_color(light).to_linear();
l.color[0] = color.r;
l.color[1] = color.g;
l.color[2] = color.b;
- l.spot_angle_radians = Math::deg2rad(storage->light_get_param(light, VS::LIGHT_PARAM_SPOT_ANGLE));
- l.spot_attenuation = storage->light_get_param(light, VS::LIGHT_PARAM_SPOT_ATTENUATION);
+ l.spot_angle_radians = Math::deg2rad(storage->light_get_param(light, RS::LIGHT_PARAM_SPOT_ANGLE));
+ l.spot_attenuation = storage->light_get_param(light, RS::LIGHT_PARAM_SPOT_ATTENUATION);
Transform xform = light_instance_get_base_transform(light_instance);
@@ -2975,7 +2975,7 @@ void RasterizerSceneRD::_debug_giprobe(RID p_gi_probe, RD::DrawListID p_draw_lis
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 3;
- u.ids.push_back(storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
+ u.ids.push_back(storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
uniforms.push_back(u);
}
@@ -3271,7 +3271,7 @@ void RasterizerSceneRD::_render_buffers_post_process_and_tonemap(RID p_render_bu
//swap final reduce with prev luminance
SWAP(rb->luminance.current, rb->luminance.reduce.write[rb->luminance.reduce.size() - 1]);
- VisualServerRaster::redraw_request(); //redraw all the time if auto exposure rendering is on
+ RenderingServerRaster::redraw_request(); //redraw all the time if auto exposure rendering is on
}
int max_glow_level = -1;
@@ -3286,7 +3286,7 @@ void RasterizerSceneRD::_render_buffers_post_process_and_tonemap(RID p_render_bu
_render_buffers_uniform_set_changed(p_render_buffers);
}
- for (int i = 0; i < VS::MAX_GLOW_LEVELS; i++) {
+ for (int i = 0; i < RS::MAX_GLOW_LEVELS; i++) {
if (env->glow_levels & (1 << i)) {
if (i >= rb->blur[1].mipmaps.size()) {
@@ -3335,7 +3335,7 @@ void RasterizerSceneRD::_render_buffers_post_process_and_tonemap(RID p_render_bu
if (can_use_effects && env && env->glow_enabled) {
tonemap.use_glow = true;
tonemap.glow_mode = RasterizerEffectsRD::TonemapSettings::GlowMode(env->glow_blend_mode);
- tonemap.glow_intensity = env->glow_blend_mode == VS::ENV_GLOW_BLEND_MODE_MIX ? env->glow_mix : env->glow_intensity;
+ tonemap.glow_intensity = env->glow_blend_mode == RS::ENV_GLOW_BLEND_MODE_MIX ? env->glow_mix : env->glow_intensity;
tonemap.glow_level_flags = glow_mask;
tonemap.glow_texture_size.x = rb->blur[1].mipmaps[0].width;
tonemap.glow_texture_size.y = rb->blur[1].mipmaps[0].height;
@@ -3363,7 +3363,7 @@ void RasterizerSceneRD::_render_buffers_debug_draw(RID p_render_buffers, RID p_s
RenderBuffers *rb = render_buffers_owner.getornull(p_render_buffers);
ERR_FAIL_COND(!rb);
- if (debug_draw == VS::VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS) {
+ if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS) {
if (p_shadow_atlas.is_valid()) {
RID shadow_atlas_texture = shadow_atlas_get_texture(p_shadow_atlas);
Size2 rtsize = storage->render_target_get_size(rb->render_target);
@@ -3372,7 +3372,7 @@ void RasterizerSceneRD::_render_buffers_debug_draw(RID p_render_buffers, RID p_s
}
}
- if (debug_draw == VS::VIEWPORT_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS) {
+ if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS) {
if (directional_shadow_get_texture().is_valid()) {
RID shadow_atlas_texture = directional_shadow_get_texture();
Size2 rtsize = storage->render_target_get_size(rb->render_target);
@@ -3381,7 +3381,7 @@ void RasterizerSceneRD::_render_buffers_debug_draw(RID p_render_buffers, RID p_s
}
}
- if (debug_draw == VS::VIEWPORT_DEBUG_DRAW_SCENE_LUMINANCE) {
+ if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_SCENE_LUMINANCE) {
if (rb->luminance.current.is_valid()) {
Size2 rtsize = storage->render_target_get_size(rb->render_target);
@@ -3389,18 +3389,18 @@ void RasterizerSceneRD::_render_buffers_debug_draw(RID p_render_buffers, RID p_s
}
}
- if (debug_draw == VS::VIEWPORT_DEBUG_DRAW_SSAO && rb->ssao.ao[0].is_valid()) {
+ if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_SSAO && rb->ssao.ao[0].is_valid()) {
Size2 rtsize = storage->render_target_get_size(rb->render_target);
RID ao_buf = rb->ssao.ao_full.is_valid() ? rb->ssao.ao_full : rb->ssao.ao[0];
effects->copy_to_rect(ao_buf, storage->render_target_get_rd_framebuffer(rb->render_target), Rect2(Vector2(), rtsize), false, true);
}
- if (debug_draw == VS::VIEWPORT_DEBUG_DRAW_ROUGHNESS_LIMITER && _render_buffers_get_roughness_texture(p_render_buffers).is_valid()) {
+ if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_ROUGHNESS_LIMITER && _render_buffers_get_roughness_texture(p_render_buffers).is_valid()) {
Size2 rtsize = storage->render_target_get_size(rb->render_target);
effects->copy_to_rect(_render_buffers_get_roughness_texture(p_render_buffers), storage->render_target_get_rd_framebuffer(rb->render_target), Rect2(Vector2(), rtsize), false, true);
}
- if (debug_draw == VS::VIEWPORT_DEBUG_DRAW_NORMAL_BUFFER && _render_buffers_get_normal_texture(p_render_buffers).is_valid()) {
+ if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_NORMAL_BUFFER && _render_buffers_get_normal_texture(p_render_buffers).is_valid()) {
Size2 rtsize = storage->render_target_get_size(rb->render_target);
effects->copy_to_rect(_render_buffers_get_normal_texture(p_render_buffers), storage->render_target_get_rd_framebuffer(rb->render_target), Rect2(Vector2(), rtsize));
}
@@ -3423,7 +3423,7 @@ RID RasterizerSceneRD::render_buffers_get_ao_texture(RID p_render_buffers) {
return rb->ssao.ao_full.is_valid() ? rb->ssao.ao_full : rb->ssao.ao[0];
}
-void RasterizerSceneRD::render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, VS::ViewportMSAA p_msaa) {
+void RasterizerSceneRD::render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa) {
RenderBuffers *rb = render_buffers_owner.getornull(p_render_buffers);
rb->width = p_width;
@@ -3513,7 +3513,7 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
CameraMatrix light_projection;
Transform light_transform;
- if (storage->light_get_type(light_instance->light) == VS::LIGHT_DIRECTIONAL) {
+ if (storage->light_get_type(light_instance->light) == RS::LIGHT_DIRECTIONAL) {
//set pssm stuff
if (light_instance->last_scene_shadow_pass != scene_pass) {
light_instance->directional_rect = _get_directional_shadow_rect(directional_shadow.size, directional_shadow.light_count, directional_shadow.current_light);
@@ -3529,7 +3529,7 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
atlas_rect.size.width = light_instance->directional_rect.size.x;
atlas_rect.size.height = light_instance->directional_rect.size.y;
- if (storage->light_directional_get_shadow_mode(light_instance->light) == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) {
+ if (storage->light_directional_get_shadow_mode(light_instance->light) == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) {
atlas_rect.size.width /= 2;
atlas_rect.size.height /= 2;
@@ -3543,7 +3543,7 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
atlas_rect.position.y += atlas_rect.size.height;
}
- } else if (storage->light_directional_get_shadow_mode(light_instance->light) == VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) {
+ } else if (storage->light_directional_get_shadow_mode(light_instance->light) == RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) {
atlas_rect.size.height /= 2;
@@ -3559,10 +3559,10 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
light_instance->shadow_transform[p_pass].atlas_rect.position /= directional_shadow.size;
light_instance->shadow_transform[p_pass].atlas_rect.size /= directional_shadow.size;
- float bias_mult = Math::lerp(1.0f, light_instance->shadow_transform[p_pass].bias_scale, storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE));
- zfar = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_RANGE);
- bias = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_SHADOW_BIAS) * bias_mult;
- normal_bias = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS) * bias_mult;
+ float bias_mult = Math::lerp(1.0f, light_instance->shadow_transform[p_pass].bias_scale, storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE));
+ zfar = storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_RANGE);
+ bias = storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_SHADOW_BIAS) * bias_mult;
+ normal_bias = storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS) * bias_mult;
ShadowMap *shadow_map = _get_shadow_map(atlas_rect.size);
render_fb = shadow_map->fb;
@@ -3596,13 +3596,13 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
atlas_rect.size.height = shadow_size;
atlas_fb = shadow_atlas->fb;
- zfar = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_RANGE);
- bias = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_SHADOW_BIAS);
- normal_bias = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS);
+ zfar = storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_RANGE);
+ bias = storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_SHADOW_BIAS);
+ normal_bias = storage->light_get_param(light_instance->light, RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS);
- if (storage->light_get_type(light_instance->light) == VS::LIGHT_OMNI) {
+ if (storage->light_get_type(light_instance->light) == RS::LIGHT_OMNI) {
- if (storage->light_omni_get_shadow_mode(light_instance->light) == VS::LIGHT_OMNI_SHADOW_CUBE) {
+ if (storage->light_omni_get_shadow_mode(light_instance->light) == RS::LIGHT_OMNI_SHADOW_CUBE) {
ShadowCubemap *cubemap = _get_shadow_cubemap(shadow_size / 2);
@@ -3630,7 +3630,7 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
render_texture = shadow_map->depth;
}
- } else if (storage->light_get_type(light_instance->light) == VS::LIGHT_SPOT) {
+ } else if (storage->light_get_type(light_instance->light) == RS::LIGHT_SPOT) {
light_projection = light_instance->shadow_transform[0].camera;
light_transform = light_instance->shadow_transform[0].transform;
@@ -3769,7 +3769,7 @@ bool RasterizerSceneRD::free(RID p_rid) {
return true;
}
-void RasterizerSceneRD::set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) {
+void RasterizerSceneRD::set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw) {
debug_draw = p_debug_draw;
}
@@ -3985,27 +3985,27 @@ RasterizerSceneRD::RasterizerSceneRD(RasterizerStorageRD *p_storage) {
u.binding = 0;
u.ids.resize(12);
RID *ids_ptr = u.ids.ptrw();
- ids_ptr[0] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[1] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[2] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[3] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[4] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[5] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
- ids_ptr[6] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[7] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[8] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[9] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[10] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
- ids_ptr[11] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[0] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[1] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[2] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[3] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[4] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[5] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
+ ids_ptr[6] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[7] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[8] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[9] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[10] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
+ ids_ptr[11] = storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
uniforms.push_back(u);
}
sky_scene_state.sampler_uniform_set = RD::get_singleton()->uniform_set_create(uniforms, sky_shader.default_shader_rd, SKY_SET_SAMPLERS);
}
- camera_effects_set_dof_blur_bokeh_shape(VS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape"))));
- camera_effects_set_dof_blur_quality(VS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality"))), GLOBAL_GET("rendering/quality/filters/depth_of_field_use_jitter"));
- environment_set_ssao_quality(VS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size"));
+ camera_effects_set_dof_blur_bokeh_shape(RS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape"))));
+ camera_effects_set_dof_blur_quality(RS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality"))), GLOBAL_GET("rendering/quality/filters/depth_of_field_use_jitter"));
+ environment_set_ssao_quality(RS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size"));
screen_space_roughness_limiter = GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter");
screen_space_roughness_limiter_curve = GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter_curve");
}
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_rd.h b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.h
index 7332f93dc5..0a1cc8ebd7 100644
--- a/servers/visual/rasterizer_rd/rasterizer_scene_rd.h
+++ b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.h
@@ -32,12 +32,12 @@
#define RASTERIZER_SCENE_RD_H
#include "core/rid_owner.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual/rasterizer_rd/rasterizer_storage_rd.h"
-#include "servers/visual/rasterizer_rd/shaders/giprobe.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/giprobe_debug.glsl.gen.h"
-#include "servers/visual/rasterizer_rd/shaders/sky.glsl.gen.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_storage_rd.h"
+#include "servers/rendering/rasterizer_rd/shaders/giprobe.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/giprobe_debug.glsl.gen.h"
+#include "servers/rendering/rasterizer_rd/shaders/sky.glsl.gen.h"
+#include "servers/rendering/rendering_device.h"
class RasterizerSceneRD : public RasterizerScene {
public:
@@ -73,7 +73,7 @@ protected:
struct RenderBufferData {
- virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, VS::ViewportMSAA p_msaa) = 0;
+ virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa) = 0;
virtual ~RenderBufferData() {}
};
virtual RenderBufferData *_create_render_buffer_data() = 0;
@@ -98,7 +98,7 @@ protected:
void _draw_sky(bool p_can_continue, RID p_fb, RID p_environment, const CameraMatrix &p_projection, const Transform &p_transform);
private:
- VS::ViewportDebugDraw debug_draw = VS::VIEWPORT_DEBUG_DRAW_DISABLED;
+ RS::ViewportDebugDraw debug_draw = RS::VIEWPORT_DEBUG_DRAW_DISABLED;
double time_step = 0;
static RasterizerSceneRD *singleton;
@@ -255,7 +255,7 @@ private:
int radiance_size = 256;
- VS::SkyMode mode = VS::SKY_MODE_QUALITY;
+ RS::SkyMode mode = RS::SKY_MODE_QUALITY;
ReflectionData reflection;
bool dirty = false;
@@ -571,7 +571,7 @@ private:
Rect2 atlas_rect;
};
- VS::LightType light_type;
+ RS::LightType light_type;
ShadowTransform shadow_transform[4];
@@ -608,23 +608,23 @@ private:
struct Environent {
// BG
- VS::EnvironmentBG background = VS::ENV_BG_CLEAR_COLOR;
+ RS::EnvironmentBG background = RS::ENV_BG_CLEAR_COLOR;
RID sky;
float sky_custom_fov = 0.0;
Basis sky_orientation;
Color bg_color;
float bg_energy = 1.0;
int canvas_max_layer = 0;
- VS::EnvironmentAmbientSource ambient_source = VS::ENV_AMBIENT_SOURCE_BG;
+ RS::EnvironmentAmbientSource ambient_source = RS::ENV_AMBIENT_SOURCE_BG;
Color ambient_light;
float ambient_light_energy = 1.0;
float ambient_sky_contribution = 1.0;
- VS::EnvironmentReflectionSource reflection_source = VS::ENV_REFLECTION_SOURCE_BG;
+ RS::EnvironmentReflectionSource reflection_source = RS::ENV_REFLECTION_SOURCE_BG;
Color ao_color;
/// Tonemap
- VS::EnvironmentToneMapper tone_mapper;
+ RS::EnvironmentToneMapper tone_mapper;
float exposure = 1.0;
float white = 1.0;
bool auto_exposure = false;
@@ -642,7 +642,7 @@ private:
float glow_strength = 1.0;
float glow_bloom = 0.0;
float glow_mix = 0.01;
- VS::EnvironmentGlowBlendMode glow_blend_mode = VS::ENV_GLOW_BLEND_MODE_SOFTLIGHT;
+ RS::EnvironmentGlowBlendMode glow_blend_mode = RS::ENV_GLOW_BLEND_MODE_SOFTLIGHT;
float glow_hdr_bleed_threshold = 1.0;
float glow_hdr_luminance_cap = 12.0;
float glow_hdr_bleed_scale = 2.0;
@@ -657,10 +657,10 @@ private:
float ssao_direct_light_affect = 0.0;
float ssao_ao_channel_affect = 0.0;
float ssao_blur_edge_sharpness = 4.0;
- VS::EnvironmentSSAOBlur ssao_blur = VS::ENV_SSAO_BLUR_3x3;
+ RS::EnvironmentSSAOBlur ssao_blur = RS::ENV_SSAO_BLUR_3x3;
};
- VS::EnvironmentSSAOQuality ssao_quality = VS::ENV_SSAO_QUALITY_MEDIUM;
+ RS::EnvironmentSSAOQuality ssao_quality = RS::ENV_SSAO_QUALITY_MEDIUM;
bool ssao_half_size = false;
static uint64_t auto_exposure_counter;
@@ -685,8 +685,8 @@ private:
float override_exposure = 1;
};
- VS::DOFBlurQuality dof_blur_quality = VS::DOF_BLUR_QUALITY_MEDIUM;
- VS::DOFBokehShape dof_blur_bokeh_shape = VS::DOF_BOKEH_HEXAGON;
+ RS::DOFBlurQuality dof_blur_quality = RS::DOF_BLUR_QUALITY_MEDIUM;
+ RS::DOFBokehShape dof_blur_bokeh_shape = RS::DOF_BOKEH_HEXAGON;
bool dof_blur_use_jitter = false;
mutable RID_Owner<CameraEffects> camera_effects_owner;
@@ -697,7 +697,7 @@ private:
RenderBufferData *data = nullptr;
int width = 0, height = 0;
- VS::ViewportMSAA msaa = VS::VIEWPORT_MSAA_DISABLED;
+ RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED;
RID render_target;
uint64_t auto_exposure_version = 1;
@@ -791,7 +791,7 @@ public:
RID sky_create();
void sky_set_radiance_size(RID p_sky, int p_radiance_size);
- void sky_set_mode(RID p_sky, VS::SkyMode p_mode);
+ void sky_set_mode(RID p_sky, RS::SkyMode p_mode);
void sky_set_material(RID p_sky, RID p_material);
RID sky_get_radiance_texture_rd(RID p_sky) const;
@@ -802,16 +802,16 @@ public:
RID environment_create();
- void environment_set_background(RID p_env, VS::EnvironmentBG p_bg);
+ void environment_set_background(RID p_env, RS::EnvironmentBG p_bg);
void environment_set_sky(RID p_env, RID p_sky);
void environment_set_sky_custom_fov(RID p_env, float p_scale);
void environment_set_sky_orientation(RID p_env, const Basis &p_orientation);
void environment_set_bg_color(RID p_env, const Color &p_color);
void environment_set_bg_energy(RID p_env, float p_energy);
void environment_set_canvas_max_layer(RID p_env, int p_max_layer);
- void environment_set_ambient_light(RID p_env, const Color &p_color, VS::EnvironmentAmbientSource p_ambient = VS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, VS::EnvironmentReflectionSource p_reflection_source = VS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color());
+ void environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient = RS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, RS::EnvironmentReflectionSource p_reflection_source = RS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color());
- VS::EnvironmentBG environment_get_background(RID p_env) const;
+ RS::EnvironmentBG environment_get_background(RID p_env) const;
RID environment_get_sky(RID p_env) const;
float environment_get_sky_custom_fov(RID p_env) const;
Basis environment_get_sky_orientation(RID p_env) const;
@@ -819,27 +819,27 @@ public:
float environment_get_bg_energy(RID p_env) const;
int environment_get_canvas_max_layer(RID p_env) const;
Color environment_get_ambient_light_color(RID p_env) const;
- VS::EnvironmentAmbientSource environment_get_ambient_light_ambient_source(RID p_env) const;
+ RS::EnvironmentAmbientSource environment_get_ambient_light_ambient_source(RID p_env) const;
float environment_get_ambient_light_ambient_energy(RID p_env) const;
float environment_get_ambient_sky_contribution(RID p_env) const;
- VS::EnvironmentReflectionSource environment_get_reflection_source(RID p_env) const;
+ RS::EnvironmentReflectionSource environment_get_reflection_source(RID p_env) const;
Color environment_get_ao_color(RID p_env) const;
bool is_environment(RID p_env) const;
- void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale);
+ void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale);
void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) {}
void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) {}
- void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness);
- void environment_set_ssao_quality(VS::EnvironmentSSAOQuality p_quality, bool p_half_size);
+ void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness);
+ void environment_set_ssao_quality(RS::EnvironmentSSAOQuality p_quality, bool p_half_size);
bool environment_is_ssao_enabled(RID p_env) const;
float environment_get_ssao_ao_affect(RID p_env) const;
float environment_get_ssao_light_affect(RID p_env) const;
bool environment_is_ssr_enabled(RID p_env) const;
- void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
+ void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) {}
void environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount) {}
@@ -848,8 +848,8 @@ public:
virtual RID camera_effects_create();
- virtual void camera_effects_set_dof_blur_quality(VS::DOFBlurQuality p_quality, bool p_use_jitter);
- virtual void camera_effects_set_dof_blur_bokeh_shape(VS::DOFBokehShape p_shape);
+ virtual void camera_effects_set_dof_blur_quality(RS::DOFBlurQuality p_quality, bool p_use_jitter);
+ virtual void camera_effects_set_dof_blur_bokeh_shape(RS::DOFBokehShape p_shape);
virtual void camera_effects_set_dof_blur(RID p_camera_effects, bool p_far_enable, float p_far_distance, float p_far_transition, bool p_near_enable, float p_near_distance, float p_near_transition, float p_amount);
virtual void camera_effects_set_custom_exposure(RID p_camera_effects, bool p_enable, float p_exposure);
@@ -940,7 +940,7 @@ public:
return li->light_index;
}
- _FORCE_INLINE_ VS::LightType light_instance_get_type(RID p_light_instance) {
+ _FORCE_INLINE_ RS::LightType light_instance_get_type(RID p_light_instance) {
LightInstance *li = light_instance_owner.getornull(p_light_instance);
return li->light_type;
}
@@ -1072,7 +1072,7 @@ public:
GIProbeQuality gi_probe_get_quality() const;
RID render_buffers_create();
- void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, VS::ViewportMSAA p_msaa);
+ void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa);
RID render_buffers_get_ao_texture(RID p_render_buffers);
RID render_buffers_get_back_buffer_texture(RID p_render_buffers);
@@ -1097,8 +1097,8 @@ public:
virtual void update();
- virtual void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw);
- _FORCE_INLINE_ VS::ViewportDebugDraw get_debug_draw_mode() const { return debug_draw; }
+ virtual void set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw);
+ _FORCE_INLINE_ RS::ViewportDebugDraw get_debug_draw_mode() const { return debug_draw; }
virtual void set_time(double p_time, double p_step);
diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
index 6e7f0aac07..83af15602c 100644
--- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -31,7 +31,7 @@
#include "rasterizer_storage_rd.h"
#include "core/engine.h"
#include "core/project_settings.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
Ref<Image> RasterizerStorageRD::_validate_texture_format(const Ref<Image> &p_image, TextureToRDFormat &r_format) {
@@ -608,7 +608,7 @@ RID RasterizerStorageRD::texture_2d_create(const Ref<Image> &p_image) {
return texture_owner.make_rid(texture);
}
-RID RasterizerStorageRD::texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, VS::TextureLayeredType p_layered_type) {
+RID RasterizerStorageRD::texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type) {
return RID();
}
@@ -826,25 +826,25 @@ String RasterizerStorageRD::texture_get_path(RID p_texture) const {
return String();
}
-void RasterizerStorageRD::texture_set_detect_3d_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) {
+void RasterizerStorageRD::texture_set_detect_3d_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) {
Texture *tex = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!tex);
tex->detect_3d_callback_ud = p_userdata;
tex->detect_3d_callback = p_callback;
}
-void RasterizerStorageRD::texture_set_detect_normal_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) {
+void RasterizerStorageRD::texture_set_detect_normal_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) {
Texture *tex = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!tex);
tex->detect_normal_callback_ud = p_userdata;
tex->detect_normal_callback = p_callback;
}
-void RasterizerStorageRD::texture_set_detect_roughness_callback(RID p_texture, VS::TextureDetectRoughnessCallback p_callback, void *p_userdata) {
+void RasterizerStorageRD::texture_set_detect_roughness_callback(RID p_texture, RS::TextureDetectRoughnessCallback p_callback, void *p_userdata) {
Texture *tex = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!tex);
tex->detect_roughness_callback_ud = p_userdata;
tex->detect_roughness_callback = p_callback;
}
-void RasterizerStorageRD::texture_debug_usage(List<VS::TextureInfo> *r_info) {
+void RasterizerStorageRD::texture_debug_usage(List<RS::TextureInfo> *r_info) {
}
void RasterizerStorageRD::texture_set_proxy(RID p_proxy, RID p_base) {
@@ -1664,7 +1664,7 @@ void RasterizerStorageRD::MaterialData::update_textures(const Map<StringName, Va
RasterizerStorageRD *singleton = (RasterizerStorageRD *)RasterizerStorage::base_singleton;
#ifdef TOOLS_ENABLED
Texture *roughness_detect_texture = nullptr;
- VS::TextureDetectRoughnessChannel roughness_channel;
+ RS::TextureDetectRoughnessChannel roughness_channel;
Texture *normal_detect_texture = nullptr;
#endif
@@ -1727,7 +1727,7 @@ void RasterizerStorageRD::MaterialData::update_textures(const Map<StringName, Va
if (tex->detect_roughness_callback && (p_texture_uniforms[i].hint >= ShaderLanguage::ShaderNode::Uniform::HINT_ROUGHNESS_R || p_texture_uniforms[i].hint <= ShaderLanguage::ShaderNode::Uniform::HINT_ROUGHNESS_GRAY)) {
//find the normal texture
roughness_detect_texture = tex;
- roughness_channel = VS::TextureDetectRoughnessChannel(p_texture_uniforms[i].hint - ShaderLanguage::ShaderNode::Uniform::HINT_ROUGHNESS_R);
+ roughness_channel = RS::TextureDetectRoughnessChannel(p_texture_uniforms[i].hint - ShaderLanguage::ShaderNode::Uniform::HINT_ROUGHNESS_R);
}
#endif
@@ -1782,7 +1782,7 @@ RID RasterizerStorageRD::mesh_create() {
}
/// Returns stride
-void RasterizerStorageRD::mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_surface) {
+void RasterizerStorageRD::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
@@ -1797,67 +1797,67 @@ void RasterizerStorageRD::mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_
uint32_t stride = 0;
- for (int i = 0; i < VS::ARRAY_WEIGHTS; i++) {
+ for (int i = 0; i < RS::ARRAY_WEIGHTS; i++) {
if ((p_surface.format & (1 << i))) {
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
- if (p_surface.format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ if (p_surface.format & RS::ARRAY_FLAG_USE_2D_VERTICES) {
stride += sizeof(float) * 2;
} else {
stride += sizeof(float) * 3;
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
- if (p_surface.format & VS::ARRAY_COMPRESS_NORMAL) {
+ if (p_surface.format & RS::ARRAY_COMPRESS_NORMAL) {
stride += sizeof(int8_t) * 4;
} else {
stride += sizeof(float) * 4;
}
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
- if (p_surface.format & VS::ARRAY_COMPRESS_TANGENT) {
+ if (p_surface.format & RS::ARRAY_COMPRESS_TANGENT) {
stride += sizeof(int8_t) * 4;
} else {
stride += sizeof(float) * 4;
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
- if (p_surface.format & VS::ARRAY_COMPRESS_COLOR) {
+ if (p_surface.format & RS::ARRAY_COMPRESS_COLOR) {
stride += sizeof(int8_t) * 4;
} else {
stride += sizeof(float) * 4;
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
- if (p_surface.format & VS::ARRAY_COMPRESS_TEX_UV) {
+ if (p_surface.format & RS::ARRAY_COMPRESS_TEX_UV) {
stride += sizeof(int16_t) * 2;
} else {
stride += sizeof(float) * 2;
}
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
- if (p_surface.format & VS::ARRAY_COMPRESS_TEX_UV2) {
+ if (p_surface.format & RS::ARRAY_COMPRESS_TEX_UV2) {
stride += sizeof(int16_t) * 2;
} else {
stride += sizeof(float) * 2;
}
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
//assumed weights too
//unique format, internally 16 bits, exposed as single array for 32
@@ -1945,16 +1945,16 @@ int RasterizerStorageRD::mesh_get_blend_shape_count(RID p_mesh) const {
return mesh->blend_shape_count;
}
-void RasterizerStorageRD::mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) {
+void RasterizerStorageRD::mesh_set_blend_shape_mode(RID p_mesh, RS::BlendShapeMode p_mode) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
ERR_FAIL_INDEX((int)p_mode, 2);
mesh->blend_shape_mode = p_mode;
}
-VS::BlendShapeMode RasterizerStorageRD::mesh_get_blend_shape_mode(RID p_mesh) const {
+RS::BlendShapeMode RasterizerStorageRD::mesh_get_blend_shape_mode(RID p_mesh) const {
Mesh *mesh = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!mesh, VS::BLEND_SHAPE_MODE_NORMALIZED);
+ ERR_FAIL_COND_V(!mesh, RS::BLEND_SHAPE_MODE_NORMALIZED);
return mesh->blend_shape_mode;
}
@@ -1986,15 +1986,15 @@ RID RasterizerStorageRD::mesh_surface_get_material(RID p_mesh, int p_surface) co
return mesh->surfaces[p_surface]->material;
}
-VS::SurfaceData RasterizerStorageRD::mesh_get_surface(RID p_mesh, int p_surface) const {
+RS::SurfaceData RasterizerStorageRD::mesh_get_surface(RID p_mesh, int p_surface) const {
Mesh *mesh = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!mesh, VS::SurfaceData());
- ERR_FAIL_UNSIGNED_INDEX_V((uint32_t)p_surface, mesh->surface_count, VS::SurfaceData());
+ ERR_FAIL_COND_V(!mesh, RS::SurfaceData());
+ ERR_FAIL_UNSIGNED_INDEX_V((uint32_t)p_surface, mesh->surface_count, RS::SurfaceData());
Mesh::Surface &s = *mesh->surfaces[p_surface];
- VS::SurfaceData sd;
+ RS::SurfaceData sd;
sd.format = s.format;
sd.vertex_data = RD::get_singleton()->buffer_get_data(s.vertex_buffer);
sd.vertex_count = s.vertex_count;
@@ -2006,7 +2006,7 @@ VS::SurfaceData RasterizerStorageRD::mesh_get_surface(RID p_mesh, int p_surface)
}
sd.aabb = s.aabb;
for (uint32_t i = 0; i < s.lod_count; i++) {
- VS::SurfaceData::LOD lod;
+ RS::SurfaceData::LOD lod;
lod.edge_length = s.lods[i].edge_length;
lod.index_data = RD::get_singleton()->buffer_get_data(s.lods[i].index_buffer);
sd.lods.push_back(lod);
@@ -2058,7 +2058,7 @@ AABB RasterizerStorageRD::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
for (uint32_t i = 0; i < mesh->surface_count; i++) {
AABB laabb;
- if ((mesh->surfaces[i]->format & VS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->bone_aabbs.size()) {
+ if ((mesh->surfaces[i]->format & RS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->bone_aabbs.size()) {
int bs = mesh->surfaces[i]->bone_aabbs.size();
const AABB *skbones = mesh->surfaces[i]->bone_aabbs.ptr();
@@ -2201,7 +2201,7 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
uint32_t stride = 0;
- for (int i = 0; i < VS::ARRAY_WEIGHTS; i++) {
+ for (int i = 0; i < RS::ARRAY_WEIGHTS; i++) {
RD::VertexDescription vd;
RID buffer;
@@ -2212,33 +2212,33 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
buffer = mesh_default_rd_buffers[i];
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
vd.format = RD::DATA_FORMAT_R32G32B32_SFLOAT;
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
vd.format = RD::DATA_FORMAT_R32G32B32_SFLOAT;
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
vd.format = RD::DATA_FORMAT_R32G32B32A32_SFLOAT;
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
vd.format = RD::DATA_FORMAT_R32G32B32A32_SFLOAT;
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
vd.format = RD::DATA_FORMAT_R32G32_SFLOAT;
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
vd.format = RD::DATA_FORMAT_R32G32_SFLOAT;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
//assumed weights too
vd.format = RD::DATA_FORMAT_R32G32B32A32_UINT;
@@ -2253,9 +2253,9 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
- if (s->format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ if (s->format & RS::ARRAY_FLAG_USE_2D_VERTICES) {
vd.format = RD::DATA_FORMAT_R32G32_SFLOAT;
stride += sizeof(float) * 2;
} else {
@@ -2264,9 +2264,9 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
- if (s->format & VS::ARRAY_COMPRESS_NORMAL) {
+ if (s->format & RS::ARRAY_COMPRESS_NORMAL) {
vd.format = RD::DATA_FORMAT_R8G8B8A8_SNORM;
stride += sizeof(int8_t) * 4;
} else {
@@ -2275,9 +2275,9 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
}
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
- if (s->format & VS::ARRAY_COMPRESS_TANGENT) {
+ if (s->format & RS::ARRAY_COMPRESS_TANGENT) {
vd.format = RD::DATA_FORMAT_R8G8B8A8_SNORM;
stride += sizeof(int8_t) * 4;
} else {
@@ -2286,9 +2286,9 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
- if (s->format & VS::ARRAY_COMPRESS_COLOR) {
+ if (s->format & RS::ARRAY_COMPRESS_COLOR) {
vd.format = RD::DATA_FORMAT_R8G8B8A8_UNORM;
stride += sizeof(int8_t) * 4;
} else {
@@ -2297,9 +2297,9 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
- if (s->format & VS::ARRAY_COMPRESS_TEX_UV) {
+ if (s->format & RS::ARRAY_COMPRESS_TEX_UV) {
vd.format = RD::DATA_FORMAT_R16G16_SFLOAT;
stride += sizeof(int16_t) * 2;
} else {
@@ -2308,9 +2308,9 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
}
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
- if (s->format & VS::ARRAY_COMPRESS_TEX_UV2) {
+ if (s->format & RS::ARRAY_COMPRESS_TEX_UV2) {
vd.format = RD::DATA_FORMAT_R16G16_SFLOAT;
stride += sizeof(int16_t) * 2;
} else {
@@ -2319,7 +2319,7 @@ void RasterizerStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Su
}
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
//assumed weights too
//unique format, internally 16 bits, exposed as single array for 32
@@ -2358,7 +2358,7 @@ RID RasterizerStorageRD::multimesh_create() {
return multimesh_owner.make_rid(MultiMesh());
}
-void RasterizerStorageRD::multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, bool p_use_colors, bool p_use_custom_data) {
+void RasterizerStorageRD::multimesh_allocate(RID p_multimesh, int p_instances, RS::MultimeshTransformFormat p_transform_format, bool p_use_colors, bool p_use_custom_data) {
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
@@ -2382,13 +2382,13 @@ void RasterizerStorageRD::multimesh_allocate(RID p_multimesh, int p_instances, V
multimesh->instances = p_instances;
multimesh->xform_format = p_transform_format;
multimesh->uses_colors = p_use_colors;
- multimesh->color_offset_cache = p_transform_format == VS::MULTIMESH_TRANSFORM_2D ? 8 : 12;
+ multimesh->color_offset_cache = p_transform_format == RS::MULTIMESH_TRANSFORM_2D ? 8 : 12;
multimesh->uses_custom_data = p_use_custom_data;
multimesh->custom_data_offset_cache = multimesh->color_offset_cache + (p_use_colors ? 4 : 0);
multimesh->stride_cache = multimesh->custom_data_offset_cache + (p_use_custom_data ? 4 : 0);
multimesh->buffer_set = false;
- //print_line("allocate, elements: " + itos(p_instances) + " 2D: " + itos(p_transform_format == VS::MULTIMESH_TRANSFORM_2D) + " colors " + itos(multimesh->uses_colors) + " data " + itos(multimesh->uses_custom_data) + " stride " + itos(multimesh->stride_cache) + " total size " + itos(multimesh->stride_cache * multimesh->instances));
+ //print_line("allocate, elements: " + itos(p_instances) + " 2D: " + itos(p_transform_format == RS::MULTIMESH_TRANSFORM_2D) + " colors " + itos(multimesh->uses_colors) + " data " + itos(multimesh->uses_custom_data) + " stride " + itos(multimesh->stride_cache) + " total size " + itos(multimesh->stride_cache * multimesh->instances));
multimesh->data_cache = Vector<float>();
multimesh->aabb = AABB();
multimesh->aabb_dirty = false;
@@ -2521,7 +2521,7 @@ void RasterizerStorageRD::_multimesh_re_create_aabb(MultiMesh *multimesh, const
const float *data = p_data + multimesh->stride_cache * i;
Transform t;
- if (multimesh->xform_format == VS::MULTIMESH_TRANSFORM_3D) {
+ if (multimesh->xform_format == RS::MULTIMESH_TRANSFORM_3D) {
t.basis.elements[0][0] = data[0];
t.basis.elements[0][1] = data[1];
@@ -2562,7 +2562,7 @@ void RasterizerStorageRD::multimesh_instance_set_transform(RID p_multimesh, int
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->instances);
- ERR_FAIL_COND(multimesh->xform_format != VS::MULTIMESH_TRANSFORM_3D);
+ ERR_FAIL_COND(multimesh->xform_format != RS::MULTIMESH_TRANSFORM_3D);
_multimesh_make_local(multimesh);
@@ -2593,7 +2593,7 @@ void RasterizerStorageRD::multimesh_instance_set_transform_2d(RID p_multimesh, i
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->instances);
- ERR_FAIL_COND(multimesh->xform_format != VS::MULTIMESH_TRANSFORM_2D);
+ ERR_FAIL_COND(multimesh->xform_format != RS::MULTIMESH_TRANSFORM_2D);
_multimesh_make_local(multimesh);
@@ -2671,7 +2671,7 @@ Transform RasterizerStorageRD::multimesh_instance_get_transform(RID p_multimesh,
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Transform());
ERR_FAIL_INDEX_V(p_index, multimesh->instances, Transform());
- ERR_FAIL_COND_V(multimesh->xform_format != VS::MULTIMESH_TRANSFORM_3D, Transform());
+ ERR_FAIL_COND_V(multimesh->xform_format != RS::MULTIMESH_TRANSFORM_3D, Transform());
_multimesh_make_local(multimesh);
@@ -2702,7 +2702,7 @@ Transform2D RasterizerStorageRD::multimesh_instance_get_transform_2d(RID p_multi
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Transform2D());
ERR_FAIL_INDEX_V(p_index, multimesh->instances, Transform2D());
- ERR_FAIL_COND_V(multimesh->xform_format != VS::MULTIMESH_TRANSFORM_2D, Transform2D());
+ ERR_FAIL_COND_V(multimesh->xform_format != RS::MULTIMESH_TRANSFORM_2D, Transform2D());
_multimesh_make_local(multimesh);
@@ -3094,24 +3094,24 @@ void RasterizerStorageRD::_update_dirty_skeletons() {
/* LIGHT */
-RID RasterizerStorageRD::light_create(VS::LightType p_type) {
+RID RasterizerStorageRD::light_create(RS::LightType p_type) {
Light light;
light.type = p_type;
- light.param[VS::LIGHT_PARAM_ENERGY] = 1.0;
- light.param[VS::LIGHT_PARAM_INDIRECT_ENERGY] = 1.0;
- light.param[VS::LIGHT_PARAM_SPECULAR] = 0.5;
- light.param[VS::LIGHT_PARAM_RANGE] = 1.0;
- light.param[VS::LIGHT_PARAM_SPOT_ANGLE] = 45;
- light.param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE] = 45;
- light.param[VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE] = 0;
- light.param[VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET] = 0.1;
- light.param[VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET] = 0.3;
- light.param[VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET] = 0.6;
- light.param[VS::LIGHT_PARAM_SHADOW_FADE_START] = 0.8;
- light.param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] = 0.1;
- light.param[VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE] = 0.1;
+ light.param[RS::LIGHT_PARAM_ENERGY] = 1.0;
+ light.param[RS::LIGHT_PARAM_INDIRECT_ENERGY] = 1.0;
+ light.param[RS::LIGHT_PARAM_SPECULAR] = 0.5;
+ light.param[RS::LIGHT_PARAM_RANGE] = 1.0;
+ light.param[RS::LIGHT_PARAM_SPOT_ANGLE] = 45;
+ light.param[RS::LIGHT_PARAM_CONTACT_SHADOW_SIZE] = 45;
+ light.param[RS::LIGHT_PARAM_SHADOW_MAX_DISTANCE] = 0;
+ light.param[RS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET] = 0.1;
+ light.param[RS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET] = 0.3;
+ light.param[RS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET] = 0.6;
+ light.param[RS::LIGHT_PARAM_SHADOW_FADE_START] = 0.8;
+ light.param[RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] = 0.1;
+ light.param[RS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE] = 0.1;
return light_owner.make_rid(light);
}
@@ -3123,21 +3123,21 @@ void RasterizerStorageRD::light_set_color(RID p_light, const Color &p_color) {
light->color = p_color;
}
-void RasterizerStorageRD::light_set_param(RID p_light, VS::LightParam p_param, float p_value) {
+void RasterizerStorageRD::light_set_param(RID p_light, RS::LightParam p_param, float p_value) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
- ERR_FAIL_INDEX(p_param, VS::LIGHT_PARAM_MAX);
+ ERR_FAIL_INDEX(p_param, RS::LIGHT_PARAM_MAX);
switch (p_param) {
- case VS::LIGHT_PARAM_RANGE:
- case VS::LIGHT_PARAM_SPOT_ANGLE:
- case VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE:
- case VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET:
- case VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET:
- case VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET:
- case VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS:
- case VS::LIGHT_PARAM_SHADOW_BIAS: {
+ case RS::LIGHT_PARAM_RANGE:
+ case RS::LIGHT_PARAM_SPOT_ANGLE:
+ case RS::LIGHT_PARAM_SHADOW_MAX_DISTANCE:
+ case RS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET:
+ case RS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET:
+ case RS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET:
+ case RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS:
+ case RS::LIGHT_PARAM_SHADOW_BIAS: {
light->version++;
light->instance_dependency.instance_notify_changed(true, false);
@@ -3211,7 +3211,7 @@ void RasterizerStorageRD::light_set_use_gi(RID p_light, bool p_enabled) {
light->version++;
light->instance_dependency.instance_notify_changed(true, false);
}
-void RasterizerStorageRD::light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {
+void RasterizerStorageRD::light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
@@ -3222,15 +3222,15 @@ void RasterizerStorageRD::light_omni_set_shadow_mode(RID p_light, VS::LightOmniS
light->instance_dependency.instance_notify_changed(true, false);
}
-VS::LightOmniShadowMode RasterizerStorageRD::light_omni_get_shadow_mode(RID p_light) {
+RS::LightOmniShadowMode RasterizerStorageRD::light_omni_get_shadow_mode(RID p_light) {
const Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_OMNI_SHADOW_CUBE);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_OMNI_SHADOW_CUBE);
return light->omni_shadow_mode;
}
-void RasterizerStorageRD::light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) {
+void RasterizerStorageRD::light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
@@ -3258,15 +3258,15 @@ bool RasterizerStorageRD::light_directional_get_blend_splits(RID p_light) const
return light->directional_blend_splits;
}
-VS::LightDirectionalShadowMode RasterizerStorageRD::light_directional_get_shadow_mode(RID p_light) {
+RS::LightDirectionalShadowMode RasterizerStorageRD::light_directional_get_shadow_mode(RID p_light) {
const Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL);
return light->directional_shadow_mode;
}
-void RasterizerStorageRD::light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode) {
+void RasterizerStorageRD::light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) {
Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND(!light);
@@ -3274,10 +3274,10 @@ void RasterizerStorageRD::light_directional_set_shadow_depth_range_mode(RID p_li
light->directional_range_mode = p_range_mode;
}
-VS::LightDirectionalShadowDepthRangeMode RasterizerStorageRD::light_directional_get_shadow_depth_range_mode(RID p_light) const {
+RS::LightDirectionalShadowDepthRangeMode RasterizerStorageRD::light_directional_get_shadow_depth_range_mode(RID p_light) const {
const Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE);
return light->directional_range_mode;
}
@@ -3304,18 +3304,18 @@ AABB RasterizerStorageRD::light_get_aabb(RID p_light) const {
switch (light->type) {
- case VS::LIGHT_SPOT: {
+ case RS::LIGHT_SPOT: {
- float len = light->param[VS::LIGHT_PARAM_RANGE];
- float size = Math::tan(Math::deg2rad(light->param[VS::LIGHT_PARAM_SPOT_ANGLE])) * len;
+ float len = light->param[RS::LIGHT_PARAM_RANGE];
+ float size = Math::tan(Math::deg2rad(light->param[RS::LIGHT_PARAM_SPOT_ANGLE])) * len;
return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
};
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_OMNI: {
- float r = light->param[VS::LIGHT_PARAM_RANGE];
+ float r = light->param[RS::LIGHT_PARAM_RANGE];
return AABB(-Vector3(r, r, r), Vector3(r, r, r) * 2);
};
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
return AABB();
};
@@ -3331,7 +3331,7 @@ RID RasterizerStorageRD::reflection_probe_create() {
return reflection_probe_owner.make_rid(ReflectionProbe());
}
-void RasterizerStorageRD::reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode) {
+void RasterizerStorageRD::reflection_probe_set_update_mode(RID p_probe, RS::ReflectionProbeUpdateMode p_mode) {
ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
ERR_FAIL_COND(!reflection_probe);
@@ -3450,10 +3450,10 @@ AABB RasterizerStorageRD::reflection_probe_get_aabb(RID p_probe) const {
return aabb;
}
-VS::ReflectionProbeUpdateMode RasterizerStorageRD::reflection_probe_get_update_mode(RID p_probe) const {
+RS::ReflectionProbeUpdateMode RasterizerStorageRD::reflection_probe_get_update_mode(RID p_probe) const {
const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
- ERR_FAIL_COND_V(!reflection_probe, VS::REFLECTION_PROBE_UPDATE_ALWAYS);
+ ERR_FAIL_COND_V(!reflection_probe, RS::REFLECTION_PROBE_UPDATE_ALWAYS);
return reflection_probe->update_mode;
}
@@ -4266,25 +4266,25 @@ void RasterizerStorageRD::skeleton_update_dependency(RID p_skeleton, RasterizerS
p_instance->update_dependency(&skeleton->instance_dependency);
}
-VS::InstanceType RasterizerStorageRD::get_base_type(RID p_rid) const {
+RS::InstanceType RasterizerStorageRD::get_base_type(RID p_rid) const {
if (mesh_owner.owns(p_rid)) {
- return VS::INSTANCE_MESH;
+ return RS::INSTANCE_MESH;
}
if (multimesh_owner.owns(p_rid)) {
- return VS::INSTANCE_MULTIMESH;
+ return RS::INSTANCE_MULTIMESH;
}
if (reflection_probe_owner.owns(p_rid)) {
- return VS::INSTANCE_REFLECTION_PROBE;
+ return RS::INSTANCE_REFLECTION_PROBE;
}
if (gi_probe_owner.owns(p_rid)) {
- return VS::INSTANCE_GI_PROBE;
+ return RS::INSTANCE_GI_PROBE;
}
if (light_owner.owns(p_rid)) {
- return VS::INSTANCE_LIGHT;
+ return RS::INSTANCE_LIGHT;
}
- return VS::INSTANCE_NONE;
+ return RS::INSTANCE_NONE;
}
void RasterizerStorageRD::update_dirty_resources() {
_update_queued_materials();
@@ -4374,7 +4374,7 @@ bool RasterizerStorageRD::free(RID p_rid) {
mesh_owner.free(p_rid);
} else if (multimesh_owner.owns(p_rid)) {
_update_dirty_multimeshes();
- multimesh_allocate(p_rid, 0, VS::MULTIMESH_TRANSFORM_2D);
+ multimesh_allocate(p_rid, 0, RS::MULTIMESH_TRANSFORM_2D);
MultiMesh *multimesh = multimesh_owner.getornull(p_rid);
multimesh->instance_dependency.instance_notify_deleted(p_rid);
multimesh_owner.free(p_rid);
@@ -4612,40 +4612,40 @@ RasterizerStorageRD::RasterizerStorageRD() {
}
//default samplers
- for (int i = 1; i < VS::CANVAS_ITEM_TEXTURE_FILTER_MAX; i++) {
- for (int j = 1; j < VS::CANVAS_ITEM_TEXTURE_REPEAT_MAX; j++) {
+ for (int i = 1; i < RS::CANVAS_ITEM_TEXTURE_FILTER_MAX; i++) {
+ for (int j = 1; j < RS::CANVAS_ITEM_TEXTURE_REPEAT_MAX; j++) {
RD::SamplerState sampler_state;
switch (i) {
- case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST: {
+ case RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_NEAREST;
sampler_state.min_filter = RD::SAMPLER_FILTER_NEAREST;
sampler_state.max_lod = 0;
} break;
- case VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR: {
+ case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.max_lod = 0;
} break;
- case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: {
+ case RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_NEAREST;
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR;
} break;
- case VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: {
+ case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR;
} break;
- case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: {
+ case RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_NEAREST;
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.use_anisotropy = true;
sampler_state.anisotropy_max = GLOBAL_GET("rendering/quality/filters/max_anisotropy");
} break;
- case VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: {
+ case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR;
@@ -4657,17 +4657,17 @@ RasterizerStorageRD::RasterizerStorageRD() {
}
}
switch (j) {
- case VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED: {
+ case RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED: {
sampler_state.repeat_u = RD::SAMPLER_REPEAT_MODE_CLAMP_TO_EDGE;
sampler_state.repeat_v = RD::SAMPLER_REPEAT_MODE_CLAMP_TO_EDGE;
} break;
- case VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED: {
+ case RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED: {
sampler_state.repeat_u = RD::SAMPLER_REPEAT_MODE_REPEAT;
sampler_state.repeat_v = RD::SAMPLER_REPEAT_MODE_REPEAT;
} break;
- case VS::CANVAS_ITEM_TEXTURE_REPEAT_MIRROR: {
+ case RS::CANVAS_ITEM_TEXTURE_REPEAT_MIRROR: {
sampler_state.repeat_u = RD::SAMPLER_REPEAT_MODE_MIRRORED_REPEAT;
sampler_state.repeat_v = RD::SAMPLER_REPEAT_MODE_MIRRORED_REPEAT;
} break;
@@ -4808,8 +4808,8 @@ RasterizerStorageRD::~RasterizerStorageRD() {
}
//def samplers
- for (int i = 1; i < VS::CANVAS_ITEM_TEXTURE_FILTER_MAX; i++) {
- for (int j = 1; j < VS::CANVAS_ITEM_TEXTURE_REPEAT_MAX; j++) {
+ for (int i = 1; i < RS::CANVAS_ITEM_TEXTURE_FILTER_MAX; i++) {
+ for (int j = 1; j < RS::CANVAS_ITEM_TEXTURE_REPEAT_MAX; j++) {
RD::get_singleton()->free(default_rd_samplers[i][j]);
}
}
diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.h b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.h
index 410cd4adb4..e69be644d7 100644
--- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.h
+++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.h
@@ -32,11 +32,11 @@
#define RASTERIZER_STORAGE_RD_H
#include "core/rid_owner.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual/rasterizer_rd/rasterizer_effects_rd.h"
-#include "servers/visual/rasterizer_rd/shader_compiler_rd.h"
-#include "servers/visual/rasterizer_rd/shaders/giprobe_sdf.glsl.gen.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering/rasterizer_rd/rasterizer_effects_rd.h"
+#include "servers/rendering/rasterizer_rd/shader_compiler_rd.h"
+#include "servers/rendering/rasterizer_rd/shaders/giprobe_sdf.glsl.gen.h"
+#include "servers/rendering/rendering_device.h"
class RasterizerStorageRD : public RasterizerStorage {
public:
@@ -138,13 +138,13 @@ private:
RID proxy_to;
Vector<RID> proxies;
- VS::TextureDetectCallback detect_3d_callback = nullptr;
+ RS::TextureDetectCallback detect_3d_callback = nullptr;
void *detect_3d_callback_ud = nullptr;
- VS::TextureDetectCallback detect_normal_callback = nullptr;
+ RS::TextureDetectCallback detect_normal_callback = nullptr;
void *detect_normal_callback_ud = nullptr;
- VS::TextureDetectRoughnessCallback detect_roughness_callback = nullptr;
+ RS::TextureDetectRoughnessCallback detect_roughness_callback = nullptr;
void *detect_roughness_callback_ud = nullptr;
};
@@ -171,7 +171,7 @@ private:
Ref<Image> _validate_texture_format(const Ref<Image> &p_image, TextureToRDFormat &r_format);
RID default_rd_textures[DEFAULT_RD_TEXTURE_MAX];
- RID default_rd_samplers[VS::CANVAS_ITEM_TEXTURE_FILTER_MAX][VS::CANVAS_ITEM_TEXTURE_REPEAT_MAX];
+ RID default_rd_samplers[RS::CANVAS_ITEM_TEXTURE_FILTER_MAX][RS::CANVAS_ITEM_TEXTURE_REPEAT_MAX];
/* SHADER */
@@ -218,7 +218,7 @@ private:
struct Mesh {
struct Surface {
- VS::PrimitiveType primitive;
+ RS::PrimitiveType primitive;
uint32_t format = 0;
RID vertex_buffer;
@@ -271,7 +271,7 @@ private:
};
uint32_t blend_shape_count = 0;
- VS::BlendShapeMode blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED;
+ RS::BlendShapeMode blend_shape_mode = RS::BLEND_SHAPE_MODE_NORMALIZED;
Surface **surfaces = nullptr;
uint32_t surface_count = 0;
@@ -296,7 +296,7 @@ private:
struct MultiMesh {
RID mesh;
int instances = 0;
- VS::MultimeshTransformFormat xform_format = VS::MULTIMESH_TRANSFORM_3D;
+ RS::MultimeshTransformFormat xform_format = RS::MULTIMESH_TRANSFORM_3D;
bool uses_colors = false;
bool uses_custom_data = false;
int visible_instances = -1;
@@ -359,8 +359,8 @@ private:
struct Light {
- VS::LightType type;
- float param[VS::LIGHT_PARAM_MAX];
+ RS::LightType type;
+ float param[RS::LIGHT_PARAM_MAX];
Color color = Color(1, 1, 1, 1);
Color shadow_color;
RID projector;
@@ -369,9 +369,9 @@ private:
bool reverse_cull = false;
bool use_gi = true;
uint32_t cull_mask = 0xFFFFFFFF;
- VS::LightOmniShadowMode omni_shadow_mode = VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID;
- VS::LightDirectionalShadowMode directional_shadow_mode = VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL;
- VS::LightDirectionalShadowDepthRangeMode directional_range_mode = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE;
+ RS::LightOmniShadowMode omni_shadow_mode = RS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID;
+ RS::LightDirectionalShadowMode directional_shadow_mode = RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL;
+ RS::LightDirectionalShadowDepthRangeMode directional_range_mode = RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE;
bool directional_blend_splits = false;
uint64_t version = 0;
@@ -384,7 +384,7 @@ private:
struct ReflectionProbe {
- VS::ReflectionProbeUpdateMode update_mode = VS::REFLECTION_PROBE_UPDATE_ONCE;
+ RS::ReflectionProbeUpdateMode update_mode = RS::REFLECTION_PROBE_UPDATE_ONCE;
int resolution = 256;
float intensity = 1.0;
Color interior_ambient;
@@ -498,7 +498,7 @@ public:
/* TEXTURE API */
virtual RID texture_2d_create(const Ref<Image> &p_image);
- virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, VS::TextureLayeredType p_layered_type);
+ virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type);
virtual RID texture_3d_create(const Vector<Ref<Image>> &p_slices); //all slices, then all the mipmaps, must be coherent
virtual RID texture_proxy_create(RID p_base);
@@ -524,11 +524,11 @@ public:
virtual void texture_set_path(RID p_texture, const String &p_path);
virtual String texture_get_path(RID p_texture) const;
- virtual void texture_set_detect_3d_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata);
- virtual void texture_set_detect_normal_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata);
- virtual void texture_set_detect_roughness_callback(RID p_texture, VS::TextureDetectRoughnessCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_3d_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_normal_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata);
+ virtual void texture_set_detect_roughness_callback(RID p_texture, RS::TextureDetectRoughnessCallback p_callback, void *p_userdata);
- virtual void texture_debug_usage(List<VS::TextureInfo> *r_info);
+ virtual void texture_debug_usage(List<RS::TextureInfo> *r_info);
virtual void texture_set_proxy(RID p_proxy, RID p_base);
virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable);
@@ -564,7 +564,7 @@ public:
_FORCE_INLINE_ RID texture_rd_get_default(DefaultRDTexture p_texture) {
return default_rd_textures[p_texture];
}
- _FORCE_INLINE_ RID sampler_rd_get_default(VS::CanvasItemTextureFilter p_filter, VS::CanvasItemTextureRepeat p_repeat) {
+ _FORCE_INLINE_ RID sampler_rd_get_default(RS::CanvasItemTextureFilter p_filter, RS::CanvasItemTextureRepeat p_repeat) {
return default_rd_samplers[p_filter][p_repeat];
}
@@ -615,19 +615,19 @@ public:
virtual RID mesh_create();
/// Return stride
- virtual void mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_surface);
+ virtual void mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface);
virtual int mesh_get_blend_shape_count(RID p_mesh) const;
- virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode);
- virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const;
+ virtual void mesh_set_blend_shape_mode(RID p_mesh, RS::BlendShapeMode p_mode);
+ virtual RS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const;
virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const Vector<uint8_t> &p_data);
virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material);
virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const;
- virtual VS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const;
+ virtual RS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const;
virtual int mesh_get_surface_count(RID p_mesh) const;
@@ -655,10 +655,10 @@ public:
return mesh->material_cache.ptr();
}
- _FORCE_INLINE_ VS::PrimitiveType mesh_surface_get_primitive(RID p_mesh, uint32_t p_surface_index) {
+ _FORCE_INLINE_ RS::PrimitiveType mesh_surface_get_primitive(RID p_mesh, uint32_t p_surface_index) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
- ERR_FAIL_COND_V(!mesh, VS::PRIMITIVE_MAX);
- ERR_FAIL_UNSIGNED_INDEX_V(p_surface_index, mesh->surface_count, VS::PRIMITIVE_MAX);
+ ERR_FAIL_COND_V(!mesh, RS::PRIMITIVE_MAX);
+ ERR_FAIL_UNSIGNED_INDEX_V(p_surface_index, mesh->surface_count, RS::PRIMITIVE_MAX);
return mesh->surfaces[p_surface_index]->primitive;
}
@@ -732,7 +732,7 @@ public:
RID multimesh_create();
- void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false);
+ void multimesh_allocate(RID p_multimesh, int p_instances, RS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false);
int multimesh_get_instance_count(RID p_multimesh) const;
void multimesh_set_mesh(RID p_multimesh, RID p_mesh);
@@ -756,7 +756,7 @@ public:
AABB multimesh_get_aabb(RID p_multimesh) const;
- _FORCE_INLINE_ VS::MultimeshTransformFormat multimesh_get_transform_format(RID p_multimesh) const {
+ _FORCE_INLINE_ RS::MultimeshTransformFormat multimesh_get_transform_format(RID p_multimesh) const {
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
return multimesh->xform_format;
}
@@ -797,7 +797,7 @@ public:
/* IMMEDIATE API */
RID immediate_create() { return RID(); }
- void immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture = RID()) {}
+ void immediate_begin(RID p_immediate, RS::PrimitiveType p_rimitive, RID p_texture = RID()) {}
void immediate_vertex(RID p_immediate, const Vector3 &p_vertex) {}
void immediate_normal(RID p_immediate, const Vector3 &p_normal) {}
void immediate_tangent(RID p_immediate, const Plane &p_tangent) {}
@@ -843,14 +843,14 @@ public:
}
/* Light API */
- RID light_create(VS::LightType p_type);
+ RID light_create(RS::LightType p_type);
- RID directional_light_create() { return light_create(VS::LIGHT_DIRECTIONAL); }
- RID omni_light_create() { return light_create(VS::LIGHT_OMNI); }
- RID spot_light_create() { return light_create(VS::LIGHT_SPOT); }
+ RID directional_light_create() { return light_create(RS::LIGHT_DIRECTIONAL); }
+ RID omni_light_create() { return light_create(RS::LIGHT_OMNI); }
+ RID spot_light_create() { return light_create(RS::LIGHT_SPOT); }
void light_set_color(RID p_light, const Color &p_color);
- void light_set_param(RID p_light, VS::LightParam p_param, float p_value);
+ void light_set_param(RID p_light, RS::LightParam p_param, float p_value);
void light_set_shadow(RID p_light, bool p_enabled);
void light_set_shadow_color(RID p_light, const Color &p_color);
void light_set_projector(RID p_light, RID p_texture);
@@ -859,26 +859,26 @@ public:
void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled);
void light_set_use_gi(RID p_light, bool p_enabled);
- void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode);
+ void light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode);
- void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode);
+ void light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode);
void light_directional_set_blend_splits(RID p_light, bool p_enable);
bool light_directional_get_blend_splits(RID p_light) const;
- void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode);
- VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const;
+ void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode);
+ RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const;
- VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light);
- VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light);
+ RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light);
+ RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light);
- _FORCE_INLINE_ VS::LightType light_get_type(RID p_light) const {
+ _FORCE_INLINE_ RS::LightType light_get_type(RID p_light) const {
const Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
return light->type;
}
AABB light_get_aabb(RID p_light) const;
- _FORCE_INLINE_ float light_get_param(RID p_light, VS::LightParam p_param) {
+ _FORCE_INLINE_ float light_get_param(RID p_light, RS::LightParam p_param) {
const Light *light = light_owner.getornull(p_light);
ERR_FAIL_COND_V(!light, 0);
@@ -913,7 +913,7 @@ public:
_FORCE_INLINE_ bool light_has_shadow(RID p_light) const {
const Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
return light->shadow;
}
@@ -921,7 +921,7 @@ public:
_FORCE_INLINE_ bool light_is_negative(RID p_light) const {
const Light *light = light_owner.getornull(p_light);
- ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL);
+ ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL);
return light->negative;
}
@@ -933,7 +933,7 @@ public:
RID reflection_probe_create();
- void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode);
+ void reflection_probe_set_update_mode(RID p_probe, RS::ReflectionProbeUpdateMode p_mode);
void reflection_probe_set_intensity(RID p_probe, float p_intensity);
void reflection_probe_set_interior_ambient(RID p_probe, const Color &p_ambient);
void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy);
@@ -948,7 +948,7 @@ public:
void reflection_probe_set_resolution(RID p_probe, int p_resolution);
AABB reflection_probe_get_aabb(RID p_probe) const;
- VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const;
+ RS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const;
uint32_t reflection_probe_get_cull_mask(RID p_probe) const;
Vector3 reflection_probe_get_extents(RID p_probe) const;
Vector3 reflection_probe_get_origin_offset(RID p_probe) const;
@@ -1059,7 +1059,7 @@ public:
void particles_set_fractional_delta(RID p_particles, bool p_enable) {}
void particles_restart(RID p_particles) {}
- void particles_set_draw_order(RID p_particles, VS::ParticlesDrawOrder p_order) {}
+ void particles_set_draw_order(RID p_particles, RS::ParticlesDrawOrder p_order) {}
void particles_set_draw_passes(RID p_particles, int p_count) {}
void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) {}
@@ -1098,7 +1098,7 @@ public:
Size2 render_target_get_size(RID p_render_target);
RID render_target_get_rd_framebuffer(RID p_render_target);
- VS::InstanceType get_base_type(RID p_rid) const;
+ RS::InstanceType get_base_type(RID p_rid) const;
bool free(RID p_rid);
@@ -1110,9 +1110,9 @@ public:
void render_info_begin_capture() {}
void render_info_end_capture() {}
- int get_captured_render_info(VS::RenderInfo p_info) { return 0; }
+ int get_captured_render_info(RS::RenderInfo p_info) { return 0; }
- int get_render_info(VS::RenderInfo p_info) { return 0; }
+ int get_render_info(RS::RenderInfo p_info) { return 0; }
String get_video_adapter_name() const { return String(); }
String get_video_adapter_vendor() const { return String(); }
diff --git a/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.cpp b/servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.cpp
index 4ee020aa69..4ee020aa69 100644
--- a/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.cpp
+++ b/servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.cpp
diff --git a/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h b/servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h
index 05c5968360..ecb1b42b06 100644
--- a/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h
+++ b/servers/rendering/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h
@@ -32,7 +32,7 @@
#define RENDER_PIPELINE_CACHE_RD_H
#include "core/spin_lock.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rendering_device.h"
class RenderPipelineVertexFormatCacheRD {
diff --git a/servers/visual/rasterizer_rd/shader_compiler_rd.cpp b/servers/rendering/rasterizer_rd/shader_compiler_rd.cpp
index ecff8d81f6..b3a4b0ede8 100644
--- a/servers/visual/rasterizer_rd/shader_compiler_rd.cpp
+++ b/servers/rendering/rasterizer_rd/shader_compiler_rd.cpp
@@ -1037,7 +1037,7 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge
return code;
}
-Error ShaderCompilerRD::compile(VS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code) {
+Error ShaderCompilerRD::compile(RS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code) {
Error err = parser.compile(p_code, ShaderTypes::get_singleton()->get_functions(p_mode), ShaderTypes::get_singleton()->get_modes(p_mode), ShaderTypes::get_singleton()->get_types());
@@ -1099,145 +1099,145 @@ ShaderCompilerRD::ShaderCompilerRD() {
/** SPATIAL SHADER **/
- actions[VS::SHADER_SPATIAL].renames["WORLD_MATRIX"] = "world_transform";
- actions[VS::SHADER_SPATIAL].renames["INV_CAMERA_MATRIX"] = "camera_inverse_matrix";
- actions[VS::SHADER_SPATIAL].renames["CAMERA_MATRIX"] = "camera_matrix";
- actions[VS::SHADER_SPATIAL].renames["PROJECTION_MATRIX"] = "projection_matrix";
- actions[VS::SHADER_SPATIAL].renames["INV_PROJECTION_MATRIX"] = "inv_projection_matrix";
- actions[VS::SHADER_SPATIAL].renames["MODELVIEW_MATRIX"] = "modelview";
-
- actions[VS::SHADER_SPATIAL].renames["VERTEX"] = "vertex.xyz";
- actions[VS::SHADER_SPATIAL].renames["NORMAL"] = "normal";
- actions[VS::SHADER_SPATIAL].renames["TANGENT"] = "tangent";
- actions[VS::SHADER_SPATIAL].renames["BINORMAL"] = "binormal";
- actions[VS::SHADER_SPATIAL].renames["POSITION"] = "position";
- actions[VS::SHADER_SPATIAL].renames["UV"] = "uv_interp";
- actions[VS::SHADER_SPATIAL].renames["UV2"] = "uv2_interp";
- actions[VS::SHADER_SPATIAL].renames["COLOR"] = "color_interp";
- actions[VS::SHADER_SPATIAL].renames["POINT_SIZE"] = "gl_PointSize";
- actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "gl_InstanceID";
+ actions[RS::SHADER_SPATIAL].renames["WORLD_MATRIX"] = "world_transform";
+ actions[RS::SHADER_SPATIAL].renames["INV_CAMERA_MATRIX"] = "camera_inverse_matrix";
+ actions[RS::SHADER_SPATIAL].renames["CAMERA_MATRIX"] = "camera_matrix";
+ actions[RS::SHADER_SPATIAL].renames["PROJECTION_MATRIX"] = "projection_matrix";
+ actions[RS::SHADER_SPATIAL].renames["INV_PROJECTION_MATRIX"] = "inv_projection_matrix";
+ actions[RS::SHADER_SPATIAL].renames["MODELVIEW_MATRIX"] = "modelview";
+
+ actions[RS::SHADER_SPATIAL].renames["VERTEX"] = "vertex.xyz";
+ actions[RS::SHADER_SPATIAL].renames["NORMAL"] = "normal";
+ actions[RS::SHADER_SPATIAL].renames["TANGENT"] = "tangent";
+ actions[RS::SHADER_SPATIAL].renames["BINORMAL"] = "binormal";
+ actions[RS::SHADER_SPATIAL].renames["POSITION"] = "position";
+ actions[RS::SHADER_SPATIAL].renames["UV"] = "uv_interp";
+ actions[RS::SHADER_SPATIAL].renames["UV2"] = "uv2_interp";
+ actions[RS::SHADER_SPATIAL].renames["COLOR"] = "color_interp";
+ actions[RS::SHADER_SPATIAL].renames["POINT_SIZE"] = "gl_PointSize";
+ actions[RS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "gl_InstanceID";
//builtins
- actions[VS::SHADER_SPATIAL].renames["TIME"] = "time";
- actions[VS::SHADER_SPATIAL].renames["VIEWPORT_SIZE"] = "viewport_size";
-
- actions[VS::SHADER_SPATIAL].renames["FRAGCOORD"] = "gl_FragCoord";
- actions[VS::SHADER_SPATIAL].renames["FRONT_FACING"] = "gl_FrontFacing";
- actions[VS::SHADER_SPATIAL].renames["NORMALMAP"] = "normalmap";
- actions[VS::SHADER_SPATIAL].renames["NORMALMAP_DEPTH"] = "normaldepth";
- actions[VS::SHADER_SPATIAL].renames["ALBEDO"] = "albedo";
- actions[VS::SHADER_SPATIAL].renames["ALPHA"] = "alpha";
- actions[VS::SHADER_SPATIAL].renames["METALLIC"] = "metallic";
- actions[VS::SHADER_SPATIAL].renames["SPECULAR"] = "specular";
- actions[VS::SHADER_SPATIAL].renames["ROUGHNESS"] = "roughness";
- actions[VS::SHADER_SPATIAL].renames["RIM"] = "rim";
- actions[VS::SHADER_SPATIAL].renames["RIM_TINT"] = "rim_tint";
- actions[VS::SHADER_SPATIAL].renames["CLEARCOAT"] = "clearcoat";
- actions[VS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"] = "clearcoat_gloss";
- actions[VS::SHADER_SPATIAL].renames["ANISOTROPY"] = "anisotropy";
- actions[VS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"] = "anisotropy_flow";
- actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength";
- actions[VS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission";
- actions[VS::SHADER_SPATIAL].renames["AO"] = "ao";
- actions[VS::SHADER_SPATIAL].renames["AO_LIGHT_AFFECT"] = "ao_light_affect";
- actions[VS::SHADER_SPATIAL].renames["EMISSION"] = "emission";
- actions[VS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord";
- actions[VS::SHADER_SPATIAL].renames["INSTANCE_CUSTOM"] = "instance_custom";
- actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv";
- actions[VS::SHADER_SPATIAL].renames["SCREEN_TEXTURE"] = "screen_texture";
- actions[VS::SHADER_SPATIAL].renames["DEPTH_TEXTURE"] = "depth_buffer";
- actions[VS::SHADER_SPATIAL].renames["DEPTH"] = "gl_FragDepth";
- actions[VS::SHADER_SPATIAL].renames["ALPHA_SCISSOR"] = "alpha_scissor";
- actions[VS::SHADER_SPATIAL].renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
+ actions[RS::SHADER_SPATIAL].renames["TIME"] = "time";
+ actions[RS::SHADER_SPATIAL].renames["VIEWPORT_SIZE"] = "viewport_size";
+
+ actions[RS::SHADER_SPATIAL].renames["FRAGCOORD"] = "gl_FragCoord";
+ actions[RS::SHADER_SPATIAL].renames["FRONT_FACING"] = "gl_FrontFacing";
+ actions[RS::SHADER_SPATIAL].renames["NORMALMAP"] = "normalmap";
+ actions[RS::SHADER_SPATIAL].renames["NORMALMAP_DEPTH"] = "normaldepth";
+ actions[RS::SHADER_SPATIAL].renames["ALBEDO"] = "albedo";
+ actions[RS::SHADER_SPATIAL].renames["ALPHA"] = "alpha";
+ actions[RS::SHADER_SPATIAL].renames["METALLIC"] = "metallic";
+ actions[RS::SHADER_SPATIAL].renames["SPECULAR"] = "specular";
+ actions[RS::SHADER_SPATIAL].renames["ROUGHNESS"] = "roughness";
+ actions[RS::SHADER_SPATIAL].renames["RIM"] = "rim";
+ actions[RS::SHADER_SPATIAL].renames["RIM_TINT"] = "rim_tint";
+ actions[RS::SHADER_SPATIAL].renames["CLEARCOAT"] = "clearcoat";
+ actions[RS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"] = "clearcoat_gloss";
+ actions[RS::SHADER_SPATIAL].renames["ANISOTROPY"] = "anisotropy";
+ actions[RS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"] = "anisotropy_flow";
+ actions[RS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength";
+ actions[RS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission";
+ actions[RS::SHADER_SPATIAL].renames["AO"] = "ao";
+ actions[RS::SHADER_SPATIAL].renames["AO_LIGHT_AFFECT"] = "ao_light_affect";
+ actions[RS::SHADER_SPATIAL].renames["EMISSION"] = "emission";
+ actions[RS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord";
+ actions[RS::SHADER_SPATIAL].renames["INSTANCE_CUSTOM"] = "instance_custom";
+ actions[RS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv";
+ actions[RS::SHADER_SPATIAL].renames["SCREEN_TEXTURE"] = "screen_texture";
+ actions[RS::SHADER_SPATIAL].renames["DEPTH_TEXTURE"] = "depth_buffer";
+ actions[RS::SHADER_SPATIAL].renames["DEPTH"] = "gl_FragDepth";
+ actions[RS::SHADER_SPATIAL].renames["ALPHA_SCISSOR"] = "alpha_scissor";
+ actions[RS::SHADER_SPATIAL].renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
//for light
- actions[VS::SHADER_SPATIAL].renames["VIEW"] = "view";
- actions[VS::SHADER_SPATIAL].renames["LIGHT_COLOR"] = "light_color";
- actions[VS::SHADER_SPATIAL].renames["LIGHT"] = "light";
- actions[VS::SHADER_SPATIAL].renames["ATTENUATION"] = "attenuation";
- actions[VS::SHADER_SPATIAL].renames["DIFFUSE_LIGHT"] = "diffuse_light";
- actions[VS::SHADER_SPATIAL].renames["SPECULAR_LIGHT"] = "specular_light";
-
- actions[VS::SHADER_SPATIAL].usage_defines["TANGENT"] = "#define ENABLE_TANGENT_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["BINORMAL"] = "@TANGENT";
- actions[VS::SHADER_SPATIAL].usage_defines["RIM"] = "#define LIGHT_USE_RIM\n";
- actions[VS::SHADER_SPATIAL].usage_defines["RIM_TINT"] = "@RIM";
- actions[VS::SHADER_SPATIAL].usage_defines["CLEARCOAT"] = "#define LIGHT_USE_CLEARCOAT\n";
- actions[VS::SHADER_SPATIAL].usage_defines["CLEARCOAT_GLOSS"] = "@CLEARCOAT";
- actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY"] = "#define LIGHT_USE_ANISOTROPY\n";
- actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY_FLOW"] = "@ANISOTROPY";
- actions[VS::SHADER_SPATIAL].usage_defines["AO"] = "#define ENABLE_AO\n";
- actions[VS::SHADER_SPATIAL].usage_defines["AO_LIGHT_AFFECT"] = "#define ENABLE_AO\n";
- actions[VS::SHADER_SPATIAL].usage_defines["UV"] = "#define ENABLE_UV_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["UV2"] = "#define ENABLE_UV2_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP"] = "#define ENABLE_NORMALMAP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP_DEPTH"] = "@NORMALMAP";
- actions[VS::SHADER_SPATIAL].usage_defines["COLOR"] = "#define ENABLE_COLOR_INTERP\n";
- actions[VS::SHADER_SPATIAL].usage_defines["INSTANCE_CUSTOM"] = "#define ENABLE_INSTANCE_CUSTOM\n";
- actions[VS::SHADER_SPATIAL].usage_defines["ALPHA_SCISSOR"] = "#define ALPHA_SCISSOR_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["POSITION"] = "#define OVERRIDE_POSITION\n";
-
- actions[VS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS\n";
- actions[VS::SHADER_SPATIAL].usage_defines["TRANSMISSION"] = "#define TRANSMISSION_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
-
- actions[VS::SHADER_SPATIAL].usage_defines["DIFFUSE_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
- actions[VS::SHADER_SPATIAL].usage_defines["SPECULAR_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
-
- actions[VS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["ensure_correct_normals"] = "#define ENSURE_CORRECT_NORMALS\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
+ actions[RS::SHADER_SPATIAL].renames["VIEW"] = "view";
+ actions[RS::SHADER_SPATIAL].renames["LIGHT_COLOR"] = "light_color";
+ actions[RS::SHADER_SPATIAL].renames["LIGHT"] = "light";
+ actions[RS::SHADER_SPATIAL].renames["ATTENUATION"] = "attenuation";
+ actions[RS::SHADER_SPATIAL].renames["DIFFUSE_LIGHT"] = "diffuse_light";
+ actions[RS::SHADER_SPATIAL].renames["SPECULAR_LIGHT"] = "specular_light";
+
+ actions[RS::SHADER_SPATIAL].usage_defines["TANGENT"] = "#define ENABLE_TANGENT_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["BINORMAL"] = "@TANGENT";
+ actions[RS::SHADER_SPATIAL].usage_defines["RIM"] = "#define LIGHT_USE_RIM\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["RIM_TINT"] = "@RIM";
+ actions[RS::SHADER_SPATIAL].usage_defines["CLEARCOAT"] = "#define LIGHT_USE_CLEARCOAT\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["CLEARCOAT_GLOSS"] = "@CLEARCOAT";
+ actions[RS::SHADER_SPATIAL].usage_defines["ANISOTROPY"] = "#define LIGHT_USE_ANISOTROPY\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["ANISOTROPY_FLOW"] = "@ANISOTROPY";
+ actions[RS::SHADER_SPATIAL].usage_defines["AO"] = "#define ENABLE_AO\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["AO_LIGHT_AFFECT"] = "#define ENABLE_AO\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["UV"] = "#define ENABLE_UV_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["UV2"] = "#define ENABLE_UV2_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["NORMALMAP"] = "#define ENABLE_NORMALMAP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["NORMALMAP_DEPTH"] = "@NORMALMAP";
+ actions[RS::SHADER_SPATIAL].usage_defines["COLOR"] = "#define ENABLE_COLOR_INTERP\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["INSTANCE_CUSTOM"] = "#define ENABLE_INSTANCE_CUSTOM\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["ALPHA_SCISSOR"] = "#define ALPHA_SCISSOR_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["POSITION"] = "#define OVERRIDE_POSITION\n";
+
+ actions[RS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["TRANSMISSION"] = "#define TRANSMISSION_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
+
+ actions[RS::SHADER_SPATIAL].usage_defines["DIFFUSE_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
+ actions[RS::SHADER_SPATIAL].usage_defines["SPECULAR_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
+
+ actions[RS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["ensure_correct_normals"] = "#define ENSURE_CORRECT_NORMALS\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
bool force_lambert = GLOBAL_GET("rendering/quality/shading/force_lambert_over_burley");
if (!force_lambert) {
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
}
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
bool force_blinn = GLOBAL_GET("rendering/quality/shading/force_blinn_over_ggx");
if (!force_blinn) {
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
} else {
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
}
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["specular_disabled"] = "#define SPECULAR_DISABLED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["shadows_disabled"] = "#define SHADOWS_DISABLED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["ambient_light_disabled"] = "#define AMBIENT_LIGHT_DISABLED\n";
- actions[VS::SHADER_SPATIAL].render_mode_defines["shadow_to_opacity"] = "#define USE_SHADOW_TO_OPACITY\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["specular_disabled"] = "#define SPECULAR_DISABLED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["shadows_disabled"] = "#define SHADOWS_DISABLED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["ambient_light_disabled"] = "#define AMBIENT_LIGHT_DISABLED\n";
+ actions[RS::SHADER_SPATIAL].render_mode_defines["shadow_to_opacity"] = "#define USE_SHADOW_TO_OPACITY\n";
/* PARTICLES SHADER */
- actions[VS::SHADER_PARTICLES].renames["COLOR"] = "out_color";
- actions[VS::SHADER_PARTICLES].renames["VELOCITY"] = "out_velocity_active.xyz";
- actions[VS::SHADER_PARTICLES].renames["MASS"] = "mass";
- actions[VS::SHADER_PARTICLES].renames["ACTIVE"] = "shader_active";
- actions[VS::SHADER_PARTICLES].renames["RESTART"] = "restart";
- actions[VS::SHADER_PARTICLES].renames["CUSTOM"] = "out_custom";
- actions[VS::SHADER_PARTICLES].renames["TRANSFORM"] = "xform";
- actions[VS::SHADER_PARTICLES].renames["TIME"] = "time";
- actions[VS::SHADER_PARTICLES].renames["LIFETIME"] = "lifetime";
- actions[VS::SHADER_PARTICLES].renames["DELTA"] = "local_delta";
- actions[VS::SHADER_PARTICLES].renames["NUMBER"] = "particle_number";
- actions[VS::SHADER_PARTICLES].renames["INDEX"] = "index";
- actions[VS::SHADER_PARTICLES].renames["GRAVITY"] = "current_gravity";
- actions[VS::SHADER_PARTICLES].renames["EMISSION_TRANSFORM"] = "emission_transform";
- actions[VS::SHADER_PARTICLES].renames["RANDOM_SEED"] = "random_seed";
-
- actions[VS::SHADER_PARTICLES].render_mode_defines["disable_force"] = "#define DISABLE_FORCE\n";
- actions[VS::SHADER_PARTICLES].render_mode_defines["disable_velocity"] = "#define DISABLE_VELOCITY\n";
- actions[VS::SHADER_PARTICLES].render_mode_defines["keep_data"] = "#define ENABLE_KEEP_DATA\n";
+ actions[RS::SHADER_PARTICLES].renames["COLOR"] = "out_color";
+ actions[RS::SHADER_PARTICLES].renames["VELOCITY"] = "out_velocity_active.xyz";
+ actions[RS::SHADER_PARTICLES].renames["MASS"] = "mass";
+ actions[RS::SHADER_PARTICLES].renames["ACTIVE"] = "shader_active";
+ actions[RS::SHADER_PARTICLES].renames["RESTART"] = "restart";
+ actions[RS::SHADER_PARTICLES].renames["CUSTOM"] = "out_custom";
+ actions[RS::SHADER_PARTICLES].renames["TRANSFORM"] = "xform";
+ actions[RS::SHADER_PARTICLES].renames["TIME"] = "time";
+ actions[RS::SHADER_PARTICLES].renames["LIFETIME"] = "lifetime";
+ actions[RS::SHADER_PARTICLES].renames["DELTA"] = "local_delta";
+ actions[RS::SHADER_PARTICLES].renames["NUMBER"] = "particle_number";
+ actions[RS::SHADER_PARTICLES].renames["INDEX"] = "index";
+ actions[RS::SHADER_PARTICLES].renames["GRAVITY"] = "current_gravity";
+ actions[RS::SHADER_PARTICLES].renames["EMISSION_TRANSFORM"] = "emission_transform";
+ actions[RS::SHADER_PARTICLES].renames["RANDOM_SEED"] = "random_seed";
+
+ actions[RS::SHADER_PARTICLES].render_mode_defines["disable_force"] = "#define DISABLE_FORCE\n";
+ actions[RS::SHADER_PARTICLES].render_mode_defines["disable_velocity"] = "#define DISABLE_VELOCITY\n";
+ actions[RS::SHADER_PARTICLES].render_mode_defines["keep_data"] = "#define ENABLE_KEEP_DATA\n";
#endif
}
diff --git a/servers/visual/rasterizer_rd/shader_compiler_rd.h b/servers/rendering/rasterizer_rd/shader_compiler_rd.h
index 95e1f0aa23..7d78469e9c 100644
--- a/servers/visual/rasterizer_rd/shader_compiler_rd.h
+++ b/servers/rendering/rasterizer_rd/shader_compiler_rd.h
@@ -32,9 +32,9 @@
#define SHADER_COMPILER_RD_H
#include "core/pair.h"
-#include "servers/visual/shader_language.h"
-#include "servers/visual/shader_types.h"
-#include "servers/visual_server.h"
+#include "servers/rendering/shader_language.h"
+#include "servers/rendering/shader_types.h"
+#include "servers/rendering_server.h"
class ShaderCompilerRD {
public:
@@ -114,7 +114,7 @@ private:
DefaultIdentifierActions actions;
public:
- Error compile(VS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code);
+ Error compile(RS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code);
void initialize(DefaultIdentifierActions p_actions);
ShaderCompilerRD();
diff --git a/servers/visual/rasterizer_rd/shader_rd.cpp b/servers/rendering/rasterizer_rd/shader_rd.cpp
index 74edaee983..3dcfd0faf9 100644
--- a/servers/visual/rasterizer_rd/shader_rd.cpp
+++ b/servers/rendering/rasterizer_rd/shader_rd.cpp
@@ -32,7 +32,7 @@
#include "core/string_builder.h"
#include "rasterizer_rd.h"
-#include "servers/visual/rendering_device.h"
+#include "servers/rendering/rendering_device.h"
void ShaderRD::setup(const char *p_vertex_code, const char *p_fragment_code, const char *p_compute_code, const char *p_name) {
diff --git a/servers/visual/rasterizer_rd/shader_rd.h b/servers/rendering/rasterizer_rd/shader_rd.h
index 6635b08cc8..6635b08cc8 100644
--- a/servers/visual/rasterizer_rd/shader_rd.h
+++ b/servers/rendering/rasterizer_rd/shader_rd.h
diff --git a/servers/visual/rasterizer_rd/shaders/SCsub b/servers/rendering/rasterizer_rd/shaders/SCsub
index 2dcb2a703f..2dcb2a703f 100644
--- a/servers/visual/rasterizer_rd/shaders/SCsub
+++ b/servers/rendering/rasterizer_rd/shaders/SCsub
diff --git a/servers/visual/rasterizer_rd/shaders/blur.glsl b/servers/rendering/rasterizer_rd/shaders/blur.glsl
index 87c20ebaef..87c20ebaef 100644
--- a/servers/visual/rasterizer_rd/shaders/blur.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/blur.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/blur_inc.glsl b/servers/rendering/rasterizer_rd/shaders/blur_inc.glsl
index 33ba9de7bb..33ba9de7bb 100644
--- a/servers/visual/rasterizer_rd/shaders/blur_inc.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/blur_inc.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/bokeh_dof.glsl b/servers/rendering/rasterizer_rd/shaders/bokeh_dof.glsl
index 7153fe6b17..7153fe6b17 100644
--- a/servers/visual/rasterizer_rd/shaders/bokeh_dof.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/bokeh_dof.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/canvas.glsl b/servers/rendering/rasterizer_rd/shaders/canvas.glsl
index 28135fce31..28135fce31 100644
--- a/servers/visual/rasterizer_rd/shaders/canvas.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/canvas.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/canvas_occlusion.glsl b/servers/rendering/rasterizer_rd/shaders/canvas_occlusion.glsl
index 7b30cc8fe9..7b30cc8fe9 100644
--- a/servers/visual/rasterizer_rd/shaders/canvas_occlusion.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/canvas_occlusion.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/canvas_uniforms_inc.glsl b/servers/rendering/rasterizer_rd/shaders/canvas_uniforms_inc.glsl
index 1ac43480cd..1ac43480cd 100644
--- a/servers/visual/rasterizer_rd/shaders/canvas_uniforms_inc.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/canvas_uniforms_inc.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/copy.glsl b/servers/rendering/rasterizer_rd/shaders/copy.glsl
index cbb9b546a3..cbb9b546a3 100644
--- a/servers/visual/rasterizer_rd/shaders/copy.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/copy.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/cubemap_downsampler.glsl b/servers/rendering/rasterizer_rd/shaders/cubemap_downsampler.glsl
index 9f3ecf6053..9f3ecf6053 100644
--- a/servers/visual/rasterizer_rd/shaders/cubemap_downsampler.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/cubemap_downsampler.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/cubemap_filter.glsl b/servers/rendering/rasterizer_rd/shaders/cubemap_filter.glsl
index 193d0a8a3c..193d0a8a3c 100644
--- a/servers/visual/rasterizer_rd/shaders/cubemap_filter.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/cubemap_filter.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/cubemap_roughness.glsl b/servers/rendering/rasterizer_rd/shaders/cubemap_roughness.glsl
index e85996fa1a..e85996fa1a 100644
--- a/servers/visual/rasterizer_rd/shaders/cubemap_roughness.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/cubemap_roughness.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/giprobe.glsl b/servers/rendering/rasterizer_rd/shaders/giprobe.glsl
index fd09f96a57..fd09f96a57 100644
--- a/servers/visual/rasterizer_rd/shaders/giprobe.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/giprobe.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/giprobe_debug.glsl b/servers/rendering/rasterizer_rd/shaders/giprobe_debug.glsl
index b1784e7eee..b1784e7eee 100644
--- a/servers/visual/rasterizer_rd/shaders/giprobe_debug.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/giprobe_debug.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/giprobe_sdf.glsl b/servers/rendering/rasterizer_rd/shaders/giprobe_sdf.glsl
index d089236723..d089236723 100644
--- a/servers/visual/rasterizer_rd/shaders/giprobe_sdf.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/giprobe_sdf.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/giprobe_write.glsl b/servers/rendering/rasterizer_rd/shaders/giprobe_write.glsl
index c832223b1e..c832223b1e 100644
--- a/servers/visual/rasterizer_rd/shaders/giprobe_write.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/giprobe_write.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/luminance_reduce.glsl b/servers/rendering/rasterizer_rd/shaders/luminance_reduce.glsl
index 4bf5b7e7f1..4bf5b7e7f1 100644
--- a/servers/visual/rasterizer_rd/shaders/luminance_reduce.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/luminance_reduce.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/roughness_limiter.glsl b/servers/rendering/rasterizer_rd/shaders/roughness_limiter.glsl
index 3637b1abb2..3637b1abb2 100644
--- a/servers/visual/rasterizer_rd/shaders/roughness_limiter.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/roughness_limiter.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/scene_high_end.glsl b/servers/rendering/rasterizer_rd/shaders/scene_high_end.glsl
index 07f4770b14..07f4770b14 100644
--- a/servers/visual/rasterizer_rd/shaders/scene_high_end.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/scene_high_end.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl b/servers/rendering/rasterizer_rd/shaders/scene_high_end_inc.glsl
index baef1e060f..baef1e060f 100644
--- a/servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/scene_high_end_inc.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/sky.glsl b/servers/rendering/rasterizer_rd/shaders/sky.glsl
index 3f433eb2ee..3f433eb2ee 100644
--- a/servers/visual/rasterizer_rd/shaders/sky.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/sky.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/ssao.glsl b/servers/rendering/rasterizer_rd/shaders/ssao.glsl
index c9d7134610..c9d7134610 100644
--- a/servers/visual/rasterizer_rd/shaders/ssao.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/ssao.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/ssao_blur.glsl b/servers/rendering/rasterizer_rd/shaders/ssao_blur.glsl
index e90c788e08..e90c788e08 100644
--- a/servers/visual/rasterizer_rd/shaders/ssao_blur.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/ssao_blur.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/ssao_minify.glsl b/servers/rendering/rasterizer_rd/shaders/ssao_minify.glsl
index 8728154347..8728154347 100644
--- a/servers/visual/rasterizer_rd/shaders/ssao_minify.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/ssao_minify.glsl
diff --git a/servers/visual/rasterizer_rd/shaders/tonemap.glsl b/servers/rendering/rasterizer_rd/shaders/tonemap.glsl
index 524ca5e2ea..524ca5e2ea 100644
--- a/servers/visual/rasterizer_rd/shaders/tonemap.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/tonemap.glsl
diff --git a/servers/visual/rendering_device.cpp b/servers/rendering/rendering_device.cpp
index 3c1795161d..3c1795161d 100644
--- a/servers/visual/rendering_device.cpp
+++ b/servers/rendering/rendering_device.cpp
diff --git a/servers/visual/rendering_device.h b/servers/rendering/rendering_device.h
index 4705bcaa75..4705bcaa75 100644
--- a/servers/visual/rendering_device.h
+++ b/servers/rendering/rendering_device.h
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/rendering/rendering_server_canvas.cpp
index c192b77988..7b28c586b9 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/rendering/rendering_server_canvas.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_canvas.cpp */
+/* rendering_server_canvas.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server_canvas.h"
-#include "visual_server_globals.h"
-#include "visual_server_raster.h"
-#include "visual_server_viewport.h"
+#include "rendering_server_canvas.h"
+#include "rendering_server_globals.h"
+#include "rendering_server_raster.h"
+#include "rendering_server_viewport.h"
-static const int z_range = VS::CANVAS_ITEM_Z_MAX - VS::CANVAS_ITEM_Z_MIN + 1;
+static const int z_range = RS::CANVAS_ITEM_Z_MAX - RS::CANVAS_ITEM_Z_MIN + 1;
-void VisualServerCanvas::_render_canvas_item_tree(RID p_to_render_target, Canvas::ChildItem *p_child_items, int p_child_item_count, Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RasterizerCanvas::Light *p_lights) {
+void RenderingServerCanvas::_render_canvas_item_tree(RID p_to_render_target, Canvas::ChildItem *p_child_items, int p_child_item_count, Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RasterizerCanvas::Light *p_lights) {
RENDER_TIMESTAMP("Cull CanvasItem Tree");
@@ -66,12 +66,12 @@ void VisualServerCanvas::_render_canvas_item_tree(RID p_to_render_target, Canvas
RENDER_TIMESTAMP("Render Canvas Items");
- VSG::canvas_render->canvas_render_items(p_to_render_target, list, p_modulate, p_lights, p_transform);
+ RSG::canvas_render->canvas_render_items(p_to_render_target, list, p_modulate, p_lights, p_transform);
}
-void _collect_ysort_children(VisualServerCanvas::Item *p_canvas_item, Transform2D p_transform, VisualServerCanvas::Item *p_material_owner, VisualServerCanvas::Item **r_items, int &r_index) {
+void _collect_ysort_children(RenderingServerCanvas::Item *p_canvas_item, Transform2D p_transform, RenderingServerCanvas::Item *p_material_owner, RenderingServerCanvas::Item **r_items, int &r_index) {
int child_item_count = p_canvas_item->child_items.size();
- VisualServerCanvas::Item **child_items = p_canvas_item->child_items.ptrw();
+ RenderingServerCanvas::Item **child_items = p_canvas_item->child_items.ptrw();
for (int i = 0; i < child_item_count; i++) {
if (child_items[i]->visible) {
if (r_items) {
@@ -89,14 +89,14 @@ void _collect_ysort_children(VisualServerCanvas::Item *p_canvas_item, Transform2
}
}
-void _mark_ysort_dirty(VisualServerCanvas::Item *ysort_owner, RID_PtrOwner<VisualServerCanvas::Item> &canvas_item_owner) {
+void _mark_ysort_dirty(RenderingServerCanvas::Item *ysort_owner, RID_PtrOwner<RenderingServerCanvas::Item> &canvas_item_owner) {
do {
ysort_owner->ysort_children_count = -1;
ysort_owner = canvas_item_owner.owns(ysort_owner->parent) ? canvas_item_owner.getornull(ysort_owner->parent) : NULL;
} while (ysort_owner && ysort_owner->sort_y);
}
-void VisualServerCanvas::_cull_canvas_item(Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, int p_z, RasterizerCanvas::Item **z_list, RasterizerCanvas::Item **z_last_list, Item *p_canvas_clip, Item *p_material_owner) {
+void RenderingServerCanvas::_cull_canvas_item(Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, int p_z, RasterizerCanvas::Item **z_list, RasterizerCanvas::Item **z_last_list, Item *p_canvas_clip, Item *p_material_owner) {
Item *ci = p_canvas_item;
@@ -159,7 +159,7 @@ void VisualServerCanvas::_cull_canvas_item(Item *p_canvas_item, const Transform2
}
if (ci->z_relative)
- p_z = CLAMP(p_z + ci->z_index, VS::CANVAS_ITEM_Z_MIN, VS::CANVAS_ITEM_Z_MAX);
+ p_z = CLAMP(p_z + ci->z_index, RS::CANVAS_ITEM_Z_MIN, RS::CANVAS_ITEM_Z_MAX);
else
p_z = ci->z_index;
@@ -180,7 +180,7 @@ void VisualServerCanvas::_cull_canvas_item(Item *p_canvas_item, const Transform2
}
if (ci->update_when_visible) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
if ((ci->commands != NULL && p_clip_rect.intersects(global_rect, true)) || ci->vp_render || ci->copy_back_buffer) {
@@ -191,7 +191,7 @@ void VisualServerCanvas::_cull_canvas_item(Item *p_canvas_item, const Transform2
ci->global_rect_cache.position -= p_clip_rect.position;
ci->light_masked = false;
- int zidx = p_z - VS::CANVAS_ITEM_Z_MIN;
+ int zidx = p_z - RS::CANVAS_ITEM_Z_MIN;
if (z_last_list[zidx]) {
z_last_list[zidx]->next = ci;
@@ -219,7 +219,7 @@ void VisualServerCanvas::_cull_canvas_item(Item *p_canvas_item, const Transform2
}
}
-void VisualServerCanvas::_light_mask_canvas_items(int p_z, RasterizerCanvas::Item *p_canvas_item, RasterizerCanvas::Light *p_masked_lights) {
+void RenderingServerCanvas::_light_mask_canvas_items(int p_z, RasterizerCanvas::Item *p_canvas_item, RasterizerCanvas::Light *p_masked_lights) {
if (!p_masked_lights)
return;
@@ -242,7 +242,7 @@ void VisualServerCanvas::_light_mask_canvas_items(int p_z, RasterizerCanvas::Ite
}
}
-void VisualServerCanvas::render_canvas(RID p_render_target, Canvas *p_canvas, const Transform2D &p_transform, RasterizerCanvas::Light *p_lights, RasterizerCanvas::Light *p_masked_lights, const Rect2 &p_clip_rect) {
+void RenderingServerCanvas::render_canvas(RID p_render_target, Canvas *p_canvas, const Transform2D &p_transform, RasterizerCanvas::Light *p_lights, RasterizerCanvas::Light *p_masked_lights, const Rect2 &p_clip_rect) {
RENDER_TIMESTAMP(">Render Canvas");
@@ -296,7 +296,7 @@ void VisualServerCanvas::render_canvas(RID p_render_target, Canvas *p_canvas, co
RENDER_TIMESTAMP("<End Render Canvas");
}
-RID VisualServerCanvas::canvas_create() {
+RID RenderingServerCanvas::canvas_create() {
Canvas *canvas = memnew(Canvas);
ERR_FAIL_COND_V(!canvas, RID());
@@ -305,7 +305,7 @@ RID VisualServerCanvas::canvas_create() {
return rid;
}
-void VisualServerCanvas::canvas_set_item_mirroring(RID p_canvas, RID p_item, const Point2 &p_mirroring) {
+void RenderingServerCanvas::canvas_set_item_mirroring(RID p_canvas, RID p_item, const Point2 &p_mirroring) {
Canvas *canvas = canvas_owner.getornull(p_canvas);
ERR_FAIL_COND(!canvas);
@@ -316,18 +316,18 @@ void VisualServerCanvas::canvas_set_item_mirroring(RID p_canvas, RID p_item, con
ERR_FAIL_COND(idx == -1);
canvas->child_items.write[idx].mirror = p_mirroring;
}
-void VisualServerCanvas::canvas_set_modulate(RID p_canvas, const Color &p_color) {
+void RenderingServerCanvas::canvas_set_modulate(RID p_canvas, const Color &p_color) {
Canvas *canvas = canvas_owner.getornull(p_canvas);
ERR_FAIL_COND(!canvas);
canvas->modulate = p_color;
}
-void VisualServerCanvas::canvas_set_disable_scale(bool p_disable) {
+void RenderingServerCanvas::canvas_set_disable_scale(bool p_disable) {
disable_scale = p_disable;
}
-void VisualServerCanvas::canvas_set_parent(RID p_canvas, RID p_parent, float p_scale) {
+void RenderingServerCanvas::canvas_set_parent(RID p_canvas, RID p_parent, float p_scale) {
Canvas *canvas = canvas_owner.getornull(p_canvas);
ERR_FAIL_COND(!canvas);
@@ -336,7 +336,7 @@ void VisualServerCanvas::canvas_set_parent(RID p_canvas, RID p_parent, float p_s
canvas->parent_scale = p_scale;
}
-RID VisualServerCanvas::canvas_item_create() {
+RID RenderingServerCanvas::canvas_item_create() {
Item *canvas_item = memnew(Item);
ERR_FAIL_COND_V(!canvas_item, RID());
@@ -344,7 +344,7 @@ RID VisualServerCanvas::canvas_item_create() {
return canvas_item_owner.make_rid(canvas_item);
}
-void VisualServerCanvas::canvas_item_set_parent(RID p_item, RID p_parent) {
+void RenderingServerCanvas::canvas_item_set_parent(RID p_item, RID p_parent) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -394,7 +394,7 @@ void VisualServerCanvas::canvas_item_set_parent(RID p_item, RID p_parent) {
canvas_item->parent = p_parent;
}
-void VisualServerCanvas::canvas_item_set_visible(RID p_item, bool p_visible) {
+void RenderingServerCanvas::canvas_item_set_visible(RID p_item, bool p_visible) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -403,7 +403,7 @@ void VisualServerCanvas::canvas_item_set_visible(RID p_item, bool p_visible) {
_mark_ysort_dirty(canvas_item, canvas_item_owner);
}
-void VisualServerCanvas::canvas_item_set_light_mask(RID p_item, int p_mask) {
+void RenderingServerCanvas::canvas_item_set_light_mask(RID p_item, int p_mask) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -411,28 +411,28 @@ void VisualServerCanvas::canvas_item_set_light_mask(RID p_item, int p_mask) {
canvas_item->light_mask = p_mask;
}
-void VisualServerCanvas::canvas_item_set_transform(RID p_item, const Transform2D &p_transform) {
+void RenderingServerCanvas::canvas_item_set_transform(RID p_item, const Transform2D &p_transform) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->xform = p_transform;
}
-void VisualServerCanvas::canvas_item_set_clip(RID p_item, bool p_clip) {
+void RenderingServerCanvas::canvas_item_set_clip(RID p_item, bool p_clip) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->clip = p_clip;
}
-void VisualServerCanvas::canvas_item_set_distance_field_mode(RID p_item, bool p_enable) {
+void RenderingServerCanvas::canvas_item_set_distance_field_mode(RID p_item, bool p_enable) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->distance_field = p_enable;
}
-void VisualServerCanvas::canvas_item_set_custom_rect(RID p_item, bool p_custom_rect, const Rect2 &p_rect) {
+void RenderingServerCanvas::canvas_item_set_custom_rect(RID p_item, bool p_custom_rect, const Rect2 &p_rect) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -440,14 +440,14 @@ void VisualServerCanvas::canvas_item_set_custom_rect(RID p_item, bool p_custom_r
canvas_item->custom_rect = p_custom_rect;
canvas_item->rect = p_rect;
}
-void VisualServerCanvas::canvas_item_set_modulate(RID p_item, const Color &p_color) {
+void RenderingServerCanvas::canvas_item_set_modulate(RID p_item, const Color &p_color) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->modulate = p_color;
}
-void VisualServerCanvas::canvas_item_set_self_modulate(RID p_item, const Color &p_color) {
+void RenderingServerCanvas::canvas_item_set_self_modulate(RID p_item, const Color &p_color) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -455,7 +455,7 @@ void VisualServerCanvas::canvas_item_set_self_modulate(RID p_item, const Color &
canvas_item->self_modulate = p_color;
}
-void VisualServerCanvas::canvas_item_set_draw_behind_parent(RID p_item, bool p_enable) {
+void RenderingServerCanvas::canvas_item_set_draw_behind_parent(RID p_item, bool p_enable) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -463,7 +463,7 @@ void VisualServerCanvas::canvas_item_set_draw_behind_parent(RID p_item, bool p_e
canvas_item->behind = p_enable;
}
-void VisualServerCanvas::canvas_item_set_update_when_visible(RID p_item, bool p_update) {
+void RenderingServerCanvas::canvas_item_set_update_when_visible(RID p_item, bool p_update) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -471,21 +471,21 @@ void VisualServerCanvas::canvas_item_set_update_when_visible(RID p_item, bool p_
canvas_item->update_when_visible = p_update;
}
-void VisualServerCanvas::canvas_item_set_default_texture_filter(RID p_item, VS::CanvasItemTextureFilter p_filter) {
+void RenderingServerCanvas::canvas_item_set_default_texture_filter(RID p_item, RS::CanvasItemTextureFilter p_filter) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->texture_filter = p_filter;
}
-void VisualServerCanvas::canvas_item_set_default_texture_repeat(RID p_item, VS::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_set_default_texture_repeat(RID p_item, RS::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->texture_repeat = p_repeat;
}
-void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width) {
+void RenderingServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -511,7 +511,7 @@ void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from,
line->specular_shininess = Color(1, 1, 1, 1);
}
-void VisualServerCanvas::canvas_item_add_polyline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width) {
+void RenderingServerCanvas::canvas_item_add_polyline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width) {
ERR_FAIL_COND(p_points.size() < 2);
Item *canvas_item = canvas_item_owner.getornull(p_item);
@@ -520,7 +520,7 @@ void VisualServerCanvas::canvas_item_add_polyline(RID p_item, const Vector<Point
Item::CommandPolygon *pline = canvas_item->alloc_command<Item::CommandPolygon>();
ERR_FAIL_COND(!pline);
- pline->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, RID(), RID(), RID(), VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, RID());
+ pline->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, RID(), RID(), RID(), RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, RID());
if (true || p_width <= 1) {
#define TODO make thick lines possible
@@ -535,7 +535,7 @@ void VisualServerCanvas::canvas_item_add_polyline(RID p_item, const Vector<Point
}
}
- pline->primitive = VS::PRIMITIVE_LINES;
+ pline->primitive = RS::PRIMITIVE_LINES;
pline->specular_shininess = Color(1, 1, 1, 1);
pline->polygon.create(indices, p_points, p_colors);
} else {
@@ -603,7 +603,7 @@ void VisualServerCanvas::canvas_item_add_polyline(RID p_item, const Vector<Point
}
}
-void VisualServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width) {
+void RenderingServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width) {
ERR_FAIL_COND(p_points.size() < 2);
Item *canvas_item = canvas_item_owner.getornull(p_item);
@@ -612,19 +612,19 @@ void VisualServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Poin
Item::CommandPolygon *pline = canvas_item->alloc_command<Item::CommandPolygon>();
ERR_FAIL_COND(!pline);
- pline->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, RID(), RID(), RID(), VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, RID());
+ pline->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, RID(), RID(), RID(), RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, RID());
if (true || p_width <= 1) {
#define TODO make thick lines possible
- pline->primitive = VS::PRIMITIVE_LINES;
+ pline->primitive = RS::PRIMITIVE_LINES;
pline->specular_shininess = Color(1, 1, 1, 1);
pline->polygon.create(Vector<int>(), p_points, p_colors);
} else {
}
}
-void VisualServerCanvas::canvas_item_add_rect(RID p_item, const Rect2 &p_rect, const Color &p_color) {
+void RenderingServerCanvas::canvas_item_add_rect(RID p_item, const Rect2 &p_rect, const Color &p_color) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -635,7 +635,7 @@ void VisualServerCanvas::canvas_item_add_rect(RID p_item, const Rect2 &p_rect, c
rect->rect = p_rect;
}
-void VisualServerCanvas::canvas_item_add_circle(RID p_item, const Point2 &p_pos, float p_radius, const Color &p_color) {
+void RenderingServerCanvas::canvas_item_add_circle(RID p_item, const Point2 &p_pos, float p_radius, const Color &p_color) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -643,9 +643,9 @@ void VisualServerCanvas::canvas_item_add_circle(RID p_item, const Point2 &p_pos,
Item::CommandPolygon *circle = canvas_item->alloc_command<Item::CommandPolygon>();
ERR_FAIL_COND(!circle);
- circle->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, RID(), RID(), RID(), VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, RID());
+ circle->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, RID(), RID(), RID(), RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, RID());
- circle->primitive = VS::PRIMITIVE_TRIANGLES;
+ circle->primitive = RS::PRIMITIVE_TRIANGLES;
circle->specular_shininess = Color(1, 1, 1, 1);
Vector<int> indices;
@@ -673,7 +673,7 @@ void VisualServerCanvas::canvas_item_add_circle(RID p_item, const Point2 &p_pos,
circle->polygon.create(indices, points, color);
}
-void VisualServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile, const Color &p_modulate, bool p_transpose, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile, const Color &p_modulate, bool p_transpose, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -707,7 +707,7 @@ void VisualServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2 &p
rect->specular_shininess = p_specular_color_shininess;
}
-void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, bool p_clip_uv, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, bool p_clip_uv, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -752,7 +752,7 @@ void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const R
}
}
-void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode, VS::NinePatchAxisMode p_y_axis_mode, bool p_draw_center, const Color &p_modulate, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, RS::NinePatchAxisMode p_x_axis_mode, RS::NinePatchAxisMode p_y_axis_mode, bool p_draw_center, const Color &p_modulate, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -772,7 +772,7 @@ void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2 &p_r
style->axis_x = p_x_axis_mode;
style->axis_y = p_y_axis_mode;
}
-void VisualServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
uint32_t pc = p_points.size();
ERR_FAIL_COND(pc == 0 || pc > 4);
@@ -803,7 +803,7 @@ void VisualServerCanvas::canvas_item_add_primitive(RID p_item, const Vector<Poin
prim->specular_shininess = p_specular_color_shininess;
}
-void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -820,13 +820,13 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2
Item::CommandPolygon *polygon = canvas_item->alloc_command<Item::CommandPolygon>();
ERR_FAIL_COND(!polygon);
- polygon->primitive = VS::PRIMITIVE_TRIANGLES;
+ polygon->primitive = RS::PRIMITIVE_TRIANGLES;
polygon->texture_binding.create(canvas_item->texture_filter, canvas_item->texture_repeat, p_texture, p_normal_map, p_specular_map, p_filter, p_repeat, RID());
polygon->specular_shininess = p_specular_color_shininess;
polygon->polygon.create(indices, p_points, p_colors, p_uvs);
}
-void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, const Vector<int> &p_bones, const Vector<float> &p_weights, RID p_texture, int p_count, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, const Vector<int> &p_bones, const Vector<float> &p_weights, RID p_texture, int p_count, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -846,10 +846,10 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector
polygon->specular_shininess = p_specular_color_shininess;
polygon->polygon.create(indices, p_points, p_colors, p_uvs, p_bones, p_weights);
- polygon->primitive = VS::PRIMITIVE_TRIANGLES;
+ polygon->primitive = RS::PRIMITIVE_TRIANGLES;
}
-void VisualServerCanvas::canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) {
+void RenderingServerCanvas::canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -859,7 +859,7 @@ void VisualServerCanvas::canvas_item_add_set_transform(RID p_item, const Transfo
tr->xform = p_transform;
}
-void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, const Transform2D &p_transform, const Color &p_modulate, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, const Transform2D &p_transform, const Color &p_modulate, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -872,7 +872,7 @@ void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, con
m->transform = p_transform;
m->modulate = p_modulate;
}
-void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -884,10 +884,10 @@ void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles,
part->specular_shininess = p_specular_color_shininess;
//take the chance and request processing for them, at least once until they become visible again
- VSG::storage->particles_request_process(p_particles);
+ RSG::storage->particles_request_process(p_particles);
}
-void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, VisualServer::CanvasItemTextureFilter p_filter, VisualServer::CanvasItemTextureRepeat p_repeat) {
+void RenderingServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture, RID p_normal_map, RID p_specular_map, const Color &p_specular_color_shininess, RenderingServer::CanvasItemTextureFilter p_filter, RenderingServer::CanvasItemTextureRepeat p_repeat) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -899,7 +899,7 @@ void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p
mm->specular_shininess = p_specular_color_shininess;
}
-void VisualServerCanvas::canvas_item_add_clip_ignore(RID p_item, bool p_ignore) {
+void RenderingServerCanvas::canvas_item_add_clip_ignore(RID p_item, bool p_ignore) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -908,7 +908,7 @@ void VisualServerCanvas::canvas_item_add_clip_ignore(RID p_item, bool p_ignore)
ERR_FAIL_COND(!ci);
ci->ignore = p_ignore;
}
-void VisualServerCanvas::canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) {
+void RenderingServerCanvas::canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -917,16 +917,16 @@ void VisualServerCanvas::canvas_item_set_sort_children_by_y(RID p_item, bool p_e
_mark_ysort_dirty(canvas_item, canvas_item_owner);
}
-void VisualServerCanvas::canvas_item_set_z_index(RID p_item, int p_z) {
+void RenderingServerCanvas::canvas_item_set_z_index(RID p_item, int p_z) {
- ERR_FAIL_COND(p_z < VS::CANVAS_ITEM_Z_MIN || p_z > VS::CANVAS_ITEM_Z_MAX);
+ ERR_FAIL_COND(p_z < RS::CANVAS_ITEM_Z_MIN || p_z > RS::CANVAS_ITEM_Z_MAX);
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->z_index = p_z;
}
-void VisualServerCanvas::canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable) {
+void RenderingServerCanvas::canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -934,7 +934,7 @@ void VisualServerCanvas::canvas_item_set_z_as_relative_to_parent(RID p_item, boo
canvas_item->z_relative = p_enable;
}
-void VisualServerCanvas::canvas_item_attach_skeleton(RID p_item, RID p_skeleton) {
+void RenderingServerCanvas::canvas_item_attach_skeleton(RID p_item, RID p_skeleton) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -942,7 +942,7 @@ void VisualServerCanvas::canvas_item_attach_skeleton(RID p_item, RID p_skeleton)
canvas_item->skeleton = p_skeleton;
}
-void VisualServerCanvas::canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable, const Rect2 &p_rect) {
+void RenderingServerCanvas::canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable, const Rect2 &p_rect) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -961,14 +961,14 @@ void VisualServerCanvas::canvas_item_set_copy_to_backbuffer(RID p_item, bool p_e
}
}
-void VisualServerCanvas::canvas_item_clear(RID p_item) {
+void RenderingServerCanvas::canvas_item_clear(RID p_item) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->clear();
}
-void VisualServerCanvas::canvas_item_set_draw_index(RID p_item, int p_index) {
+void RenderingServerCanvas::canvas_item_set_draw_index(RID p_item, int p_index) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -988,7 +988,7 @@ void VisualServerCanvas::canvas_item_set_draw_index(RID p_item, int p_index) {
}
}
-void VisualServerCanvas::canvas_item_set_material(RID p_item, RID p_material) {
+void RenderingServerCanvas::canvas_item_set_material(RID p_item, RID p_material) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -996,7 +996,7 @@ void VisualServerCanvas::canvas_item_set_material(RID p_item, RID p_material) {
canvas_item->material = p_material;
}
-void VisualServerCanvas::canvas_item_set_use_parent_material(RID p_item, bool p_enable) {
+void RenderingServerCanvas::canvas_item_set_use_parent_material(RID p_item, bool p_enable) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -1004,13 +1004,13 @@ void VisualServerCanvas::canvas_item_set_use_parent_material(RID p_item, bool p_
canvas_item->use_parent_material = p_enable;
}
-RID VisualServerCanvas::canvas_light_create() {
+RID RenderingServerCanvas::canvas_light_create() {
RasterizerCanvas::Light *clight = memnew(RasterizerCanvas::Light);
- clight->light_internal = VSG::canvas_render->light_create();
+ clight->light_internal = RSG::canvas_render->light_create();
return canvas_light_owner.make_rid(clight);
}
-void VisualServerCanvas::canvas_light_attach_to_canvas(RID p_light, RID p_canvas) {
+void RenderingServerCanvas::canvas_light_attach_to_canvas(RID p_light, RID p_canvas) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
@@ -1033,65 +1033,65 @@ void VisualServerCanvas::canvas_light_attach_to_canvas(RID p_light, RID p_canvas
}
}
-void VisualServerCanvas::canvas_light_set_enabled(RID p_light, bool p_enabled) {
+void RenderingServerCanvas::canvas_light_set_enabled(RID p_light, bool p_enabled) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->enabled = p_enabled;
}
-void VisualServerCanvas::canvas_light_set_scale(RID p_light, float p_scale) {
+void RenderingServerCanvas::canvas_light_set_scale(RID p_light, float p_scale) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->scale = p_scale;
}
-void VisualServerCanvas::canvas_light_set_transform(RID p_light, const Transform2D &p_transform) {
+void RenderingServerCanvas::canvas_light_set_transform(RID p_light, const Transform2D &p_transform) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->xform = p_transform;
}
-void VisualServerCanvas::canvas_light_set_texture(RID p_light, RID p_texture) {
+void RenderingServerCanvas::canvas_light_set_texture(RID p_light, RID p_texture) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->texture = p_texture;
clight->version++;
- VSG::canvas_render->light_set_texture(clight->light_internal, p_texture);
+ RSG::canvas_render->light_set_texture(clight->light_internal, p_texture);
}
-void VisualServerCanvas::canvas_light_set_texture_offset(RID p_light, const Vector2 &p_offset) {
+void RenderingServerCanvas::canvas_light_set_texture_offset(RID p_light, const Vector2 &p_offset) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->texture_offset = p_offset;
}
-void VisualServerCanvas::canvas_light_set_color(RID p_light, const Color &p_color) {
+void RenderingServerCanvas::canvas_light_set_color(RID p_light, const Color &p_color) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->color = p_color;
}
-void VisualServerCanvas::canvas_light_set_height(RID p_light, float p_height) {
+void RenderingServerCanvas::canvas_light_set_height(RID p_light, float p_height) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->height = p_height;
}
-void VisualServerCanvas::canvas_light_set_energy(RID p_light, float p_energy) {
+void RenderingServerCanvas::canvas_light_set_energy(RID p_light, float p_energy) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->energy = p_energy;
}
-void VisualServerCanvas::canvas_light_set_z_range(RID p_light, int p_min_z, int p_max_z) {
+void RenderingServerCanvas::canvas_light_set_z_range(RID p_light, int p_min_z, int p_max_z) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
@@ -1099,7 +1099,7 @@ void VisualServerCanvas::canvas_light_set_z_range(RID p_light, int p_min_z, int
clight->z_min = p_min_z;
clight->z_max = p_max_z;
}
-void VisualServerCanvas::canvas_light_set_layer_range(RID p_light, int p_min_layer, int p_max_layer) {
+void RenderingServerCanvas::canvas_light_set_layer_range(RID p_light, int p_min_layer, int p_max_layer) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
@@ -1107,21 +1107,21 @@ void VisualServerCanvas::canvas_light_set_layer_range(RID p_light, int p_min_lay
clight->layer_max = p_max_layer;
clight->layer_min = p_min_layer;
}
-void VisualServerCanvas::canvas_light_set_item_cull_mask(RID p_light, int p_mask) {
+void RenderingServerCanvas::canvas_light_set_item_cull_mask(RID p_light, int p_mask) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->item_mask = p_mask;
}
-void VisualServerCanvas::canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask) {
+void RenderingServerCanvas::canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->item_shadow_mask = p_mask;
}
-void VisualServerCanvas::canvas_light_set_mode(RID p_light, VS::CanvasLightMode p_mode) {
+void RenderingServerCanvas::canvas_light_set_mode(RID p_light, RS::CanvasLightMode p_mode) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
@@ -1129,7 +1129,7 @@ void VisualServerCanvas::canvas_light_set_mode(RID p_light, VS::CanvasLightMode
clight->mode = p_mode;
}
-void VisualServerCanvas::canvas_light_set_shadow_enabled(RID p_light, bool p_enabled) {
+void RenderingServerCanvas::canvas_light_set_shadow_enabled(RID p_light, bool p_enabled) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
@@ -1139,10 +1139,10 @@ void VisualServerCanvas::canvas_light_set_shadow_enabled(RID p_light, bool p_ena
}
clight->use_shadow = p_enabled;
clight->version++;
- VSG::canvas_render->light_set_use_shadow(clight->light_internal, clight->use_shadow, clight->shadow_buffer_size);
+ RSG::canvas_render->light_set_use_shadow(clight->light_internal, clight->use_shadow, clight->shadow_buffer_size);
}
-void VisualServerCanvas::canvas_light_set_shadow_buffer_size(RID p_light, int p_size) {
+void RenderingServerCanvas::canvas_light_set_shadow_buffer_size(RID p_light, int p_size) {
ERR_FAIL_COND(p_size < 32 || p_size > 16384);
@@ -1156,17 +1156,17 @@ void VisualServerCanvas::canvas_light_set_shadow_buffer_size(RID p_light, int p_
clight->shadow_buffer_size = next_power_of_2(p_size);
clight->version++;
- VSG::canvas_render->light_set_use_shadow(clight->light_internal, clight->use_shadow, clight->shadow_buffer_size);
+ RSG::canvas_render->light_set_use_shadow(clight->light_internal, clight->use_shadow, clight->shadow_buffer_size);
}
-void VisualServerCanvas::canvas_light_set_shadow_filter(RID p_light, VS::CanvasLightShadowFilter p_filter) {
+void RenderingServerCanvas::canvas_light_set_shadow_filter(RID p_light, RS::CanvasLightShadowFilter p_filter) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->shadow_filter = p_filter;
}
-void VisualServerCanvas::canvas_light_set_shadow_color(RID p_light, const Color &p_color) {
+void RenderingServerCanvas::canvas_light_set_shadow_color(RID p_light, const Color &p_color) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
@@ -1174,20 +1174,20 @@ void VisualServerCanvas::canvas_light_set_shadow_color(RID p_light, const Color
clight->shadow_color = p_color;
}
-void VisualServerCanvas::canvas_light_set_shadow_smooth(RID p_light, float p_smooth) {
+void RenderingServerCanvas::canvas_light_set_shadow_smooth(RID p_light, float p_smooth) {
RasterizerCanvas::Light *clight = canvas_light_owner.getornull(p_light);
ERR_FAIL_COND(!clight);
clight->shadow_smooth = p_smooth;
}
-RID VisualServerCanvas::canvas_light_occluder_create() {
+RID RenderingServerCanvas::canvas_light_occluder_create() {
RasterizerCanvas::LightOccluderInstance *occluder = memnew(RasterizerCanvas::LightOccluderInstance);
return canvas_light_occluder_owner.make_rid(occluder);
}
-void VisualServerCanvas::canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas) {
+void RenderingServerCanvas::canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas) {
RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.getornull(p_occluder);
ERR_FAIL_COND(!occluder);
@@ -1209,14 +1209,14 @@ void VisualServerCanvas::canvas_light_occluder_attach_to_canvas(RID p_occluder,
canvas->occluders.insert(occluder);
}
}
-void VisualServerCanvas::canvas_light_occluder_set_enabled(RID p_occluder, bool p_enabled) {
+void RenderingServerCanvas::canvas_light_occluder_set_enabled(RID p_occluder, bool p_enabled) {
RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.getornull(p_occluder);
ERR_FAIL_COND(!occluder);
occluder->enabled = p_enabled;
}
-void VisualServerCanvas::canvas_light_occluder_set_polygon(RID p_occluder, RID p_polygon) {
+void RenderingServerCanvas::canvas_light_occluder_set_polygon(RID p_occluder, RID p_polygon) {
RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.getornull(p_occluder);
ERR_FAIL_COND(!occluder);
@@ -1244,14 +1244,14 @@ void VisualServerCanvas::canvas_light_occluder_set_polygon(RID p_occluder, RID p
}
}
}
-void VisualServerCanvas::canvas_light_occluder_set_transform(RID p_occluder, const Transform2D &p_xform) {
+void RenderingServerCanvas::canvas_light_occluder_set_transform(RID p_occluder, const Transform2D &p_xform) {
RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.getornull(p_occluder);
ERR_FAIL_COND(!occluder);
occluder->xform = p_xform;
}
-void VisualServerCanvas::canvas_light_occluder_set_light_mask(RID p_occluder, int p_mask) {
+void RenderingServerCanvas::canvas_light_occluder_set_light_mask(RID p_occluder, int p_mask) {
RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.getornull(p_occluder);
ERR_FAIL_COND(!occluder);
@@ -1259,13 +1259,13 @@ void VisualServerCanvas::canvas_light_occluder_set_light_mask(RID p_occluder, in
occluder->light_mask = p_mask;
}
-RID VisualServerCanvas::canvas_occluder_polygon_create() {
+RID RenderingServerCanvas::canvas_occluder_polygon_create() {
LightOccluderPolygon *occluder_poly = memnew(LightOccluderPolygon);
- occluder_poly->occluder = VSG::canvas_render->occluder_polygon_create();
+ occluder_poly->occluder = RSG::canvas_render->occluder_polygon_create();
return canvas_light_occluder_polygon_owner.make_rid(occluder_poly);
}
-void VisualServerCanvas::canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const Vector<Vector2> &p_shape, bool p_closed) {
+void RenderingServerCanvas::canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const Vector<Vector2> &p_shape, bool p_closed) {
if (p_shape.size() < 3) {
canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon, p_shape);
@@ -1295,7 +1295,7 @@ void VisualServerCanvas::canvas_occluder_polygon_set_shape(RID p_occluder_polygo
canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon, lines);
}
-void VisualServerCanvas::canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon, const Vector<Vector2> &p_shape) {
+void RenderingServerCanvas::canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon, const Vector<Vector2> &p_shape) {
LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.getornull(p_occluder_polygon);
ERR_FAIL_COND(!occluder_poly);
@@ -1313,24 +1313,24 @@ void VisualServerCanvas::canvas_occluder_polygon_set_shape_as_lines(RID p_occlud
}
}
- VSG::canvas_render->occluder_polygon_set_shape_as_lines(occluder_poly->occluder, p_shape);
+ RSG::canvas_render->occluder_polygon_set_shape_as_lines(occluder_poly->occluder, p_shape);
for (Set<RasterizerCanvas::LightOccluderInstance *>::Element *E = occluder_poly->owners.front(); E; E = E->next()) {
E->get()->aabb_cache = occluder_poly->aabb;
}
}
-void VisualServerCanvas::canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon, VS::CanvasOccluderPolygonCullMode p_mode) {
+void RenderingServerCanvas::canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon, RS::CanvasOccluderPolygonCullMode p_mode) {
LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.getornull(p_occluder_polygon);
ERR_FAIL_COND(!occluder_poly);
occluder_poly->cull_mode = p_mode;
- VSG::canvas_render->occluder_polygon_set_cull_mode(occluder_poly->occluder, p_mode);
+ RSG::canvas_render->occluder_polygon_set_cull_mode(occluder_poly->occluder, p_mode);
for (Set<RasterizerCanvas::LightOccluderInstance *>::Element *E = occluder_poly->owners.front(); E; E = E->next()) {
E->get()->cull_cache = p_mode;
}
}
-bool VisualServerCanvas::free(RID p_rid) {
+bool RenderingServerCanvas::free(RID p_rid) {
if (canvas_owner.owns(p_rid)) {
@@ -1339,10 +1339,10 @@ bool VisualServerCanvas::free(RID p_rid) {
while (canvas->viewports.size()) {
- VisualServerViewport::Viewport *vp = VSG::viewport->viewport_owner.getornull(canvas->viewports.front()->get());
+ RenderingServerViewport::Viewport *vp = RSG::viewport->viewport_owner.getornull(canvas->viewports.front()->get());
ERR_FAIL_COND_V(!vp, true);
- Map<RID, VisualServerViewport::Viewport::CanvasData>::Element *E = vp->canvas_map.find(p_rid);
+ Map<RID, RenderingServerViewport::Viewport::CanvasData>::Element *E = vp->canvas_map.find(p_rid);
ERR_FAIL_COND_V(!E, true);
vp->canvas_map.erase(p_rid);
@@ -1416,7 +1416,7 @@ bool VisualServerCanvas::free(RID p_rid) {
canvas->lights.erase(canvas_light);
}
- VSG::canvas_render->free(canvas_light->light_internal);
+ RSG::canvas_render->free(canvas_light->light_internal);
canvas_light_owner.free(p_rid);
memdelete(canvas_light);
@@ -1447,7 +1447,7 @@ bool VisualServerCanvas::free(RID p_rid) {
LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.getornull(p_rid);
ERR_FAIL_COND_V(!occluder_poly, true);
- VSG::canvas_render->free(occluder_poly->occluder);
+ RSG::canvas_render->free(occluder_poly->occluder);
while (occluder_poly->owners.size()) {
@@ -1464,7 +1464,7 @@ bool VisualServerCanvas::free(RID p_rid) {
return true;
}
-VisualServerCanvas::VisualServerCanvas() {
+RenderingServerCanvas::RenderingServerCanvas() {
z_list = (RasterizerCanvas::Item **)memalloc(z_range * sizeof(RasterizerCanvas::Item *));
z_last_list = (RasterizerCanvas::Item **)memalloc(z_range * sizeof(RasterizerCanvas::Item *));
@@ -1472,7 +1472,7 @@ VisualServerCanvas::VisualServerCanvas() {
disable_scale = false;
}
-VisualServerCanvas::~VisualServerCanvas() {
+RenderingServerCanvas::~RenderingServerCanvas() {
memfree(z_list);
memfree(z_last_list);
diff --git a/servers/visual/visual_server_canvas.h b/servers/rendering/rendering_server_canvas.h
index dea4183752..579bcd36e7 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/rendering/rendering_server_canvas.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_canvas.h */
+/* rendering_server_canvas.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -32,9 +32,9 @@
#define VISUALSERVERCANVAS_H
#include "rasterizer.h"
-#include "visual_server_viewport.h"
+#include "rendering_server_viewport.h"
-class VisualServerCanvas {
+class RenderingServerCanvas {
public:
struct Item : public RasterizerCanvas::Item {
@@ -52,8 +52,8 @@ public:
Color ysort_modulate;
Transform2D ysort_xform;
Vector2 ysort_pos;
- VS::CanvasItemTextureFilter texture_filter;
- VS::CanvasItemTextureRepeat texture_repeat;
+ RS::CanvasItemTextureFilter texture_filter;
+ RS::CanvasItemTextureRepeat texture_repeat;
Vector<Item *> child_items;
@@ -70,8 +70,8 @@ public:
ysort_children_count = -1;
ysort_xform = Transform2D();
ysort_pos = Vector2();
- texture_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT;
- texture_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT;
+ texture_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT;
+ texture_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT;
}
};
@@ -98,13 +98,13 @@ public:
bool active;
Rect2 aabb;
- VS::CanvasOccluderPolygonCullMode cull_mode;
+ RS::CanvasOccluderPolygonCullMode cull_mode;
RID occluder;
Set<RasterizerCanvas::LightOccluderInstance *> owners;
LightOccluderPolygon() {
active = false;
- cull_mode = VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
+ cull_mode = RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED;
}
};
@@ -112,7 +112,7 @@ public:
RID_PtrOwner<RasterizerCanvas::LightOccluderInstance> canvas_light_occluder_owner;
- struct Canvas : public VisualServerViewport::CanvasBase {
+ struct Canvas : public RenderingServerViewport::CanvasBase {
Set<RID> viewports;
struct ChildItem {
@@ -194,23 +194,23 @@ public:
void canvas_item_set_update_when_visible(RID p_item, bool p_update);
- void canvas_item_set_default_texture_filter(RID p_item, VS::CanvasItemTextureFilter p_filter);
- void canvas_item_set_default_texture_repeat(RID p_item, VS::CanvasItemTextureRepeat p_repeat);
+ void canvas_item_set_default_texture_filter(RID p_item, RS::CanvasItemTextureFilter p_filter);
+ void canvas_item_set_default_texture_repeat(RID p_item, RS::CanvasItemTextureRepeat p_repeat);
void canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width = 1.0);
void canvas_item_add_polyline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0);
void canvas_item_add_multiline(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0);
void canvas_item_add_rect(RID p_item, const Rect2 &p_rect, const Color &p_color);
void canvas_item_add_circle(RID p_item, const Point2 &p_pos, float p_radius, const Color &p_color);
- void canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), bool p_clip_uv = false, VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode = VS::NINE_PATCH_STRETCH, VS::NinePatchAxisMode p_y_axis_mode = VS::NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_mesh(RID p_item, const RID &p_mesh, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1), RID p_texture = RID(), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
- void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), VS::CanvasItemTextureFilter p_filter = VS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, VS::CanvasItemTextureRepeat p_repeat = VS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_texture_rect(RID p_item, const Rect2 &p_rect, RID p_texture, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), bool p_clip_uv = false, RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, RS::NinePatchAxisMode p_x_axis_mode = RS::NINE_PATCH_STRETCH, RS::NinePatchAxisMode p_y_axis_mode = RS::NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_mesh(RID p_item, const RID &p_mesh, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1), RID p_texture = RID(), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID(), RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
+ void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, RID p_specular_map = RID(), const Color &p_specular_color_shininess = Color(), RS::CanvasItemTextureFilter p_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CanvasItemTextureRepeat p_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT);
void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform);
void canvas_item_add_clip_ignore(RID p_item, bool p_ignore);
void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable);
@@ -241,11 +241,11 @@ public:
void canvas_light_set_item_cull_mask(RID p_light, int p_mask);
void canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask);
- void canvas_light_set_mode(RID p_light, VS::CanvasLightMode p_mode);
+ void canvas_light_set_mode(RID p_light, RS::CanvasLightMode p_mode);
void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled);
void canvas_light_set_shadow_buffer_size(RID p_light, int p_size);
- void canvas_light_set_shadow_filter(RID p_light, VS::CanvasLightShadowFilter p_filter);
+ void canvas_light_set_shadow_filter(RID p_light, RS::CanvasLightShadowFilter p_filter);
void canvas_light_set_shadow_color(RID p_light, const Color &p_color);
void canvas_light_set_shadow_smooth(RID p_light, float p_smooth);
@@ -260,11 +260,11 @@ public:
void canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const Vector<Vector2> &p_shape, bool p_closed);
void canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon, const Vector<Vector2> &p_shape);
- void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon, VS::CanvasOccluderPolygonCullMode p_mode);
+ void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon, RS::CanvasOccluderPolygonCullMode p_mode);
bool free(RID p_rid);
- VisualServerCanvas();
- ~VisualServerCanvas();
+ RenderingServerCanvas();
+ ~RenderingServerCanvas();
};
#endif // VISUALSERVERCANVAS_H
diff --git a/servers/visual/visual_server_globals.cpp b/servers/rendering/rendering_server_globals.cpp
index 248d27e08a..60183956e0 100644
--- a/servers/visual/visual_server_globals.cpp
+++ b/servers/rendering/rendering_server_globals.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_globals.cpp */
+/* rendering_server_globals.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server_globals.h"
+#include "rendering_server_globals.h"
-RasterizerStorage *VisualServerGlobals::storage = NULL;
-RasterizerCanvas *VisualServerGlobals::canvas_render = NULL;
-RasterizerScene *VisualServerGlobals::scene_render = NULL;
-Rasterizer *VisualServerGlobals::rasterizer = NULL;
+RasterizerStorage *RenderingServerGlobals::storage = NULL;
+RasterizerCanvas *RenderingServerGlobals::canvas_render = NULL;
+RasterizerScene *RenderingServerGlobals::scene_render = NULL;
+Rasterizer *RenderingServerGlobals::rasterizer = NULL;
-VisualServerCanvas *VisualServerGlobals::canvas = NULL;
-VisualServerViewport *VisualServerGlobals::viewport = NULL;
-VisualServerScene *VisualServerGlobals::scene = NULL;
+RenderingServerCanvas *RenderingServerGlobals::canvas = NULL;
+RenderingServerViewport *RenderingServerGlobals::viewport = NULL;
+RenderingServerScene *RenderingServerGlobals::scene = NULL;
diff --git a/servers/visual/visual_server_globals.h b/servers/rendering/rendering_server_globals.h
index 5a9d365eca..79abc55fea 100644
--- a/servers/visual/visual_server_globals.h
+++ b/servers/rendering/rendering_server_globals.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_globals.h */
+/* rendering_server_globals.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,27 +28,27 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef VISUAL_SERVER_GLOBALS_H
-#define VISUAL_SERVER_GLOBALS_H
+#ifndef RENDERING_SERVER_GLOBALS_H
+#define RENDERING_SERVER_GLOBALS_H
#include "rasterizer.h"
-class VisualServerCanvas;
-class VisualServerViewport;
-class VisualServerScene;
+class RenderingServerCanvas;
+class RenderingServerViewport;
+class RenderingServerScene;
-class VisualServerGlobals {
+class RenderingServerGlobals {
public:
static RasterizerStorage *storage;
static RasterizerCanvas *canvas_render;
static RasterizerScene *scene_render;
static Rasterizer *rasterizer;
- static VisualServerCanvas *canvas;
- static VisualServerViewport *viewport;
- static VisualServerScene *scene;
+ static RenderingServerCanvas *canvas;
+ static RenderingServerViewport *viewport;
+ static RenderingServerScene *scene;
};
-#define VSG VisualServerGlobals
+#define RSG RenderingServerGlobals
-#endif // VISUAL_SERVER_GLOBALS_H
+#endif // RENDERING_SERVER_GLOBALS_H
diff --git a/servers/visual/visual_server_raster.cpp b/servers/rendering/rendering_server_raster.cpp
index 1026972a62..9b769b46fc 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/rendering/rendering_server_raster.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_raster.cpp */
+/* rendering_server_raster.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,23 +28,23 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server_raster.h"
+#include "rendering_server_raster.h"
#include "core/io/marshalls.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "core/sort_array.h"
-#include "visual_server_canvas.h"
-#include "visual_server_globals.h"
-#include "visual_server_scene.h"
+#include "rendering_server_canvas.h"
+#include "rendering_server_globals.h"
+#include "rendering_server_scene.h"
// careful, these may run in different threads than the visual server
-int VisualServerRaster::changes = 0;
+int RenderingServerRaster::changes = 0;
/* BLACK BARS */
-void VisualServerRaster::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) {
+void RenderingServerRaster::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) {
black_margin[MARGIN_LEFT] = p_left;
black_margin[MARGIN_TOP] = p_top;
@@ -52,7 +52,7 @@ void VisualServerRaster::black_bars_set_margins(int p_left, int p_top, int p_rig
black_margin[MARGIN_BOTTOM] = p_bottom;
}
-void VisualServerRaster::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) {
+void RenderingServerRaster::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) {
black_image[MARGIN_LEFT] = p_left;
black_image[MARGIN_TOP] = p_top;
@@ -60,30 +60,30 @@ void VisualServerRaster::black_bars_set_images(RID p_left, RID p_top, RID p_righ
black_image[MARGIN_BOTTOM] = p_bottom;
}
-void VisualServerRaster::_draw_margins() {
+void RenderingServerRaster::_draw_margins() {
- VSG::canvas_render->draw_window_margins(black_margin, black_image);
+ RSG::canvas_render->draw_window_margins(black_margin, black_image);
};
/* FREE */
-void VisualServerRaster::free(RID p_rid) {
+void RenderingServerRaster::free(RID p_rid) {
- if (VSG::storage->free(p_rid))
+ if (RSG::storage->free(p_rid))
return;
- if (VSG::canvas->free(p_rid))
+ if (RSG::canvas->free(p_rid))
return;
- if (VSG::viewport->free(p_rid))
+ if (RSG::viewport->free(p_rid))
return;
- if (VSG::scene->free(p_rid))
+ if (RSG::scene->free(p_rid))
return;
- if (VSG::scene_render->free(p_rid))
+ if (RSG::scene_render->free(p_rid))
return;
}
/* EVENT QUEUING */
-void VisualServerRaster::request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata) {
+void RenderingServerRaster::request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata) {
ERR_FAIL_NULL(p_where);
FrameDrawnCallbacks fdc;
@@ -94,27 +94,27 @@ void VisualServerRaster::request_frame_drawn_callback(Object *p_where, const Str
frame_drawn_callbacks.push_back(fdc);
}
-void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) {
+void RenderingServerRaster::draw(bool p_swap_buffers, double frame_step) {
//needs to be done before changes is reset to 0, to not force the editor to redraw
- VS::get_singleton()->emit_signal("frame_pre_draw");
+ RS::get_singleton()->emit_signal("frame_pre_draw");
changes = 0;
- VSG::rasterizer->begin_frame(frame_step);
+ RSG::rasterizer->begin_frame(frame_step);
TIMESTAMP_BEGIN()
- VSG::scene_render->update(); //update scenes stuff before updating instances
+ RSG::scene_render->update(); //update scenes stuff before updating instances
- VSG::scene->update_dirty_instances(); //update scene stuff
+ RSG::scene->update_dirty_instances(); //update scene stuff
- VSG::scene->render_probes();
- VSG::viewport->draw_viewports();
- VSG::canvas_render->update();
+ RSG::scene->render_probes();
+ RSG::viewport->draw_viewports();
+ RSG::canvas_render->update();
_draw_margins();
- VSG::rasterizer->end_frame(p_swap_buffers);
+ RSG::rasterizer->end_frame(p_swap_buffers);
while (frame_drawn_callbacks.front()) {
@@ -131,128 +131,128 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) {
frame_drawn_callbacks.pop_front();
}
- VS::get_singleton()->emit_signal("frame_post_draw");
+ RS::get_singleton()->emit_signal("frame_post_draw");
- if (VSG::storage->get_captured_timestamps_count()) {
+ if (RSG::storage->get_captured_timestamps_count()) {
Vector<FrameProfileArea> new_profile;
- new_profile.resize(VSG::storage->get_captured_timestamps_count());
+ new_profile.resize(RSG::storage->get_captured_timestamps_count());
- uint64_t base_cpu = VSG::storage->get_captured_timestamp_cpu_time(0);
- uint64_t base_gpu = VSG::storage->get_captured_timestamp_gpu_time(0);
- for (uint32_t i = 0; i < VSG::storage->get_captured_timestamps_count(); i++) {
- uint64_t time_cpu = VSG::storage->get_captured_timestamp_cpu_time(i) - base_cpu;
- uint64_t time_gpu = VSG::storage->get_captured_timestamp_gpu_time(i) - base_gpu;
+ uint64_t base_cpu = RSG::storage->get_captured_timestamp_cpu_time(0);
+ uint64_t base_gpu = RSG::storage->get_captured_timestamp_gpu_time(0);
+ for (uint32_t i = 0; i < RSG::storage->get_captured_timestamps_count(); i++) {
+ uint64_t time_cpu = RSG::storage->get_captured_timestamp_cpu_time(i) - base_cpu;
+ uint64_t time_gpu = RSG::storage->get_captured_timestamp_gpu_time(i) - base_gpu;
new_profile.write[i].gpu_msec = float(time_gpu / 1000) / 1000.0;
new_profile.write[i].cpu_msec = float(time_cpu) / 1000.0;
- new_profile.write[i].name = VSG::storage->get_captured_timestamp_name(i);
+ new_profile.write[i].name = RSG::storage->get_captured_timestamp_name(i);
}
frame_profile = new_profile;
}
- frame_profile_frame = VSG::storage->get_captured_timestamps_frame();
+ frame_profile_frame = RSG::storage->get_captured_timestamps_frame();
}
-void VisualServerRaster::sync() {
+void RenderingServerRaster::sync() {
}
-bool VisualServerRaster::has_changed() const {
+bool RenderingServerRaster::has_changed() const {
return changes > 0;
}
-void VisualServerRaster::init() {
+void RenderingServerRaster::init() {
- VSG::rasterizer->initialize();
+ RSG::rasterizer->initialize();
}
-void VisualServerRaster::finish() {
+void RenderingServerRaster::finish() {
if (test_cube.is_valid()) {
free(test_cube);
}
- VSG::rasterizer->finalize();
+ RSG::rasterizer->finalize();
}
/* STATUS INFORMATION */
-int VisualServerRaster::get_render_info(RenderInfo p_info) {
+int RenderingServerRaster::get_render_info(RenderInfo p_info) {
- return VSG::storage->get_render_info(p_info);
+ return RSG::storage->get_render_info(p_info);
}
-String VisualServerRaster::get_video_adapter_name() const {
+String RenderingServerRaster::get_video_adapter_name() const {
- return VSG::storage->get_video_adapter_name();
+ return RSG::storage->get_video_adapter_name();
}
-String VisualServerRaster::get_video_adapter_vendor() const {
+String RenderingServerRaster::get_video_adapter_vendor() const {
- return VSG::storage->get_video_adapter_vendor();
+ return RSG::storage->get_video_adapter_vendor();
}
-void VisualServerRaster::set_frame_profiling_enabled(bool p_enable) {
- VSG::storage->capturing_timestamps = p_enable;
+void RenderingServerRaster::set_frame_profiling_enabled(bool p_enable) {
+ RSG::storage->capturing_timestamps = p_enable;
}
-uint64_t VisualServerRaster::get_frame_profile_frame() {
+uint64_t RenderingServerRaster::get_frame_profile_frame() {
return frame_profile_frame;
}
-Vector<VisualServer::FrameProfileArea> VisualServerRaster::get_frame_profile() {
+Vector<RenderingServer::FrameProfileArea> RenderingServerRaster::get_frame_profile() {
return frame_profile;
}
/* TESTING */
-void VisualServerRaster::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter) {
+void RenderingServerRaster::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter) {
redraw_request();
- VSG::rasterizer->set_boot_image(p_image, p_color, p_scale, p_use_filter);
+ RSG::rasterizer->set_boot_image(p_image, p_color, p_scale, p_use_filter);
}
-void VisualServerRaster::set_default_clear_color(const Color &p_color) {
- VSG::viewport->set_default_clear_color(p_color);
+void RenderingServerRaster::set_default_clear_color(const Color &p_color) {
+ RSG::viewport->set_default_clear_color(p_color);
}
-bool VisualServerRaster::has_feature(Features p_feature) const {
+bool RenderingServerRaster::has_feature(Features p_feature) const {
return false;
}
-RID VisualServerRaster::get_test_cube() {
+RID RenderingServerRaster::get_test_cube() {
if (!test_cube.is_valid()) {
test_cube = _make_test_cube();
}
return test_cube;
}
-bool VisualServerRaster::has_os_feature(const String &p_feature) const {
+bool RenderingServerRaster::has_os_feature(const String &p_feature) const {
- return VSG::storage->has_os_feature(p_feature);
+ return RSG::storage->has_os_feature(p_feature);
}
-void VisualServerRaster::set_debug_generate_wireframes(bool p_generate) {
+void RenderingServerRaster::set_debug_generate_wireframes(bool p_generate) {
- VSG::storage->set_debug_generate_wireframes(p_generate);
+ RSG::storage->set_debug_generate_wireframes(p_generate);
}
-void VisualServerRaster::call_set_use_vsync(bool p_enable) {
+void RenderingServerRaster::call_set_use_vsync(bool p_enable) {
DisplayServer::get_singleton()->_set_use_vsync(p_enable);
}
-bool VisualServerRaster::is_low_end() const {
+bool RenderingServerRaster::is_low_end() const {
// FIXME: Commented out when rebasing vulkan branch on master,
// causes a crash, it seems rasterizer is not initialized yet the
// first time it's called.
- //return VSG::rasterizer->is_low_end();
+ //return RSG::rasterizer->is_low_end();
return false;
}
-VisualServerRaster::VisualServerRaster() {
+RenderingServerRaster::RenderingServerRaster() {
- VSG::canvas = memnew(VisualServerCanvas);
- VSG::viewport = memnew(VisualServerViewport);
- VSG::scene = memnew(VisualServerScene);
- VSG::rasterizer = Rasterizer::create();
- VSG::storage = VSG::rasterizer->get_storage();
- VSG::canvas_render = VSG::rasterizer->get_canvas();
- VSG::scene_render = VSG::rasterizer->get_scene();
+ RSG::canvas = memnew(RenderingServerCanvas);
+ RSG::viewport = memnew(RenderingServerViewport);
+ RSG::scene = memnew(RenderingServerScene);
+ RSG::rasterizer = Rasterizer::create();
+ RSG::storage = RSG::rasterizer->get_storage();
+ RSG::canvas_render = RSG::rasterizer->get_canvas();
+ RSG::scene_render = RSG::rasterizer->get_scene();
frame_profile_frame = 0;
@@ -262,10 +262,10 @@ VisualServerRaster::VisualServerRaster() {
}
}
-VisualServerRaster::~VisualServerRaster() {
+RenderingServerRaster::~RenderingServerRaster() {
- memdelete(VSG::canvas);
- memdelete(VSG::viewport);
- memdelete(VSG::rasterizer);
- memdelete(VSG::scene);
+ memdelete(RSG::canvas);
+ memdelete(RSG::viewport);
+ memdelete(RSG::rasterizer);
+ memdelete(RSG::scene);
}
diff --git a/servers/visual/visual_server_raster.h b/servers/rendering/rendering_server_raster.h
index 1a40fc96a2..24fbe4577a 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/rendering/rendering_server_raster.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_raster.h */
+/* rendering_server_raster.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,18 +28,18 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef VISUAL_SERVER_RASTER_H
-#define VISUAL_SERVER_RASTER_H
+#ifndef RENDERING_SERVER_RASTER_H
+#define RENDERING_SERVER_RASTER_H
#include "core/math/octree.h"
-#include "servers/visual/rasterizer.h"
-#include "servers/visual_server.h"
-#include "visual_server_canvas.h"
-#include "visual_server_globals.h"
-#include "visual_server_scene.h"
-#include "visual_server_viewport.h"
+#include "rendering_server_canvas.h"
+#include "rendering_server_globals.h"
+#include "rendering_server_scene.h"
+#include "rendering_server_viewport.h"
+#include "servers/rendering/rasterizer.h"
+#include "servers/rendering_server.h"
-class VisualServerRaster : public VisualServer {
+class RenderingServerRaster : public RenderingServer {
enum {
@@ -145,7 +145,7 @@ public:
void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11, m_type12 arg12, m_type13 arg13, m_type14 arg14, m_type15 arg15) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); }
//from now on, calls forwarded to this singleton
-#define BINDBASE VSG::storage
+#define BINDBASE RSG::storage
/* TEXTURE API */
@@ -424,7 +424,7 @@ public:
BIND1(particles_request_process, RID)
BIND1(particles_restart, RID)
- BIND2(particles_set_draw_order, RID, VS::ParticlesDrawOrder)
+ BIND2(particles_set_draw_order, RID, RS::ParticlesDrawOrder)
BIND2(particles_set_draw_passes, RID, int)
BIND3(particles_set_draw_pass_mesh, RID, int, RID)
@@ -434,7 +434,7 @@ public:
#undef BINDBASE
//from now on, calls forwarded to this singleton
-#define BINDBASE VSG::scene
+#define BINDBASE RSG::scene
/* CAMERA API */
@@ -450,7 +450,7 @@ public:
#undef BINDBASE
//from now on, calls forwarded to this singleton
-#define BINDBASE VSG::viewport
+#define BINDBASE RSG::viewport
/* VIEWPORT TARGET API */
@@ -497,7 +497,7 @@ public:
#undef BINDBASE
//from now on, calls forwarded to this singleton
-#define BINDBASE VSG::scene_render
+#define BINDBASE RSG::scene_render
BIND1(directional_shadow_atlas_set_size, int)
@@ -552,7 +552,7 @@ public:
/* SCENARIO API */
#undef BINDBASE
-#define BINDBASE VSG::scene
+#define BINDBASE RSG::scene
BIND0R(RID, scenario_create)
@@ -595,7 +595,7 @@ public:
#undef BINDBASE
//from now on, calls forwarded to this singleton
-#define BINDBASE VSG::canvas
+#define BINDBASE RSG::canvas
/* CANVAS (2D) */
@@ -735,8 +735,8 @@ public:
virtual bool is_low_end() const;
- VisualServerRaster();
- ~VisualServerRaster();
+ RenderingServerRaster();
+ ~RenderingServerRaster();
#undef DISPLAY_CHANGED
diff --git a/servers/visual/visual_server_scene.cpp b/servers/rendering/rendering_server_scene.cpp
index 1a9ecae23a..0530846e95 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/rendering/rendering_server_scene.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_scene.cpp */
+/* rendering_server_scene.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,23 +28,23 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server_scene.h"
+#include "rendering_server_scene.h"
#include "core/os/os.h"
-#include "visual_server_globals.h"
-#include "visual_server_raster.h"
+#include "rendering_server_globals.h"
+#include "rendering_server_raster.h"
#include <new>
/* CAMERA API */
-RID VisualServerScene::camera_create() {
+RID RenderingServerScene::camera_create() {
Camera *camera = memnew(Camera);
return camera_owner.make_rid(camera);
}
-void VisualServerScene::camera_set_perspective(RID p_camera, float p_fovy_degrees, float p_z_near, float p_z_far) {
+void RenderingServerScene::camera_set_perspective(RID p_camera, float p_fovy_degrees, float p_z_near, float p_z_far) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
@@ -54,7 +54,7 @@ void VisualServerScene::camera_set_perspective(RID p_camera, float p_fovy_degree
camera->zfar = p_z_far;
}
-void VisualServerScene::camera_set_orthogonal(RID p_camera, float p_size, float p_z_near, float p_z_far) {
+void RenderingServerScene::camera_set_orthogonal(RID p_camera, float p_size, float p_z_near, float p_z_far) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
@@ -64,7 +64,7 @@ void VisualServerScene::camera_set_orthogonal(RID p_camera, float p_size, float
camera->zfar = p_z_far;
}
-void VisualServerScene::camera_set_frustum(RID p_camera, float p_size, Vector2 p_offset, float p_z_near, float p_z_far) {
+void RenderingServerScene::camera_set_frustum(RID p_camera, float p_size, Vector2 p_offset, float p_z_near, float p_z_far) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
camera->type = Camera::FRUSTUM;
@@ -74,14 +74,14 @@ void VisualServerScene::camera_set_frustum(RID p_camera, float p_size, Vector2 p
camera->zfar = p_z_far;
}
-void VisualServerScene::camera_set_transform(RID p_camera, const Transform &p_transform) {
+void RenderingServerScene::camera_set_transform(RID p_camera, const Transform &p_transform) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
camera->transform = p_transform.orthonormalized();
}
-void VisualServerScene::camera_set_cull_mask(RID p_camera, uint32_t p_layers) {
+void RenderingServerScene::camera_set_cull_mask(RID p_camera, uint32_t p_layers) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
@@ -89,21 +89,21 @@ void VisualServerScene::camera_set_cull_mask(RID p_camera, uint32_t p_layers) {
camera->visible_layers = p_layers;
}
-void VisualServerScene::camera_set_environment(RID p_camera, RID p_env) {
+void RenderingServerScene::camera_set_environment(RID p_camera, RID p_env) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
camera->env = p_env;
}
-void VisualServerScene::camera_set_camera_effects(RID p_camera, RID p_fx) {
+void RenderingServerScene::camera_set_camera_effects(RID p_camera, RID p_fx) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
camera->effects = p_fx;
}
-void VisualServerScene::camera_set_use_vertical_aspect(RID p_camera, bool p_enable) {
+void RenderingServerScene::camera_set_use_vertical_aspect(RID p_camera, bool p_enable) {
Camera *camera = camera_owner.getornull(p_camera);
ERR_FAIL_COND(!camera);
@@ -112,9 +112,9 @@ void VisualServerScene::camera_set_use_vertical_aspect(RID p_camera, bool p_enab
/* SCENARIO API */
-void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance *p_A, int, OctreeElementID, Instance *p_B, int) {
+void *RenderingServerScene::_instance_pair(void *p_self, OctreeElementID, Instance *p_A, int, OctreeElementID, Instance *p_B, int) {
- //VisualServerScene *self = (VisualServerScene*)p_self;
+ //RenderingServerScene *self = (RenderingServerScene*)p_self;
Instance *A = p_A;
Instance *B = p_B;
@@ -123,7 +123,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
SWAP(A, B); //lesser always first
}
- if (B->base_type == VS::INSTANCE_LIGHT && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ if (B->base_type == RS::INSTANCE_LIGHT && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceLightData *light = static_cast<InstanceLightData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -141,7 +141,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
geom->lighting_dirty = true;
return E; //this element should make freeing faster
- } else if (B->base_type == VS::INSTANCE_REFLECTION_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ } else if (B->base_type == RS::INSTANCE_REFLECTION_PROBE && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -155,7 +155,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
geom->reflection_dirty = true;
return E; //this element should make freeing faster
- } else if (B->base_type == VS::INSTANCE_LIGHTMAP_CAPTURE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ } else if (B->base_type == RS::INSTANCE_LIGHTMAP_CAPTURE && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceLightmapCaptureData *lightmap_capture = static_cast<InstanceLightmapCaptureData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -165,10 +165,10 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
pinfo.L = geom->lightmap_captures.push_back(B);
List<InstanceLightmapCaptureData::PairInfo>::Element *E = lightmap_capture->geometries.push_back(pinfo);
- ((VisualServerScene *)p_self)->_instance_queue_update(A, false, false); //need to update capture
+ ((RenderingServerScene *)p_self)->_instance_queue_update(A, false, false); //need to update capture
return E; //this element should make freeing faster
- } else if (B->base_type == VS::INSTANCE_GI_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ } else if (B->base_type == RS::INSTANCE_GI_PROBE && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -188,7 +188,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
return E; //this element should make freeing faster
- } else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) {
+ } else if (B->base_type == RS::INSTANCE_GI_PROBE && A->base_type == RS::INSTANCE_LIGHT) {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
return gi_probe->lights.insert(A);
@@ -196,9 +196,9 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
return NULL;
}
-void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance *p_A, int, OctreeElementID, Instance *p_B, int, void *udata) {
+void RenderingServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance *p_A, int, OctreeElementID, Instance *p_B, int, void *udata) {
- //VisualServerScene *self = (VisualServerScene*)p_self;
+ //RenderingServerScene *self = (RenderingServerScene*)p_self;
Instance *A = p_A;
Instance *B = p_B;
@@ -207,7 +207,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
SWAP(A, B); //lesser always first
}
- if (B->base_type == VS::INSTANCE_LIGHT && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ if (B->base_type == RS::INSTANCE_LIGHT && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceLightData *light = static_cast<InstanceLightData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -222,7 +222,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
}
geom->lighting_dirty = true;
- } else if (B->base_type == VS::INSTANCE_REFLECTION_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ } else if (B->base_type == RS::INSTANCE_REFLECTION_PROBE && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -233,7 +233,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
reflection_probe->geometries.erase(E);
geom->reflection_dirty = true;
- } else if (B->base_type == VS::INSTANCE_LIGHTMAP_CAPTURE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ } else if (B->base_type == RS::INSTANCE_LIGHTMAP_CAPTURE && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceLightmapCaptureData *lightmap_capture = static_cast<InstanceLightmapCaptureData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -242,9 +242,9 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
geom->lightmap_captures.erase(E->get().L);
lightmap_capture->geometries.erase(E);
- ((VisualServerScene *)p_self)->_instance_queue_update(A, false, false); //need to update capture
+ ((RenderingServerScene *)p_self)->_instance_queue_update(A, false, false); //need to update capture
- } else if (B->base_type == VS::INSTANCE_GI_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) {
+ } else if (B->base_type == RS::INSTANCE_GI_PROBE && ((1 << A->base_type) & RS::INSTANCE_GEOMETRY_MASK)) {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data);
@@ -260,7 +260,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
geom->gi_probes_dirty = true;
- } else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) {
+ } else if (B->base_type == RS::INSTANCE_GI_PROBE && A->base_type == RS::INSTANCE_LIGHT) {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
Set<Instance *>::Element *E = reinterpret_cast<Set<Instance *>::Element *>(udata);
@@ -269,7 +269,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
}
}
-RID VisualServerScene::scenario_create() {
+RID RenderingServerScene::scenario_create() {
Scenario *scenario = memnew(Scenario);
ERR_FAIL_COND_V(!scenario, RID());
@@ -278,54 +278,54 @@ RID VisualServerScene::scenario_create() {
scenario->octree.set_pair_callback(_instance_pair, this);
scenario->octree.set_unpair_callback(_instance_unpair, this);
- scenario->reflection_probe_shadow_atlas = VSG::scene_render->shadow_atlas_create();
- VSG::scene_render->shadow_atlas_set_size(scenario->reflection_probe_shadow_atlas, 1024); //make enough shadows for close distance, don't bother with rest
- VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 0, 4);
- VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 1, 4);
- VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 2, 4);
- VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 3, 8);
- scenario->reflection_atlas = VSG::scene_render->reflection_atlas_create();
+ scenario->reflection_probe_shadow_atlas = RSG::scene_render->shadow_atlas_create();
+ RSG::scene_render->shadow_atlas_set_size(scenario->reflection_probe_shadow_atlas, 1024); //make enough shadows for close distance, don't bother with rest
+ RSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 0, 4);
+ RSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 1, 4);
+ RSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 2, 4);
+ RSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas, 3, 8);
+ scenario->reflection_atlas = RSG::scene_render->reflection_atlas_create();
return scenario_rid;
}
-void VisualServerScene::scenario_set_debug(RID p_scenario, VS::ScenarioDebugMode p_debug_mode) {
+void RenderingServerScene::scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND(!scenario);
scenario->debug = p_debug_mode;
}
-void VisualServerScene::scenario_set_environment(RID p_scenario, RID p_environment) {
+void RenderingServerScene::scenario_set_environment(RID p_scenario, RID p_environment) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND(!scenario);
scenario->environment = p_environment;
}
-void VisualServerScene::scenario_set_camera_effects(RID p_scenario, RID p_camera_effects) {
+void RenderingServerScene::scenario_set_camera_effects(RID p_scenario, RID p_camera_effects) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND(!scenario);
scenario->camera_effects = p_camera_effects;
}
-void VisualServerScene::scenario_set_fallback_environment(RID p_scenario, RID p_environment) {
+void RenderingServerScene::scenario_set_fallback_environment(RID p_scenario, RID p_environment) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND(!scenario);
scenario->fallback_environment = p_environment;
}
-void VisualServerScene::scenario_set_reflection_atlas_size(RID p_scenario, int p_reflection_size, int p_reflection_count) {
+void RenderingServerScene::scenario_set_reflection_atlas_size(RID p_scenario, int p_reflection_size, int p_reflection_count) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND(!scenario);
- VSG::scene_render->reflection_atlas_set_size(scenario->reflection_atlas, p_reflection_size, p_reflection_count);
+ RSG::scene_render->reflection_atlas_set_size(scenario->reflection_atlas, p_reflection_size, p_reflection_count);
}
/* INSTANCING API */
-void VisualServerScene::_instance_queue_update(Instance *p_instance, bool p_update_aabb, bool p_update_dependencies) {
+void RenderingServerScene::_instance_queue_update(Instance *p_instance, bool p_update_aabb, bool p_update_dependencies) {
if (p_update_aabb)
p_instance->update_aabb = true;
@@ -338,7 +338,7 @@ void VisualServerScene::_instance_queue_update(Instance *p_instance, bool p_upda
_instance_update_list.add(&p_instance->update_item);
}
-RID VisualServerScene::instance_create() {
+RID RenderingServerScene::instance_create() {
Instance *instance = memnew(Instance);
ERR_FAIL_COND_V(!instance, RID());
@@ -349,14 +349,14 @@ RID VisualServerScene::instance_create() {
return instance_rid;
}
-void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
+void RenderingServerScene::instance_set_base(RID p_instance, RID p_base) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
Scenario *scenario = instance->scenario;
- if (instance->base_type != VS::INSTANCE_NONE) {
+ if (instance->base_type != RS::INSTANCE_NONE) {
//free anything related to that base
if (scenario && instance->octree_id) {
@@ -365,7 +365,7 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
}
switch (instance->base_type) {
- case VS::INSTANCE_LIGHT: {
+ case RS::INSTANCE_LIGHT: {
InstanceLightData *light = static_cast<InstanceLightData *>(instance->base_data);
#ifdef DEBUG_ENABLED
@@ -377,17 +377,17 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
instance->scenario->directional_lights.erase(light->D);
light->D = NULL;
}
- VSG::scene_render->free(light->instance);
+ RSG::scene_render->free(light->instance);
} break;
- case VS::INSTANCE_REFLECTION_PROBE: {
+ case RS::INSTANCE_REFLECTION_PROBE: {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(instance->base_data);
- VSG::scene_render->free(reflection_probe->instance);
+ RSG::scene_render->free(reflection_probe->instance);
if (reflection_probe->update_list.in_list()) {
reflection_probe_render_list.remove(&reflection_probe->update_list);
}
} break;
- case VS::INSTANCE_LIGHTMAP_CAPTURE: {
+ case RS::INSTANCE_LIGHTMAP_CAPTURE: {
InstanceLightmapCaptureData *lightmap_capture = static_cast<InstanceLightmapCaptureData *>(instance->base_data);
//erase dependencies, since no longer a lightmap
@@ -395,7 +395,7 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
instance_set_use_lightmap(lightmap_capture->users.front()->get()->self, RID(), RID());
}
} break;
- case VS::INSTANCE_GI_PROBE: {
+ case RS::INSTANCE_GI_PROBE: {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(instance->base_data);
#ifdef DEBUG_ENABLED
@@ -420,7 +420,7 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
instance->lightmap = RID();
}
- VSG::scene_render->free(gi_probe->probe_instance);
+ RSG::scene_render->free(gi_probe->probe_instance);
} break;
default: {
@@ -436,53 +436,53 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
instance->materials.clear();
}
- instance->base_type = VS::INSTANCE_NONE;
+ instance->base_type = RS::INSTANCE_NONE;
instance->base = RID();
if (p_base.is_valid()) {
- instance->base_type = VSG::storage->get_base_type(p_base);
- ERR_FAIL_COND(instance->base_type == VS::INSTANCE_NONE);
+ instance->base_type = RSG::storage->get_base_type(p_base);
+ ERR_FAIL_COND(instance->base_type == RS::INSTANCE_NONE);
switch (instance->base_type) {
- case VS::INSTANCE_LIGHT: {
+ case RS::INSTANCE_LIGHT: {
InstanceLightData *light = memnew(InstanceLightData);
- if (scenario && VSG::storage->light_get_type(p_base) == VS::LIGHT_DIRECTIONAL) {
+ if (scenario && RSG::storage->light_get_type(p_base) == RS::LIGHT_DIRECTIONAL) {
light->D = scenario->directional_lights.push_back(instance);
}
- light->instance = VSG::scene_render->light_instance_create(p_base);
+ light->instance = RSG::scene_render->light_instance_create(p_base);
instance->base_data = light;
} break;
- case VS::INSTANCE_MESH:
- case VS::INSTANCE_MULTIMESH:
- case VS::INSTANCE_IMMEDIATE:
- case VS::INSTANCE_PARTICLES: {
+ case RS::INSTANCE_MESH:
+ case RS::INSTANCE_MULTIMESH:
+ case RS::INSTANCE_IMMEDIATE:
+ case RS::INSTANCE_PARTICLES: {
InstanceGeometryData *geom = memnew(InstanceGeometryData);
instance->base_data = geom;
- if (instance->base_type == VS::INSTANCE_MESH) {
- instance->blend_values.resize(VSG::storage->mesh_get_blend_shape_count(p_base));
+ if (instance->base_type == RS::INSTANCE_MESH) {
+ instance->blend_values.resize(RSG::storage->mesh_get_blend_shape_count(p_base));
}
} break;
- case VS::INSTANCE_REFLECTION_PROBE: {
+ case RS::INSTANCE_REFLECTION_PROBE: {
InstanceReflectionProbeData *reflection_probe = memnew(InstanceReflectionProbeData);
reflection_probe->owner = instance;
instance->base_data = reflection_probe;
- reflection_probe->instance = VSG::scene_render->reflection_probe_instance_create(p_base);
+ reflection_probe->instance = RSG::scene_render->reflection_probe_instance_create(p_base);
} break;
- case VS::INSTANCE_LIGHTMAP_CAPTURE: {
+ case RS::INSTANCE_LIGHTMAP_CAPTURE: {
InstanceLightmapCaptureData *lightmap_capture = memnew(InstanceLightmapCaptureData);
instance->base_data = lightmap_capture;
- //lightmap_capture->instance = VSG::scene_render->lightmap_capture_instance_create(p_base);
+ //lightmap_capture->instance = RSG::scene_render->lightmap_capture_instance_create(p_base);
} break;
- case VS::INSTANCE_GI_PROBE: {
+ case RS::INSTANCE_GI_PROBE: {
InstanceGIProbeData *gi_probe = memnew(InstanceGIProbeData);
instance->base_data = gi_probe;
@@ -492,7 +492,7 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
gi_probe_update_list.add(&gi_probe->update_element);
}
- gi_probe->probe_instance = VSG::scene_render->gi_probe_instance_create(p_base);
+ gi_probe->probe_instance = RSG::scene_render->gi_probe_instance_create(p_base);
} break;
default: {
@@ -502,12 +502,12 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
instance->base = p_base;
//forcefully update the dependency now, so if for some reason it gets removed, we can immediately clear it
- VSG::storage->base_update_dependency(p_base, instance);
+ RSG::storage->base_update_dependency(p_base, instance);
}
_instance_queue_update(instance, true, true);
}
-void VisualServerScene::instance_set_scenario(RID p_instance, RID p_scenario) {
+void RenderingServerScene::instance_set_scenario(RID p_instance, RID p_scenario) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -523,7 +523,7 @@ void VisualServerScene::instance_set_scenario(RID p_instance, RID p_scenario) {
switch (instance->base_type) {
- case VS::INSTANCE_LIGHT: {
+ case RS::INSTANCE_LIGHT: {
InstanceLightData *light = static_cast<InstanceLightData *>(instance->base_data);
#ifdef DEBUG_ENABLED
@@ -536,12 +536,12 @@ void VisualServerScene::instance_set_scenario(RID p_instance, RID p_scenario) {
light->D = NULL;
}
} break;
- case VS::INSTANCE_REFLECTION_PROBE: {
+ case RS::INSTANCE_REFLECTION_PROBE: {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(instance->base_data);
- VSG::scene_render->reflection_probe_release_atlas_index(reflection_probe->instance);
+ RSG::scene_render->reflection_probe_release_atlas_index(reflection_probe->instance);
} break;
- case VS::INSTANCE_GI_PROBE: {
+ case RS::INSTANCE_GI_PROBE: {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(instance->base_data);
@@ -578,15 +578,15 @@ void VisualServerScene::instance_set_scenario(RID p_instance, RID p_scenario) {
switch (instance->base_type) {
- case VS::INSTANCE_LIGHT: {
+ case RS::INSTANCE_LIGHT: {
InstanceLightData *light = static_cast<InstanceLightData *>(instance->base_data);
- if (VSG::storage->light_get_type(instance->base) == VS::LIGHT_DIRECTIONAL) {
+ if (RSG::storage->light_get_type(instance->base) == RS::LIGHT_DIRECTIONAL) {
light->D = scenario->directional_lights.push_back(instance);
}
} break;
- case VS::INSTANCE_GI_PROBE: {
+ case RS::INSTANCE_GI_PROBE: {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(instance->base_data);
if (!gi_probe->update_element.in_list()) {
@@ -600,14 +600,14 @@ void VisualServerScene::instance_set_scenario(RID p_instance, RID p_scenario) {
_instance_queue_update(instance, true, true);
}
}
-void VisualServerScene::instance_set_layer_mask(RID p_instance, uint32_t p_mask) {
+void RenderingServerScene::instance_set_layer_mask(RID p_instance, uint32_t p_mask) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
instance->layer_mask = p_mask;
}
-void VisualServerScene::instance_set_transform(RID p_instance, const Transform &p_transform) {
+void RenderingServerScene::instance_set_transform(RID p_instance, const Transform &p_transform) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -631,14 +631,14 @@ void VisualServerScene::instance_set_transform(RID p_instance, const Transform &
instance->transform = p_transform;
_instance_queue_update(instance, true);
}
-void VisualServerScene::instance_attach_object_instance_id(RID p_instance, ObjectID p_id) {
+void RenderingServerScene::instance_attach_object_instance_id(RID p_instance, ObjectID p_id) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
instance->object_id = p_id;
}
-void VisualServerScene::instance_set_blend_shape_weight(RID p_instance, int p_shape, float p_weight) {
+void RenderingServerScene::instance_set_blend_shape_weight(RID p_instance, int p_shape, float p_weight) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -651,14 +651,14 @@ void VisualServerScene::instance_set_blend_shape_weight(RID p_instance, int p_sh
instance->blend_values.write[p_shape] = p_weight;
}
-void VisualServerScene::instance_set_surface_material(RID p_instance, int p_surface, RID p_material) {
+void RenderingServerScene::instance_set_surface_material(RID p_instance, int p_surface, RID p_material) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
- if (instance->base_type == VS::INSTANCE_MESH) {
+ if (instance->base_type == RS::INSTANCE_MESH) {
//may not have been updated yet, may also have not been set yet. When updated will be correcte, worst case
- instance->materials.resize(MAX(p_surface + 1, VSG::storage->mesh_get_surface_count(instance->base)));
+ instance->materials.resize(MAX(p_surface + 1, RSG::storage->mesh_get_surface_count(instance->base)));
}
ERR_FAIL_INDEX(p_surface, instance->materials.size());
@@ -668,7 +668,7 @@ void VisualServerScene::instance_set_surface_material(RID p_instance, int p_surf
_instance_queue_update(instance, false, true);
}
-void VisualServerScene::instance_set_visible(RID p_instance, bool p_visible) {
+void RenderingServerScene::instance_set_visible(RID p_instance, bool p_visible) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -679,27 +679,27 @@ void VisualServerScene::instance_set_visible(RID p_instance, bool p_visible) {
instance->visible = p_visible;
switch (instance->base_type) {
- case VS::INSTANCE_LIGHT: {
- if (VSG::storage->light_get_type(instance->base) != VS::LIGHT_DIRECTIONAL && instance->octree_id && instance->scenario) {
- instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << VS::INSTANCE_LIGHT, p_visible ? VS::INSTANCE_GEOMETRY_MASK : 0);
+ case RS::INSTANCE_LIGHT: {
+ if (RSG::storage->light_get_type(instance->base) != RS::LIGHT_DIRECTIONAL && instance->octree_id && instance->scenario) {
+ instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << RS::INSTANCE_LIGHT, p_visible ? RS::INSTANCE_GEOMETRY_MASK : 0);
}
} break;
- case VS::INSTANCE_REFLECTION_PROBE: {
+ case RS::INSTANCE_REFLECTION_PROBE: {
if (instance->octree_id && instance->scenario) {
- instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << VS::INSTANCE_REFLECTION_PROBE, p_visible ? VS::INSTANCE_GEOMETRY_MASK : 0);
+ instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << RS::INSTANCE_REFLECTION_PROBE, p_visible ? RS::INSTANCE_GEOMETRY_MASK : 0);
}
} break;
- case VS::INSTANCE_LIGHTMAP_CAPTURE: {
+ case RS::INSTANCE_LIGHTMAP_CAPTURE: {
if (instance->octree_id && instance->scenario) {
- instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << VS::INSTANCE_LIGHTMAP_CAPTURE, p_visible ? VS::INSTANCE_GEOMETRY_MASK : 0);
+ instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << RS::INSTANCE_LIGHTMAP_CAPTURE, p_visible ? RS::INSTANCE_GEOMETRY_MASK : 0);
}
} break;
- case VS::INSTANCE_GI_PROBE: {
+ case RS::INSTANCE_GI_PROBE: {
if (instance->octree_id && instance->scenario) {
- instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << VS::INSTANCE_GI_PROBE, p_visible ? (VS::INSTANCE_GEOMETRY_MASK | (1 << VS::INSTANCE_LIGHT)) : 0);
+ instance->scenario->octree.set_pairable(instance->octree_id, p_visible, 1 << RS::INSTANCE_GI_PROBE, p_visible ? (RS::INSTANCE_GEOMETRY_MASK | (1 << RS::INSTANCE_LIGHT)) : 0);
}
} break;
@@ -707,11 +707,11 @@ void VisualServerScene::instance_set_visible(RID p_instance, bool p_visible) {
}
}
}
-inline bool is_geometry_instance(VisualServer::InstanceType p_type) {
- return p_type == VS::INSTANCE_MESH || p_type == VS::INSTANCE_MULTIMESH || p_type == VS::INSTANCE_PARTICLES || p_type == VS::INSTANCE_IMMEDIATE;
+inline bool is_geometry_instance(RenderingServer::InstanceType p_type) {
+ return p_type == RS::INSTANCE_MESH || p_type == RS::INSTANCE_MULTIMESH || p_type == RS::INSTANCE_PARTICLES || p_type == RS::INSTANCE_IMMEDIATE;
}
-void VisualServerScene::instance_set_use_lightmap(RID p_instance, RID p_lightmap_instance, RID p_lightmap) {
+void RenderingServerScene::instance_set_use_lightmap(RID p_instance, RID p_lightmap_instance, RID p_lightmap) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -726,7 +726,7 @@ void VisualServerScene::instance_set_use_lightmap(RID p_instance, RID p_lightmap
if (p_lightmap_instance.is_valid()) {
Instance *lightmap_instance = instance_owner.getornull(p_lightmap_instance);
ERR_FAIL_COND(!lightmap_instance);
- ERR_FAIL_COND(lightmap_instance->base_type != VS::INSTANCE_LIGHTMAP_CAPTURE);
+ ERR_FAIL_COND(lightmap_instance->base_type != RS::INSTANCE_LIGHTMAP_CAPTURE);
instance->lightmap_capture = lightmap_instance;
InstanceLightmapCaptureData *lightmap_capture = static_cast<InstanceLightmapCaptureData *>(((Instance *)instance->lightmap_capture)->base_data);
@@ -735,7 +735,7 @@ void VisualServerScene::instance_set_use_lightmap(RID p_instance, RID p_lightmap
}
}
-void VisualServerScene::instance_set_custom_aabb(RID p_instance, AABB p_aabb) {
+void RenderingServerScene::instance_set_custom_aabb(RID p_instance, AABB p_aabb) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -761,7 +761,7 @@ void VisualServerScene::instance_set_custom_aabb(RID p_instance, AABB p_aabb) {
_instance_queue_update(instance, true, false);
}
-void VisualServerScene::instance_attach_skeleton(RID p_instance, RID p_skeleton) {
+void RenderingServerScene::instance_attach_skeleton(RID p_instance, RID p_skeleton) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -773,15 +773,15 @@ void VisualServerScene::instance_attach_skeleton(RID p_instance, RID p_skeleton)
if (p_skeleton.is_valid()) {
//update the dependency now, so if cleared, we remove it
- VSG::storage->skeleton_update_dependency(p_skeleton, instance);
+ RSG::storage->skeleton_update_dependency(p_skeleton, instance);
}
_instance_queue_update(instance, true, true);
}
-void VisualServerScene::instance_set_exterior(RID p_instance, bool p_enabled) {
+void RenderingServerScene::instance_set_exterior(RID p_instance, bool p_enabled) {
}
-void VisualServerScene::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) {
+void RenderingServerScene::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -789,13 +789,13 @@ void VisualServerScene::instance_set_extra_visibility_margin(RID p_instance, rea
_instance_queue_update(instance, true, false);
}
-Vector<ObjectID> VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const {
+Vector<ObjectID> RenderingServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const {
Vector<ObjectID> instances;
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND_V(!scenario, instances);
- const_cast<VisualServerScene *>(this)->update_dirty_instances(); // check dirty instances before culling
+ const_cast<RenderingServerScene *>(this)->update_dirty_instances(); // check dirty instances before culling
int culled = 0;
Instance *cull[1024];
@@ -813,12 +813,12 @@ Vector<ObjectID> VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID
return instances;
}
-Vector<ObjectID> VisualServerScene::instances_cull_ray(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
+Vector<ObjectID> RenderingServerScene::instances_cull_ray(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
Vector<ObjectID> instances;
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND_V(!scenario, instances);
- const_cast<VisualServerScene *>(this)->update_dirty_instances(); // check dirty instances before culling
+ const_cast<RenderingServerScene *>(this)->update_dirty_instances(); // check dirty instances before culling
int culled = 0;
Instance *cull[1024];
@@ -835,12 +835,12 @@ Vector<ObjectID> VisualServerScene::instances_cull_ray(const Vector3 &p_from, co
return instances;
}
-Vector<ObjectID> VisualServerScene::instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario) const {
+Vector<ObjectID> RenderingServerScene::instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario) const {
Vector<ObjectID> instances;
Scenario *scenario = scenario_owner.getornull(p_scenario);
ERR_FAIL_COND_V(!scenario, instances);
- const_cast<VisualServerScene *>(this)->update_dirty_instances(); // check dirty instances before culling
+ const_cast<RenderingServerScene *>(this)->update_dirty_instances(); // check dirty instances before culling
int culled = 0;
Instance *cull[1024];
@@ -860,21 +860,21 @@ Vector<ObjectID> VisualServerScene::instances_cull_convex(const Vector<Plane> &p
return instances;
}
-void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceFlags p_flags, bool p_enabled) {
+void RenderingServerScene::instance_geometry_set_flag(RID p_instance, RS::InstanceFlags p_flags, bool p_enabled) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
- //ERR_FAIL_COND(((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK));
+ //ERR_FAIL_COND(((1 << instance->base_type) & RS::INSTANCE_GEOMETRY_MASK));
switch (p_flags) {
- case VS::INSTANCE_FLAG_USE_BAKED_LIGHT: {
+ case RS::INSTANCE_FLAG_USE_BAKED_LIGHT: {
instance->baked_light = p_enabled;
} break;
- case VS::INSTANCE_FLAG_USE_DYNAMIC_GI: {
+ case RS::INSTANCE_FLAG_USE_DYNAMIC_GI: {
if (p_enabled == instance->dynamic_gi) {
//bye, redundant
@@ -892,7 +892,7 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF
instance->dynamic_gi = p_enabled;
} break;
- case VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE: {
+ case RS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE: {
instance->redraw_if_visible = p_enabled;
@@ -901,7 +901,7 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF
}
}
}
-void VisualServerScene::instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting) {
+void RenderingServerScene::instance_geometry_set_cast_shadows_setting(RID p_instance, RS::ShadowCastingSetting p_shadow_casting_setting) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -909,7 +909,7 @@ void VisualServerScene::instance_geometry_set_cast_shadows_setting(RID p_instanc
instance->cast_shadows = p_shadow_casting_setting;
_instance_queue_update(instance, false, true);
}
-void VisualServerScene::instance_geometry_set_material_override(RID p_instance, RID p_material) {
+void RenderingServerScene::instance_geometry_set_material_override(RID p_instance, RID p_material) {
Instance *instance = instance_owner.getornull(p_instance);
ERR_FAIL_COND(!instance);
@@ -918,48 +918,48 @@ void VisualServerScene::instance_geometry_set_material_override(RID p_instance,
_instance_queue_update(instance, false, true);
}
-void VisualServerScene::instance_geometry_set_draw_range(RID p_instance, float p_min, float p_max, float p_min_margin, float p_max_margin) {
+void RenderingServerScene::instance_geometry_set_draw_range(RID p_instance, float p_min, float p_max, float p_min_margin, float p_max_margin) {
}
-void VisualServerScene::instance_geometry_set_as_instance_lod(RID p_instance, RID p_as_lod_of_instance) {
+void RenderingServerScene::instance_geometry_set_as_instance_lod(RID p_instance, RID p_as_lod_of_instance) {
}
-void VisualServerScene::_update_instance(Instance *p_instance) {
+void RenderingServerScene::_update_instance(Instance *p_instance) {
p_instance->version++;
- if (p_instance->base_type == VS::INSTANCE_LIGHT) {
+ if (p_instance->base_type == RS::INSTANCE_LIGHT) {
InstanceLightData *light = static_cast<InstanceLightData *>(p_instance->base_data);
- VSG::scene_render->light_instance_set_transform(light->instance, p_instance->transform);
+ RSG::scene_render->light_instance_set_transform(light->instance, p_instance->transform);
light->shadow_dirty = true;
}
- if (p_instance->base_type == VS::INSTANCE_REFLECTION_PROBE) {
+ if (p_instance->base_type == RS::INSTANCE_REFLECTION_PROBE) {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(p_instance->base_data);
- VSG::scene_render->reflection_probe_instance_set_transform(reflection_probe->instance, p_instance->transform);
+ RSG::scene_render->reflection_probe_instance_set_transform(reflection_probe->instance, p_instance->transform);
reflection_probe->reflection_dirty = true;
}
- if (p_instance->base_type == VS::INSTANCE_GI_PROBE) {
+ if (p_instance->base_type == RS::INSTANCE_GI_PROBE) {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(p_instance->base_data);
- VSG::scene_render->gi_probe_instance_set_transform_to_data(gi_probe->probe_instance, p_instance->transform);
+ RSG::scene_render->gi_probe_instance_set_transform_to_data(gi_probe->probe_instance, p_instance->transform);
}
- if (p_instance->base_type == VS::INSTANCE_PARTICLES) {
+ if (p_instance->base_type == RS::INSTANCE_PARTICLES) {
- VSG::storage->particles_set_emission_transform(p_instance->base, p_instance->transform);
+ RSG::storage->particles_set_emission_transform(p_instance->base, p_instance->transform);
}
if (p_instance->aabb.has_no_surface()) {
return;
}
- if ((1 << p_instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) {
+ if ((1 << p_instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) {
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(p_instance->base_data);
//make sure lights are updated if it casts shadow
@@ -1000,15 +1000,15 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
uint32_t pairable_mask = 0;
bool pairable = false;
- if (p_instance->base_type == VS::INSTANCE_LIGHT || p_instance->base_type == VS::INSTANCE_REFLECTION_PROBE || p_instance->base_type == VS::INSTANCE_LIGHTMAP_CAPTURE) {
+ if (p_instance->base_type == RS::INSTANCE_LIGHT || p_instance->base_type == RS::INSTANCE_REFLECTION_PROBE || p_instance->base_type == RS::INSTANCE_LIGHTMAP_CAPTURE) {
- pairable_mask = p_instance->visible ? VS::INSTANCE_GEOMETRY_MASK : 0;
+ pairable_mask = p_instance->visible ? RS::INSTANCE_GEOMETRY_MASK : 0;
pairable = true;
}
- if (p_instance->base_type == VS::INSTANCE_GI_PROBE) {
+ if (p_instance->base_type == RS::INSTANCE_GI_PROBE) {
//lights and geometries
- pairable_mask = p_instance->visible ? VS::INSTANCE_GEOMETRY_MASK | (1 << VS::INSTANCE_LIGHT) : 0;
+ pairable_mask = p_instance->visible ? RS::INSTANCE_GEOMETRY_MASK | (1 << RS::INSTANCE_LIGHT) : 0;
pairable = true;
}
@@ -1026,68 +1026,68 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
}
}
-void VisualServerScene::_update_instance_aabb(Instance *p_instance) {
+void RenderingServerScene::_update_instance_aabb(Instance *p_instance) {
AABB new_aabb;
- ERR_FAIL_COND(p_instance->base_type != VS::INSTANCE_NONE && !p_instance->base.is_valid());
+ ERR_FAIL_COND(p_instance->base_type != RS::INSTANCE_NONE && !p_instance->base.is_valid());
switch (p_instance->base_type) {
- case VisualServer::INSTANCE_NONE: {
+ case RenderingServer::INSTANCE_NONE: {
// do nothing
} break;
- case VisualServer::INSTANCE_MESH: {
+ case RenderingServer::INSTANCE_MESH: {
if (p_instance->custom_aabb)
new_aabb = *p_instance->custom_aabb;
else
- new_aabb = VSG::storage->mesh_get_aabb(p_instance->base, p_instance->skeleton);
+ new_aabb = RSG::storage->mesh_get_aabb(p_instance->base, p_instance->skeleton);
} break;
- case VisualServer::INSTANCE_MULTIMESH: {
+ case RenderingServer::INSTANCE_MULTIMESH: {
if (p_instance->custom_aabb)
new_aabb = *p_instance->custom_aabb;
else
- new_aabb = VSG::storage->multimesh_get_aabb(p_instance->base);
+ new_aabb = RSG::storage->multimesh_get_aabb(p_instance->base);
} break;
- case VisualServer::INSTANCE_IMMEDIATE: {
+ case RenderingServer::INSTANCE_IMMEDIATE: {
if (p_instance->custom_aabb)
new_aabb = *p_instance->custom_aabb;
else
- new_aabb = VSG::storage->immediate_get_aabb(p_instance->base);
+ new_aabb = RSG::storage->immediate_get_aabb(p_instance->base);
} break;
- case VisualServer::INSTANCE_PARTICLES: {
+ case RenderingServer::INSTANCE_PARTICLES: {
if (p_instance->custom_aabb)
new_aabb = *p_instance->custom_aabb;
else
- new_aabb = VSG::storage->particles_get_aabb(p_instance->base);
+ new_aabb = RSG::storage->particles_get_aabb(p_instance->base);
} break;
- case VisualServer::INSTANCE_LIGHT: {
+ case RenderingServer::INSTANCE_LIGHT: {
- new_aabb = VSG::storage->light_get_aabb(p_instance->base);
+ new_aabb = RSG::storage->light_get_aabb(p_instance->base);
} break;
- case VisualServer::INSTANCE_REFLECTION_PROBE: {
+ case RenderingServer::INSTANCE_REFLECTION_PROBE: {
- new_aabb = VSG::storage->reflection_probe_get_aabb(p_instance->base);
+ new_aabb = RSG::storage->reflection_probe_get_aabb(p_instance->base);
} break;
- case VisualServer::INSTANCE_GI_PROBE: {
+ case RenderingServer::INSTANCE_GI_PROBE: {
- new_aabb = VSG::storage->gi_probe_get_bounds(p_instance->base);
+ new_aabb = RSG::storage->gi_probe_get_bounds(p_instance->base);
} break;
- case VisualServer::INSTANCE_LIGHTMAP_CAPTURE: {
+ case RenderingServer::INSTANCE_LIGHTMAP_CAPTURE: {
- new_aabb = VSG::storage->lightmap_capture_get_bounds(p_instance->base);
+ new_aabb = RSG::storage->lightmap_capture_get_bounds(p_instance->base);
} break;
default: {
@@ -1281,7 +1281,7 @@ _FORCE_INLINE_ static Color _light_capture_voxel_cone_trace(const RasterizerStor
return Color(color.x, color.y, color.z, alpha);
}
-void VisualServerScene::_update_instance_lightmap_captures(Instance *p_instance) {
+void RenderingServerScene::_update_instance_lightmap_captures(Instance *p_instance) {
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(p_instance->base_data);
@@ -1313,12 +1313,12 @@ void VisualServerScene::_update_instance_lightmap_captures(Instance *p_instance)
//this could use some sort of blending..
for (List<Instance *>::Element *E = geom->lightmap_captures.front(); E; E = E->next()) {
- const Vector<RasterizerStorage::LightmapCaptureOctree> *octree = VSG::storage->lightmap_capture_get_octree_ptr(E->get()->base);
+ const Vector<RasterizerStorage::LightmapCaptureOctree> *octree = RSG::storage->lightmap_capture_get_octree_ptr(E->get()->base);
//print_line("octree size: " + itos(octree->size()));
if (octree->size() == 0)
continue;
- Transform to_cell_xform = VSG::storage->lightmap_capture_get_octree_cell_transform(E->get()->base);
- int cell_subdiv = VSG::storage->lightmap_capture_get_octree_cell_subdiv(E->get()->base);
+ Transform to_cell_xform = RSG::storage->lightmap_capture_get_octree_cell_transform(E->get()->base);
+ int cell_subdiv = RSG::storage->lightmap_capture_get_octree_cell_subdiv(E->get()->base);
to_cell_xform = to_cell_xform * E->get()->transform.affine_inverse();
const RasterizerStorage::LightmapCaptureOctree *octree_r = octree->ptr();
@@ -1334,7 +1334,7 @@ void VisualServerScene::_update_instance_lightmap_captures(Instance *p_instance)
}
}
-bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_shadow_atlas, Scenario *p_scenario) {
+bool RenderingServerScene::_light_instance_update_shadow(Instance *p_instance, const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_shadow_atlas, Scenario *p_scenario) {
InstanceLightData *light = static_cast<InstanceLightData *>(p_instance->base_data);
@@ -1343,24 +1343,24 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
bool animated_material_found = false;
- switch (VSG::storage->light_get_type(p_instance->base)) {
+ switch (RSG::storage->light_get_type(p_instance->base)) {
- case VS::LIGHT_DIRECTIONAL: {
+ case RS::LIGHT_DIRECTIONAL: {
float max_distance = p_cam_projection.get_z_far();
- float shadow_max = VSG::storage->light_get_param(p_instance->base, VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE);
+ float shadow_max = RSG::storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_SHADOW_MAX_DISTANCE);
if (shadow_max > 0 && !p_cam_orthogonal) { //its impractical (and leads to unwanted behaviors) to set max distance in orthogonal camera
max_distance = MIN(shadow_max, max_distance);
}
max_distance = MAX(max_distance, p_cam_projection.get_z_near() + 0.001);
float min_distance = MIN(p_cam_projection.get_z_near(), max_distance);
- VS::LightDirectionalShadowDepthRangeMode depth_range_mode = VSG::storage->light_directional_get_shadow_depth_range_mode(p_instance->base);
+ RS::LightDirectionalShadowDepthRangeMode depth_range_mode = RSG::storage->light_directional_get_shadow_depth_range_mode(p_instance->base);
- if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED) {
+ if (depth_range_mode == RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED) {
//optimize min/max
Vector<Plane> planes = p_cam_projection.get_projection_planes(p_cam_transform);
- int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, RS::INSTANCE_GEOMETRY_MASK);
Plane base(p_cam_transform.origin, -p_cam_transform.basis.get_axis(2));
//check distance max and min
@@ -1371,7 +1371,7 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
for (int i = 0; i < cull_count; i++) {
Instance *instance = instance_shadow_cull_result[i];
- if (!instance->visible || !((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
+ if (!instance->visible || !((1 << instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
continue;
}
@@ -1402,24 +1402,24 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
float range = max_distance - min_distance;
int splits = 0;
- switch (VSG::storage->light_directional_get_shadow_mode(p_instance->base)) {
- case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: splits = 1; break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: splits = 2; break;
- case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: splits = 4; break;
+ switch (RSG::storage->light_directional_get_shadow_mode(p_instance->base)) {
+ case RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: splits = 1; break;
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: splits = 2; break;
+ case RS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: splits = 4; break;
}
float distances[5];
distances[0] = min_distance;
for (int i = 0; i < splits; i++) {
- distances[i + 1] = min_distance + VSG::storage->light_get_param(p_instance->base, VS::LightParam(VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET + i)) * range;
+ distances[i + 1] = min_distance + RSG::storage->light_get_param(p_instance->base, RS::LightParam(RS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET + i)) * range;
};
distances[splits] = max_distance;
- float texture_size = VSG::scene_render->get_directional_light_shadow_size(light->instance);
+ float texture_size = RSG::scene_render->get_directional_light_shadow_size(light->instance);
- bool overlap = VSG::storage->light_directional_get_blend_splits(p_instance->base);
+ bool overlap = RSG::storage->light_directional_get_blend_splits(p_instance->base);
float first_radius = 0.0;
@@ -1532,7 +1532,7 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
//z_max_cam = z_vec.dot(center) + radius;
z_min_cam = z_vec.dot(center) - radius;
- if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) {
+ if (depth_range_mode == RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) {
//this trick here is what stabilizes the shadow (make potential jaggies to not move)
//at the cost of some wasted resolution. Still the quality increase is very well worth it
@@ -1560,7 +1560,7 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
light_frustum_planes.write[4] = Plane(z_vec, z_max + 1e6);
light_frustum_planes.write[5] = Plane(-z_vec, -z_min); // z_min is ok, since casters further than far-light plane are not needed
- int cull_count = p_scenario->octree.cull_convex(light_frustum_planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ int cull_count = p_scenario->octree.cull_convex(light_frustum_planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, RS::INSTANCE_GEOMETRY_MASK);
// a pre pass will need to be needed to determine the actual z-near to be used
@@ -1570,7 +1570,7 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
float min, max;
Instance *instance = instance_shadow_cull_result[j];
- if (!instance->visible || !((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
+ if (!instance->visible || !((1 << instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
@@ -1596,25 +1596,25 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
ortho_transform.basis = transform.basis;
ortho_transform.origin = x_vec * (x_min_cam + half_x) + y_vec * (y_min_cam + half_y) + z_vec * z_max;
- VSG::scene_render->light_instance_set_shadow_transform(light->instance, ortho_camera, ortho_transform, 0, distances[i + 1], i, bias_scale);
+ RSG::scene_render->light_instance_set_shadow_transform(light->instance, ortho_camera, ortho_transform, 0, distances[i + 1], i, bias_scale);
}
- VSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
+ RSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
}
} break;
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_OMNI: {
- VS::LightOmniShadowMode shadow_mode = VSG::storage->light_omni_get_shadow_mode(p_instance->base);
+ RS::LightOmniShadowMode shadow_mode = RSG::storage->light_omni_get_shadow_mode(p_instance->base);
- if (shadow_mode == VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID || !VSG::scene_render->light_instances_can_render_shadow_cube()) {
+ if (shadow_mode == RS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID || !RSG::scene_render->light_instances_can_render_shadow_cube()) {
for (int i = 0; i < 2; i++) {
//using this one ensures that raster deferred will have it
RENDER_TIMESTAMP("Culling Shadow Paraboloid" + itos(i));
- float radius = VSG::storage->light_get_param(p_instance->base, VS::LIGHT_PARAM_RANGE);
+ float radius = RSG::storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_RANGE);
float z = i == 0 ? -1 : 1;
Vector<Plane> planes;
@@ -1625,13 +1625,13 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
planes.write[3] = light_transform.xform(Plane(Vector3(0, 1, z).normalized(), radius));
planes.write[4] = light_transform.xform(Plane(Vector3(0, -1, z).normalized(), radius));
- int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, RS::INSTANCE_GEOMETRY_MASK);
Plane near_plane(light_transform.origin, light_transform.basis.get_axis(2) * z);
for (int j = 0; j < cull_count; j++) {
Instance *instance = instance_shadow_cull_result[j];
- if (!instance->visible || !((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
+ if (!instance->visible || !((1 << instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
@@ -1645,12 +1645,12 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
}
}
- VSG::scene_render->light_instance_set_shadow_transform(light->instance, CameraMatrix(), light_transform, radius, 0, i);
- VSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
+ RSG::scene_render->light_instance_set_shadow_transform(light->instance, CameraMatrix(), light_transform, radius, 0, i);
+ RSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
}
} else { //shadow cube
- float radius = VSG::storage->light_get_param(p_instance->base, VS::LIGHT_PARAM_RANGE);
+ float radius = RSG::storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_RANGE);
CameraMatrix cm;
cm.set_perspective(90, 1, 0.01, radius);
@@ -1680,13 +1680,13 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
Vector<Plane> planes = cm.get_projection_planes(xform);
- int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, RS::INSTANCE_GEOMETRY_MASK);
Plane near_plane(xform.origin, -xform.basis.get_axis(2));
for (int j = 0; j < cull_count; j++) {
Instance *instance = instance_shadow_cull_result[j];
- if (!instance->visible || !((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
+ if (!instance->visible || !((1 << instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
@@ -1699,33 +1699,33 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
}
}
- VSG::scene_render->light_instance_set_shadow_transform(light->instance, cm, xform, radius, 0, i);
- VSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
+ RSG::scene_render->light_instance_set_shadow_transform(light->instance, cm, xform, radius, 0, i);
+ RSG::scene_render->render_shadow(light->instance, p_shadow_atlas, i, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
}
//restore the regular DP matrix
- VSG::scene_render->light_instance_set_shadow_transform(light->instance, CameraMatrix(), light_transform, radius, 0, 0);
+ RSG::scene_render->light_instance_set_shadow_transform(light->instance, CameraMatrix(), light_transform, radius, 0, 0);
}
} break;
- case VS::LIGHT_SPOT: {
+ case RS::LIGHT_SPOT: {
RENDER_TIMESTAMP("Culling Spot Light");
- float radius = VSG::storage->light_get_param(p_instance->base, VS::LIGHT_PARAM_RANGE);
- float angle = VSG::storage->light_get_param(p_instance->base, VS::LIGHT_PARAM_SPOT_ANGLE);
+ float radius = RSG::storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_RANGE);
+ float angle = RSG::storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_SPOT_ANGLE);
CameraMatrix cm;
cm.set_perspective(angle * 2.0, 1.0, 0.01, radius);
Vector<Plane> planes = cm.get_projection_planes(light_transform);
- int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK);
+ int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, RS::INSTANCE_GEOMETRY_MASK);
Plane near_plane(light_transform.origin, -light_transform.basis.get_axis(2));
for (int j = 0; j < cull_count; j++) {
Instance *instance = instance_shadow_cull_result[j];
- if (!instance->visible || !((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
+ if (!instance->visible || !((1 << instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) {
cull_count--;
SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]);
j--;
@@ -1738,8 +1738,8 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
}
}
- VSG::scene_render->light_instance_set_shadow_transform(light->instance, cm, light_transform, radius, 0, 0);
- VSG::scene_render->render_shadow(light->instance, p_shadow_atlas, 0, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
+ RSG::scene_render->light_instance_set_shadow_transform(light->instance, cm, light_transform, radius, 0, 0);
+ RSG::scene_render->render_shadow(light->instance, p_shadow_atlas, 0, (RasterizerScene::InstanceBase **)instance_shadow_cull_result, cull_count);
} break;
}
@@ -1747,7 +1747,7 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
return animated_material_found;
}
-void VisualServerScene::render_camera(RID p_render_buffers, RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas) {
+void RenderingServerScene::render_camera(RID p_render_buffers, RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas) {
// render to mono camera
#ifndef _3D_DISABLED
@@ -1798,7 +1798,7 @@ void VisualServerScene::render_camera(RID p_render_buffers, RID p_camera, RID p_
#endif
}
-void VisualServerScene::render_camera(RID p_render_buffers, Ref<ARVRInterface> &p_interface, ARVRInterface::Eyes p_eye, RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas) {
+void RenderingServerScene::render_camera(RID p_render_buffers, Ref<ARVRInterface> &p_interface, ARVRInterface::Eyes p_eye, RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas) {
// render for AR/VR interface
Camera *camera = camera_owner.getornull(p_camera);
@@ -1882,7 +1882,7 @@ void VisualServerScene::render_camera(RID p_render_buffers, Ref<ARVRInterface> &
_render_scene(p_render_buffers, cam_transform, camera_matrix, false, camera->env, camera->effects, p_scenario, p_shadow_atlas, RID(), -1);
};
-void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, RID p_force_camera_effects, uint32_t p_visible_layers, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, bool p_using_shadows) {
+void RenderingServerScene::_prepare_scene(const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, RID p_force_camera_effects, uint32_t p_visible_layers, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, bool p_using_shadows) {
// Note, in stereo rendering:
// - p_cam_transform will be a transform in the middle of our two eyes
// - p_cam_projection is a wider frustrum that encompasses both eyes
@@ -1892,7 +1892,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
render_pass++;
uint32_t camera_layer_mask = p_visible_layers;
- VSG::scene_render->set_scene_pass(render_pass);
+ RSG::scene_render->set_scene_pass(render_pass);
RENDER_TIMESTAMP("Frustum Culling");
@@ -1932,7 +1932,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
if ((camera_layer_mask & ins->layer_mask) == 0) {
//failure
- } else if (ins->base_type == VS::INSTANCE_LIGHT && ins->visible) {
+ } else if (ins->base_type == RS::INSTANCE_LIGHT && ins->visible) {
if (light_cull_count < MAX_LIGHTS_CULLED) {
@@ -1942,14 +1942,14 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
//do not add this light if no geometry is affected by it..
light_cull_result[light_cull_count] = ins;
light_instance_cull_result[light_cull_count] = light->instance;
- if (p_shadow_atlas.is_valid() && VSG::storage->light_has_shadow(ins->base)) {
- VSG::scene_render->light_instance_mark_visible(light->instance); //mark it visible for shadow allocation later
+ if (p_shadow_atlas.is_valid() && RSG::storage->light_has_shadow(ins->base)) {
+ RSG::scene_render->light_instance_mark_visible(light->instance); //mark it visible for shadow allocation later
}
light_cull_count++;
}
}
- } else if (ins->base_type == VS::INSTANCE_REFLECTION_PROBE && ins->visible) {
+ } else if (ins->base_type == RS::INSTANCE_REFLECTION_PROBE && ins->visible) {
if (reflection_probe_cull_count < MAX_REFLECTION_PROBES_CULLED) {
@@ -1961,7 +1961,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
if (!reflection_probe->geometries.empty()) {
//do not add this light if no geometry is affected by it..
- if (reflection_probe->reflection_dirty || VSG::scene_render->reflection_probe_instance_needs_redraw(reflection_probe->instance)) {
+ if (reflection_probe->reflection_dirty || RSG::scene_render->reflection_probe_instance_needs_redraw(reflection_probe->instance)) {
if (!reflection_probe->update_list.in_list()) {
reflection_probe->render_step = 0;
reflection_probe_render_list.add_last(&reflection_probe->update_list);
@@ -1970,7 +1970,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
reflection_probe->reflection_dirty = false;
}
- if (VSG::scene_render->reflection_probe_instance_has_reflection(reflection_probe->instance)) {
+ if (RSG::scene_render->reflection_probe_instance_has_reflection(reflection_probe->instance)) {
reflection_probe_instance_cull_result[reflection_probe_cull_count] = reflection_probe->instance;
reflection_probe_cull_count++;
}
@@ -1978,7 +1978,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
}
}
- } else if (ins->base_type == VS::INSTANCE_GI_PROBE && ins->visible) {
+ } else if (ins->base_type == RS::INSTANCE_GI_PROBE && ins->visible) {
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(ins->base_data);
if (!gi_probe->update_element.in_list()) {
@@ -1990,25 +1990,25 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
gi_probe_cull_count++;
}
- } else if (((1 << ins->base_type) & VS::INSTANCE_GEOMETRY_MASK) && ins->visible && ins->cast_shadows != VS::SHADOW_CASTING_SETTING_SHADOWS_ONLY) {
+ } else if (((1 << ins->base_type) & RS::INSTANCE_GEOMETRY_MASK) && ins->visible && ins->cast_shadows != RS::SHADOW_CASTING_SETTING_SHADOWS_ONLY) {
keep = true;
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(ins->base_data);
if (ins->redraw_if_visible) {
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
- if (ins->base_type == VS::INSTANCE_PARTICLES) {
+ if (ins->base_type == RS::INSTANCE_PARTICLES) {
//particles visible? process them
- if (VSG::storage->particles_is_inactive(ins->base)) {
+ if (RSG::storage->particles_is_inactive(ins->base)) {
//but if nothing is going on, don't do it.
keep = false;
} else {
- VSG::storage->particles_request_process(ins->base);
+ RSG::storage->particles_request_process(ins->base);
//particles visible? request redraw
- VisualServerRaster::redraw_request();
+ RenderingServerRaster::redraw_request();
}
}
@@ -2098,7 +2098,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
//check shadow..
if (light) {
- if (p_using_shadows && p_shadow_atlas.is_valid() && VSG::storage->light_has_shadow(E->get()->base)) {
+ if (p_using_shadows && p_shadow_atlas.is_valid() && RSG::storage->light_has_shadow(E->get()->base)) {
lights_with_shadow[directional_shadow_count++] = E->get();
}
//add to list
@@ -2106,7 +2106,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
}
}
- VSG::scene_render->set_directional_shadow_count(directional_shadow_count);
+ RSG::scene_render->set_directional_shadow_count(directional_shadow_count);
for (int i = 0; i < directional_shadow_count; i++) {
@@ -2126,7 +2126,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
Instance *ins = light_cull_result[i];
- if (!p_shadow_atlas.is_valid() || !VSG::storage->light_has_shadow(ins->base))
+ if (!p_shadow_atlas.is_valid() || !RSG::storage->light_has_shadow(ins->base))
continue;
InstanceLightData *light = static_cast<InstanceLightData *>(ins->base_data);
@@ -2142,11 +2142,11 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
// near plane half width and height
Vector2 vp_half_extents = p_cam_projection.get_viewport_half_extents();
- switch (VSG::storage->light_get_type(ins->base)) {
+ switch (RSG::storage->light_get_type(ins->base)) {
- case VS::LIGHT_OMNI: {
+ case RS::LIGHT_OMNI: {
- float radius = VSG::storage->light_get_param(ins->base, VS::LIGHT_PARAM_RANGE);
+ float radius = RSG::storage->light_get_param(ins->base, RS::LIGHT_PARAM_RANGE);
//get two points parallel to near plane
Vector3 points[2] = {
@@ -2168,10 +2168,10 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
float screen_diameter = points[0].distance_to(points[1]) * 2;
coverage = screen_diameter / (vp_half_extents.x + vp_half_extents.y);
} break;
- case VS::LIGHT_SPOT: {
+ case RS::LIGHT_SPOT: {
- float radius = VSG::storage->light_get_param(ins->base, VS::LIGHT_PARAM_RANGE);
- float angle = VSG::storage->light_get_param(ins->base, VS::LIGHT_PARAM_SPOT_ANGLE);
+ float radius = RSG::storage->light_get_param(ins->base, RS::LIGHT_PARAM_RANGE);
+ float angle = RSG::storage->light_get_param(ins->base, RS::LIGHT_PARAM_SPOT_ANGLE);
float w = radius * Math::sin(Math::deg2rad(angle));
float d = radius * Math::cos(Math::deg2rad(angle));
@@ -2209,7 +2209,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
light->shadow_dirty = false;
}
- bool redraw = VSG::scene_render->shadow_atlas_update_light(p_shadow_atlas, light->instance, coverage, light->last_version);
+ bool redraw = RSG::scene_render->shadow_atlas_update_light(p_shadow_atlas, light->instance, coverage, light->last_version);
if (redraw) {
//must redraw!
@@ -2221,7 +2221,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
}
}
-void VisualServerScene::_render_scene(RID p_render_buffers, const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, RID p_force_camera_effects, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, int p_reflection_probe_pass) {
+void RenderingServerScene::_render_scene(RID p_render_buffers, const Transform p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, RID p_force_camera_effects, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, int p_reflection_probe_pass) {
Scenario *scenario = scenario_owner.getornull(p_scenario);
@@ -2244,10 +2244,10 @@ void VisualServerScene::_render_scene(RID p_render_buffers, const Transform p_ca
/* PROCESS GEOMETRY AND DRAW SCENE */
RENDER_TIMESTAMP("Render Scene ");
- VSG::scene_render->render_scene(p_render_buffers, p_cam_transform, p_cam_projection, p_cam_orthogonal, (RasterizerScene::InstanceBase **)instance_cull_result, instance_cull_count, light_instance_cull_result, light_cull_count + directional_light_count, reflection_probe_instance_cull_result, reflection_probe_cull_count, gi_probe_instance_cull_result, gi_probe_cull_count, environment, camera_effects, p_shadow_atlas, p_reflection_probe.is_valid() ? RID() : scenario->reflection_atlas, p_reflection_probe, p_reflection_probe_pass);
+ RSG::scene_render->render_scene(p_render_buffers, p_cam_transform, p_cam_projection, p_cam_orthogonal, (RasterizerScene::InstanceBase **)instance_cull_result, instance_cull_count, light_instance_cull_result, light_cull_count + directional_light_count, reflection_probe_instance_cull_result, reflection_probe_cull_count, gi_probe_instance_cull_result, gi_probe_cull_count, environment, camera_effects, p_shadow_atlas, p_reflection_probe.is_valid() ? RID() : scenario->reflection_atlas, p_reflection_probe, p_reflection_probe_pass);
}
-void VisualServerScene::render_empty_scene(RID p_render_buffers, RID p_scenario, RID p_shadow_atlas) {
+void RenderingServerScene::render_empty_scene(RID p_render_buffers, RID p_scenario, RID p_shadow_atlas) {
#ifndef _3D_DISABLED
@@ -2259,21 +2259,21 @@ void VisualServerScene::render_empty_scene(RID p_render_buffers, RID p_scenario,
else
environment = scenario->fallback_environment;
RENDER_TIMESTAMP("Render Empty Scene ");
- VSG::scene_render->render_scene(p_render_buffers, Transform(), CameraMatrix(), true, NULL, 0, NULL, 0, NULL, 0, NULL, 0, environment, RID(), p_shadow_atlas, scenario->reflection_atlas, RID(), 0);
+ RSG::scene_render->render_scene(p_render_buffers, Transform(), CameraMatrix(), true, NULL, 0, NULL, 0, NULL, 0, NULL, 0, environment, RID(), p_shadow_atlas, scenario->reflection_atlas, RID(), 0);
#endif
}
-bool VisualServerScene::_render_reflection_probe_step(Instance *p_instance, int p_step) {
+bool RenderingServerScene::_render_reflection_probe_step(Instance *p_instance, int p_step) {
InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(p_instance->base_data);
Scenario *scenario = p_instance->scenario;
ERR_FAIL_COND_V(!scenario, true);
- VisualServerRaster::redraw_request(); //update, so it updates in editor
+ RenderingServerRaster::redraw_request(); //update, so it updates in editor
if (p_step == 0) {
- if (!VSG::scene_render->reflection_probe_instance_begin_render(reflection_probe->instance, scenario->reflection_atlas)) {
+ if (!RSG::scene_render->reflection_probe_instance_begin_render(reflection_probe->instance, scenario->reflection_atlas)) {
return true; //all full
}
}
@@ -2297,9 +2297,9 @@ bool VisualServerScene::_render_reflection_probe_step(Instance *p_instance, int
Vector3(0, -1, 0)
};
- Vector3 extents = VSG::storage->reflection_probe_get_extents(p_instance->base);
- Vector3 origin_offset = VSG::storage->reflection_probe_get_origin_offset(p_instance->base);
- float max_distance = VSG::storage->reflection_probe_get_origin_max_distance(p_instance->base);
+ Vector3 extents = RSG::storage->reflection_probe_get_extents(p_instance->base);
+ Vector3 origin_offset = RSG::storage->reflection_probe_get_origin_offset(p_instance->base);
+ float max_distance = RSG::storage->reflection_probe_get_origin_max_distance(p_instance->base);
Vector3 edge = view_normals[p_step] * extents;
float distance = ABS(view_normals[p_step].dot(edge) - view_normals[p_step].dot(origin_offset)); //distance from origin offset to actual view distance limit
@@ -2317,26 +2317,26 @@ bool VisualServerScene::_render_reflection_probe_step(Instance *p_instance, int
RID shadow_atlas;
- bool use_shadows = VSG::storage->reflection_probe_renders_shadows(p_instance->base);
+ bool use_shadows = RSG::storage->reflection_probe_renders_shadows(p_instance->base);
if (use_shadows) {
shadow_atlas = scenario->reflection_probe_shadow_atlas;
}
RENDER_TIMESTAMP("Render Reflection Probe, Step " + itos(p_step));
- _prepare_scene(xform, cm, false, RID(), RID(), VSG::storage->reflection_probe_get_cull_mask(p_instance->base), p_instance->scenario->self, shadow_atlas, reflection_probe->instance, use_shadows);
+ _prepare_scene(xform, cm, false, RID(), RID(), RSG::storage->reflection_probe_get_cull_mask(p_instance->base), p_instance->scenario->self, shadow_atlas, reflection_probe->instance, use_shadows);
_render_scene(RID(), xform, cm, false, RID(), RID(), p_instance->scenario->self, shadow_atlas, reflection_probe->instance, p_step);
} else {
//do roughness postprocess step until it believes it's done
RENDER_TIMESTAMP("Post-Process Reflection Probe, Step " + itos(p_step));
- return VSG::scene_render->reflection_probe_instance_postprocess_step(reflection_probe->instance);
+ return RSG::scene_render->reflection_probe_instance_postprocess_step(reflection_probe->instance);
}
return false;
}
-void VisualServerScene::render_probes() {
+void RenderingServerScene::render_probes() {
/* REFLECTION PROBES */
@@ -2349,9 +2349,9 @@ void VisualServerScene::render_probes() {
SelfList<InstanceReflectionProbeData> *next = ref_probe->next();
RID base = ref_probe->self()->owner->base;
- switch (VSG::storage->reflection_probe_get_update_mode(base)) {
+ switch (RSG::storage->reflection_probe_get_update_mode(base)) {
- case VS::REFLECTION_PROBE_UPDATE_ONCE: {
+ case RS::REFLECTION_PROBE_UPDATE_ONCE: {
if (busy) //already rendering something
break;
@@ -2364,7 +2364,7 @@ void VisualServerScene::render_probes() {
busy = true; //do not render another one of this kind
} break;
- case VS::REFLECTION_PROBE_UPDATE_ALWAYS: {
+ case RS::REFLECTION_PROBE_UPDATE_ALWAYS: {
int step = 0;
bool done = false;
@@ -2422,16 +2422,16 @@ void VisualServerScene::render_probes() {
if (
instance_caches[idx] != instance_light->instance ||
- cache->has_shadow != VSG::storage->light_has_shadow(instance->base) ||
- cache->type != VSG::storage->light_get_type(instance->base) ||
+ cache->has_shadow != RSG::storage->light_has_shadow(instance->base) ||
+ cache->type != RSG::storage->light_get_type(instance->base) ||
cache->transform != instance->transform ||
- cache->color != VSG::storage->light_get_color(instance->base) ||
- cache->energy != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ENERGY) ||
- cache->bake_energy != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_INDIRECT_ENERGY) ||
- cache->radius != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_RANGE) ||
- cache->attenuation != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ATTENUATION) ||
- cache->spot_angle != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ANGLE) ||
- cache->spot_attenuation != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ATTENUATION)) {
+ cache->color != RSG::storage->light_get_color(instance->base) ||
+ cache->energy != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ENERGY) ||
+ cache->bake_energy != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_INDIRECT_ENERGY) ||
+ cache->radius != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_RANGE) ||
+ cache->attenuation != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ATTENUATION) ||
+ cache->spot_angle != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ANGLE) ||
+ cache->spot_attenuation != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ATTENUATION)) {
cache_dirty = true;
}
}
@@ -2456,16 +2456,16 @@ void VisualServerScene::render_probes() {
if (
instance_caches[idx] != instance_light->instance ||
- cache->has_shadow != VSG::storage->light_has_shadow(instance->base) ||
- cache->type != VSG::storage->light_get_type(instance->base) ||
+ cache->has_shadow != RSG::storage->light_has_shadow(instance->base) ||
+ cache->type != RSG::storage->light_get_type(instance->base) ||
cache->transform != instance->transform ||
- cache->color != VSG::storage->light_get_color(instance->base) ||
- cache->energy != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ENERGY) ||
- cache->bake_energy != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_INDIRECT_ENERGY) ||
- cache->radius != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_RANGE) ||
- cache->attenuation != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ATTENUATION) ||
- cache->spot_angle != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ANGLE) ||
- cache->spot_attenuation != VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ATTENUATION)) {
+ cache->color != RSG::storage->light_get_color(instance->base) ||
+ cache->energy != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ENERGY) ||
+ cache->bake_energy != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_INDIRECT_ENERGY) ||
+ cache->radius != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_RANGE) ||
+ cache->attenuation != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ATTENUATION) ||
+ cache->spot_angle != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ANGLE) ||
+ cache->spot_attenuation != RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ATTENUATION)) {
cache_dirty = true;
}
}
@@ -2480,7 +2480,7 @@ void VisualServerScene::render_probes() {
cache_count = idx;
}
- bool update_lights = VSG::scene_render->gi_probe_needs_update(probe->probe_instance);
+ bool update_lights = RSG::scene_render->gi_probe_needs_update(probe->probe_instance);
if (cache_dirty) {
probe->light_cache.resize(cache_count);
@@ -2501,16 +2501,16 @@ void VisualServerScene::render_probes() {
InstanceGIProbeData::LightCache *cache = &caches[idx];
instance_caches[idx] = instance_light->instance;
- cache->has_shadow = VSG::storage->light_has_shadow(instance->base);
- cache->type = VSG::storage->light_get_type(instance->base);
+ cache->has_shadow = RSG::storage->light_has_shadow(instance->base);
+ cache->type = RSG::storage->light_get_type(instance->base);
cache->transform = instance->transform;
- cache->color = VSG::storage->light_get_color(instance->base);
- cache->energy = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ENERGY);
- cache->bake_energy = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_INDIRECT_ENERGY);
- cache->radius = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_RANGE);
- cache->attenuation = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ATTENUATION);
- cache->spot_angle = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ANGLE);
- cache->spot_attenuation = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ATTENUATION);
+ cache->color = RSG::storage->light_get_color(instance->base);
+ cache->energy = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ENERGY);
+ cache->bake_energy = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_INDIRECT_ENERGY);
+ cache->radius = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_RANGE);
+ cache->attenuation = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ATTENUATION);
+ cache->spot_angle = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ANGLE);
+ cache->spot_attenuation = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ATTENUATION);
idx++;
}
@@ -2524,16 +2524,16 @@ void VisualServerScene::render_probes() {
InstanceGIProbeData::LightCache *cache = &caches[idx];
instance_caches[idx] = instance_light->instance;
- cache->has_shadow = VSG::storage->light_has_shadow(instance->base);
- cache->type = VSG::storage->light_get_type(instance->base);
+ cache->has_shadow = RSG::storage->light_has_shadow(instance->base);
+ cache->type = RSG::storage->light_get_type(instance->base);
cache->transform = instance->transform;
- cache->color = VSG::storage->light_get_color(instance->base);
- cache->energy = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ENERGY);
- cache->bake_energy = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_INDIRECT_ENERGY);
- cache->radius = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_RANGE);
- cache->attenuation = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_ATTENUATION);
- cache->spot_angle = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ANGLE);
- cache->spot_attenuation = VSG::storage->light_get_param(instance->base, VS::LIGHT_PARAM_SPOT_ATTENUATION);
+ cache->color = RSG::storage->light_get_color(instance->base);
+ cache->energy = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ENERGY);
+ cache->bake_energy = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_INDIRECT_ENERGY);
+ cache->radius = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_RANGE);
+ cache->attenuation = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_ATTENUATION);
+ cache->spot_angle = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ANGLE);
+ cache->spot_attenuation = RSG::storage->light_get_param(instance->base, RS::LIGHT_PARAM_SPOT_ATTENUATION);
idx++;
}
@@ -2571,7 +2571,7 @@ void VisualServerScene::render_probes() {
}
}
- VSG::scene_render->gi_probe_update(probe->probe_instance, update_lights, probe->light_instances, instance_cull_count, (RasterizerScene::InstanceBase **)instance_cull_result);
+ RSG::scene_render->gi_probe_update(probe->probe_instance, update_lights, probe->light_instances, instance_cull_count, (RasterizerScene::InstanceBase **)instance_cull_result);
gi_probe_update_list.remove(gi_probe);
@@ -2579,7 +2579,7 @@ void VisualServerScene::render_probes() {
}
}
-void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
+void RenderingServerScene::_update_dirty_instance(Instance *p_instance) {
if (p_instance->update_aabb) {
_update_instance_aabb(p_instance);
@@ -2590,20 +2590,20 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
p_instance->instance_increase_version();
if (p_instance->base.is_valid()) {
- VSG::storage->base_update_dependency(p_instance->base, p_instance);
+ RSG::storage->base_update_dependency(p_instance->base, p_instance);
}
if (p_instance->material_override.is_valid()) {
- VSG::storage->material_update_dependency(p_instance->material_override, p_instance);
+ RSG::storage->material_update_dependency(p_instance->material_override, p_instance);
}
- if (p_instance->base_type == VS::INSTANCE_MESH) {
+ if (p_instance->base_type == RS::INSTANCE_MESH) {
//remove materials no longer used and un-own them
- int new_mat_count = VSG::storage->mesh_get_surface_count(p_instance->base);
+ int new_mat_count = RSG::storage->mesh_get_surface_count(p_instance->base);
p_instance->materials.resize(new_mat_count);
- int new_blend_shape_count = VSG::storage->mesh_get_blend_shape_count(p_instance->base);
+ int new_blend_shape_count = RSG::storage->mesh_get_blend_shape_count(p_instance->base);
if (new_blend_shape_count != p_instance->blend_values.size()) {
p_instance->blend_values.resize(new_blend_shape_count);
for (int i = 0; i < new_blend_shape_count; i++) {
@@ -2612,21 +2612,21 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
}
}
- if ((1 << p_instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) {
+ if ((1 << p_instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) {
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(p_instance->base_data);
bool can_cast_shadows = true;
bool is_animated = false;
- if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_OFF) {
+ if (p_instance->cast_shadows == RS::SHADOW_CASTING_SETTING_OFF) {
can_cast_shadows = false;
} else if (p_instance->material_override.is_valid()) {
- can_cast_shadows = VSG::storage->material_casts_shadows(p_instance->material_override);
- is_animated = VSG::storage->material_is_animated(p_instance->material_override);
+ can_cast_shadows = RSG::storage->material_casts_shadows(p_instance->material_override);
+ is_animated = RSG::storage->material_is_animated(p_instance->material_override);
} else {
- if (p_instance->base_type == VS::INSTANCE_MESH) {
+ if (p_instance->base_type == RS::INSTANCE_MESH) {
RID mesh = p_instance->base;
if (mesh.is_valid()) {
@@ -2634,21 +2634,21 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
for (int i = 0; i < p_instance->materials.size(); i++) {
- RID mat = p_instance->materials[i].is_valid() ? p_instance->materials[i] : VSG::storage->mesh_surface_get_material(mesh, i);
+ RID mat = p_instance->materials[i].is_valid() ? p_instance->materials[i] : RSG::storage->mesh_surface_get_material(mesh, i);
if (!mat.is_valid()) {
cast_shadows = true;
} else {
- if (VSG::storage->material_casts_shadows(mat)) {
+ if (RSG::storage->material_casts_shadows(mat)) {
cast_shadows = true;
}
- if (VSG::storage->material_is_animated(mat)) {
+ if (RSG::storage->material_is_animated(mat)) {
is_animated = true;
}
- VSG::storage->material_update_dependency(mat, p_instance);
+ RSG::storage->material_update_dependency(mat, p_instance);
}
}
@@ -2657,30 +2657,30 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
}
}
- } else if (p_instance->base_type == VS::INSTANCE_MULTIMESH) {
- RID mesh = VSG::storage->multimesh_get_mesh(p_instance->base);
+ } else if (p_instance->base_type == RS::INSTANCE_MULTIMESH) {
+ RID mesh = RSG::storage->multimesh_get_mesh(p_instance->base);
if (mesh.is_valid()) {
bool cast_shadows = false;
- int sc = VSG::storage->mesh_get_surface_count(mesh);
+ int sc = RSG::storage->mesh_get_surface_count(mesh);
for (int i = 0; i < sc; i++) {
- RID mat = VSG::storage->mesh_surface_get_material(mesh, i);
+ RID mat = RSG::storage->mesh_surface_get_material(mesh, i);
if (!mat.is_valid()) {
cast_shadows = true;
} else {
- if (VSG::storage->material_casts_shadows(mat)) {
+ if (RSG::storage->material_casts_shadows(mat)) {
cast_shadows = true;
}
- if (VSG::storage->material_is_animated(mat)) {
+ if (RSG::storage->material_is_animated(mat)) {
is_animated = true;
}
- VSG::storage->material_update_dependency(mat, p_instance);
+ RSG::storage->material_update_dependency(mat, p_instance);
}
}
@@ -2688,52 +2688,52 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
can_cast_shadows = false;
}
- VSG::storage->base_update_dependency(mesh, p_instance);
+ RSG::storage->base_update_dependency(mesh, p_instance);
}
- } else if (p_instance->base_type == VS::INSTANCE_IMMEDIATE) {
+ } else if (p_instance->base_type == RS::INSTANCE_IMMEDIATE) {
- RID mat = VSG::storage->immediate_get_material(p_instance->base);
+ RID mat = RSG::storage->immediate_get_material(p_instance->base);
- can_cast_shadows = !mat.is_valid() || VSG::storage->material_casts_shadows(mat);
+ can_cast_shadows = !mat.is_valid() || RSG::storage->material_casts_shadows(mat);
- if (mat.is_valid() && VSG::storage->material_is_animated(mat)) {
+ if (mat.is_valid() && RSG::storage->material_is_animated(mat)) {
is_animated = true;
}
if (mat.is_valid()) {
- VSG::storage->material_update_dependency(mat, p_instance);
+ RSG::storage->material_update_dependency(mat, p_instance);
}
- } else if (p_instance->base_type == VS::INSTANCE_PARTICLES) {
+ } else if (p_instance->base_type == RS::INSTANCE_PARTICLES) {
bool cast_shadows = false;
- int dp = VSG::storage->particles_get_draw_passes(p_instance->base);
+ int dp = RSG::storage->particles_get_draw_passes(p_instance->base);
for (int i = 0; i < dp; i++) {
- RID mesh = VSG::storage->particles_get_draw_pass_mesh(p_instance->base, i);
+ RID mesh = RSG::storage->particles_get_draw_pass_mesh(p_instance->base, i);
if (!mesh.is_valid())
continue;
- int sc = VSG::storage->mesh_get_surface_count(mesh);
+ int sc = RSG::storage->mesh_get_surface_count(mesh);
for (int j = 0; j < sc; j++) {
- RID mat = VSG::storage->mesh_surface_get_material(mesh, j);
+ RID mat = RSG::storage->mesh_surface_get_material(mesh, j);
if (!mat.is_valid()) {
cast_shadows = true;
} else {
- if (VSG::storage->material_casts_shadows(mat)) {
+ if (RSG::storage->material_casts_shadows(mat)) {
cast_shadows = true;
}
- if (VSG::storage->material_is_animated(mat)) {
+ if (RSG::storage->material_is_animated(mat)) {
is_animated = true;
}
- VSG::storage->material_update_dependency(mat, p_instance);
+ RSG::storage->material_update_dependency(mat, p_instance);
}
}
}
@@ -2758,7 +2758,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
}
if (p_instance->skeleton.is_valid()) {
- VSG::storage->skeleton_update_dependency(p_instance->skeleton, p_instance);
+ RSG::storage->skeleton_update_dependency(p_instance->skeleton, p_instance);
}
p_instance->clean_up_dependencies();
@@ -2772,9 +2772,9 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
p_instance->update_dependencies = false;
}
-void VisualServerScene::update_dirty_instances() {
+void RenderingServerScene::update_dirty_instances() {
- VSG::storage->update_dirty_resources();
+ RSG::storage->update_dirty_resources();
while (_instance_update_list.first()) {
@@ -2782,7 +2782,7 @@ void VisualServerScene::update_dirty_instances() {
}
}
-bool VisualServerScene::free(RID p_rid) {
+bool RenderingServerScene::free(RID p_rid) {
if (camera_owner.owns(p_rid)) {
@@ -2798,8 +2798,8 @@ bool VisualServerScene::free(RID p_rid) {
while (scenario->instances.first()) {
instance_set_scenario(scenario->instances.first()->self()->self, RID());
}
- VSG::scene_render->free(scenario->reflection_probe_shadow_atlas);
- VSG::scene_render->free(scenario->reflection_atlas);
+ RSG::scene_render->free(scenario->reflection_probe_shadow_atlas);
+ RSG::scene_render->free(scenario->reflection_atlas);
scenario_owner.free(p_rid);
memdelete(scenario);
@@ -2827,13 +2827,13 @@ bool VisualServerScene::free(RID p_rid) {
return true;
}
-VisualServerScene *VisualServerScene::singleton = NULL;
+RenderingServerScene *RenderingServerScene::singleton = NULL;
-VisualServerScene::VisualServerScene() {
+RenderingServerScene::RenderingServerScene() {
render_pass = 1;
singleton = this;
}
-VisualServerScene::~VisualServerScene() {
+RenderingServerScene::~RenderingServerScene() {
}
diff --git a/servers/visual/visual_server_scene.h b/servers/rendering/rendering_server_scene.h
index 8dbd60d3ff..6012a75660 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/rendering/rendering_server_scene.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_scene.h */
+/* rendering_server_scene.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -31,7 +31,7 @@
#ifndef VISUALSERVERSCENE_H
#define VISUALSERVERSCENE_H
-#include "servers/visual/rasterizer.h"
+#include "servers/rendering/rasterizer.h"
#include "core/math/geometry.h"
#include "core/math/octree.h"
@@ -41,7 +41,7 @@
#include "core/self_list.h"
#include "servers/arvr/arvr_interface.h"
-class VisualServerScene {
+class RenderingServerScene {
public:
enum {
@@ -55,7 +55,7 @@ public:
uint64_t render_pass;
- static VisualServerScene *singleton;
+ static RenderingServerScene *singleton;
/* CAMERA API */
@@ -109,7 +109,7 @@ public:
struct Scenario {
- VS::ScenarioDebugMode debug;
+ RS::ScenarioDebugMode debug;
RID self;
Octree<Instance, true> octree;
@@ -123,7 +123,7 @@ public:
SelfList<Instance>::List instances;
- Scenario() { debug = VS::SCENARIO_DEBUG_DISABLED; }
+ Scenario() { debug = RS::SCENARIO_DEBUG_DISABLED; }
};
mutable RID_PtrOwner<Scenario> scenario_owner;
@@ -133,7 +133,7 @@ public:
virtual RID scenario_create();
- virtual void scenario_set_debug(RID p_scenario, VS::ScenarioDebugMode p_debug_mode);
+ virtual void scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode);
virtual void scenario_set_environment(RID p_scenario, RID p_environment);
virtual void scenario_set_camera_effects(RID p_scenario, RID p_fx);
virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment);
@@ -323,7 +323,7 @@ public:
struct LightCache {
- VS::LightType type;
+ RS::LightType type;
Transform transform;
Color color;
float energy;
@@ -406,8 +406,8 @@ public:
virtual Vector<ObjectID> instances_cull_ray(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario = RID()) const;
virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario = RID()) const;
- virtual void instance_geometry_set_flag(RID p_instance, VS::InstanceFlags p_flags, bool p_enabled);
- virtual void instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting);
+ virtual void instance_geometry_set_flag(RID p_instance, RS::InstanceFlags p_flags, bool p_enabled);
+ virtual void instance_geometry_set_cast_shadows_setting(RID p_instance, RS::ShadowCastingSetting p_shadow_casting_setting);
virtual void instance_geometry_set_material_override(RID p_instance, RID p_material);
virtual void instance_geometry_set_draw_range(RID p_instance, float p_min, float p_max, float p_min_margin, float p_max_margin);
@@ -433,8 +433,8 @@ public:
bool free(RID p_rid);
- VisualServerScene();
- virtual ~VisualServerScene();
+ RenderingServerScene();
+ virtual ~RenderingServerScene();
};
#endif // VISUALSERVERSCENE_H
diff --git a/servers/visual/visual_server_viewport.cpp b/servers/rendering/rendering_server_viewport.cpp
index 555d5f99c7..24b2379d97 100644
--- a/servers/visual/visual_server_viewport.cpp
+++ b/servers/rendering/rendering_server_viewport.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_viewport.cpp */
+/* rendering_server_viewport.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server_viewport.h"
+#include "rendering_server_viewport.h"
#include "core/project_settings.h"
-#include "visual_server_canvas.h"
-#include "visual_server_globals.h"
-#include "visual_server_scene.h"
+#include "rendering_server_canvas.h"
+#include "rendering_server_globals.h"
+#include "rendering_server_scene.h"
-static Transform2D _canvas_get_transform(VisualServerViewport::Viewport *p_viewport, VisualServerCanvas::Canvas *p_canvas, VisualServerViewport::Viewport::CanvasData *p_canvas_data, const Vector2 &p_vp_size) {
+static Transform2D _canvas_get_transform(RenderingServerViewport::Viewport *p_viewport, RenderingServerCanvas::Canvas *p_canvas, RenderingServerViewport::Viewport::CanvasData *p_canvas_data, const Vector2 &p_vp_size) {
Transform2D xf = p_viewport->global_transform;
@@ -47,7 +47,7 @@ static Transform2D _canvas_get_transform(VisualServerViewport::Viewport *p_viewp
xf = xf * p_canvas_data->transform;
- if (scale != 1.0 && !VSG::canvas->disable_scale) {
+ if (scale != 1.0 && !RSG::canvas->disable_scale) {
Vector2 pivot = p_vp_size * 0.5;
Transform2D xfpivot;
xfpivot.set_origin(pivot);
@@ -62,7 +62,7 @@ static Transform2D _canvas_get_transform(VisualServerViewport::Viewport *p_viewp
return xf;
}
-void VisualServerViewport::_draw_3d(Viewport *p_viewport, ARVRInterface::Eyes p_eye) {
+void RenderingServerViewport::_draw_3d(Viewport *p_viewport, ARVRInterface::Eyes p_eye) {
RENDER_TIMESTAMP(">Begin Rendering 3D Scene");
@@ -72,51 +72,51 @@ void VisualServerViewport::_draw_3d(Viewport *p_viewport, ARVRInterface::Eyes p_
}
if (p_viewport->use_arvr && arvr_interface.is_valid()) {
- VSG::scene->render_camera(p_viewport->render_buffers, arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ RSG::scene->render_camera(p_viewport->render_buffers, arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
} else {
- VSG::scene->render_camera(p_viewport->render_buffers, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ RSG::scene->render_camera(p_viewport->render_buffers, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
}
RENDER_TIMESTAMP("<End Rendering 3D Scene");
}
-void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::Eyes p_eye) {
+void RenderingServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::Eyes p_eye) {
/* Camera should always be BEFORE any other 3D */
bool scenario_draw_canvas_bg = false; //draw canvas, or some layer of it, as BG for 3D instead of in front
int scenario_canvas_max_layer = 0;
- Color bgcolor = VSG::storage->get_default_clear_color();
+ Color bgcolor = RSG::storage->get_default_clear_color();
- if (!p_viewport->hide_canvas && !p_viewport->disable_environment && VSG::scene->scenario_owner.owns(p_viewport->scenario)) {
+ if (!p_viewport->hide_canvas && !p_viewport->disable_environment && RSG::scene->scenario_owner.owns(p_viewport->scenario)) {
- VisualServerScene::Scenario *scenario = VSG::scene->scenario_owner.getornull(p_viewport->scenario);
+ RenderingServerScene::Scenario *scenario = RSG::scene->scenario_owner.getornull(p_viewport->scenario);
ERR_FAIL_COND(!scenario);
- if (VSG::scene_render->is_environment(scenario->environment)) {
- scenario_draw_canvas_bg = VSG::scene_render->environment_get_background(scenario->environment) == VS::ENV_BG_CANVAS;
+ if (RSG::scene_render->is_environment(scenario->environment)) {
+ scenario_draw_canvas_bg = RSG::scene_render->environment_get_background(scenario->environment) == RS::ENV_BG_CANVAS;
- scenario_canvas_max_layer = VSG::scene_render->environment_get_canvas_max_layer(scenario->environment);
+ scenario_canvas_max_layer = RSG::scene_render->environment_get_canvas_max_layer(scenario->environment);
}
}
- bool can_draw_3d = VSG::scene->camera_owner.owns(p_viewport->camera);
+ bool can_draw_3d = RSG::scene->camera_owner.owns(p_viewport->camera);
- if (p_viewport->clear_mode != VS::VIEWPORT_CLEAR_NEVER) {
+ if (p_viewport->clear_mode != RS::VIEWPORT_CLEAR_NEVER) {
if (p_viewport->transparent_bg) {
bgcolor = Color(0, 0, 0, 0);
}
- if (p_viewport->clear_mode == VS::VIEWPORT_CLEAR_ONLY_NEXT_FRAME) {
- p_viewport->clear_mode = VS::VIEWPORT_CLEAR_NEVER;
+ if (p_viewport->clear_mode == RS::VIEWPORT_CLEAR_ONLY_NEXT_FRAME) {
+ p_viewport->clear_mode = RS::VIEWPORT_CLEAR_NEVER;
}
}
if ((scenario_draw_canvas_bg || can_draw_3d) && !p_viewport->render_buffers.is_valid()) {
//wants to draw 3D but there is no render buffer, create
- p_viewport->render_buffers = VSG::scene_render->render_buffers_create();
- VSG::scene_render->render_buffers_configure(p_viewport->render_buffers, p_viewport->render_target, p_viewport->size.width, p_viewport->size.height, p_viewport->msaa);
+ p_viewport->render_buffers = RSG::scene_render->render_buffers_create();
+ RSG::scene_render->render_buffers_configure(p_viewport->render_buffers, p_viewport->render_target, p_viewport->size.width, p_viewport->size.height, p_viewport->msaa);
}
- VSG::storage->render_target_request_clear(p_viewport->render_target, bgcolor);
+ RSG::storage->render_target_request_clear(p_viewport->render_target, bgcolor);
if (!scenario_draw_canvas_bg && can_draw_3d) {
_draw_3d(p_viewport, p_eye);
@@ -138,7 +138,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
RENDER_TIMESTAMP("Cull Canvas Lights");
for (Map<RID, Viewport::CanvasData>::Element *E = p_viewport->canvas_map.front(); E; E = E->next()) {
- VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas *>(E->get().canvas);
+ RenderingServerCanvas::Canvas *canvas = static_cast<RenderingServerCanvas::Canvas *>(E->get().canvas);
Transform2D xf = _canvas_get_transform(p_viewport, canvas, &E->get(), clip_rect.size);
@@ -149,7 +149,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
RasterizerCanvas::Light *cl = F->get();
if (cl->enabled && cl->texture.is_valid()) {
//not super efficient..
- Size2 tsize = VSG::storage->texture_size_with_proxy(cl->texture);
+ Size2 tsize = RSG::storage->texture_size_with_proxy(cl->texture);
tsize *= cl->scale;
Vector2 offset = tsize / 2.0;
@@ -177,7 +177,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
lights_with_shadow = cl;
cl->radius_cache = cl->rect_cache.size.length();
}
- if (cl->mode == VS::CANVAS_LIGHT_MODE_MASK) {
+ if (cl->mode == RS::CANVAS_LIGHT_MODE_MASK) {
cl->mask_next_ptr = lights_with_mask;
lights_with_mask = cl;
}
@@ -186,7 +186,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
}
//guess this is not needed, but keeping because it may be
- //VSG::canvas_render->light_internal_update(cl->light_internal, cl);
+ //RSG::canvas_render->light_internal_update(cl->light_internal, cl);
}
}
@@ -204,7 +204,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
//make list of occluders
for (Map<RID, Viewport::CanvasData>::Element *E = p_viewport->canvas_map.front(); E; E = E->next()) {
- VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas *>(E->get().canvas);
+ RenderingServerCanvas::Canvas *canvas = static_cast<RenderingServerCanvas::Canvas *>(E->get().canvas);
Transform2D xf = _canvas_get_transform(p_viewport, canvas, &E->get(), clip_rect.size);
for (Set<RasterizerCanvas::LightOccluderInstance *>::Element *F = canvas->occluders.front(); F; F = F->next()) {
@@ -226,17 +226,17 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
RENDER_TIMESTAMP("Render Shadow");
- VSG::canvas_render->light_update_shadow(light->light_internal, light->xform_cache.affine_inverse(), light->item_shadow_mask, light->radius_cache / 1000.0, light->radius_cache * 1.1, occluders);
+ RSG::canvas_render->light_update_shadow(light->light_internal, light->xform_cache.affine_inverse(), light->item_shadow_mask, light->radius_cache / 1000.0, light->radius_cache * 1.1, occluders);
light = light->shadows_next_ptr;
}
- //VSG::canvas_render->reset_canvas();
+ //RSG::canvas_render->reset_canvas();
RENDER_TIMESTAMP("<End rendering 2D Shadows");
}
if (scenario_draw_canvas_bg && canvas_map.front() && canvas_map.front()->key().get_layer() > scenario_canvas_max_layer) {
if (!can_draw_3d) {
- VSG::scene->render_empty_scene(p_viewport->render_buffers, p_viewport->scenario, p_viewport->shadow_atlas);
+ RSG::scene->render_empty_scene(p_viewport->render_buffers, p_viewport->scenario, p_viewport->shadow_atlas);
} else {
_draw_3d(p_viewport, p_eye);
}
@@ -245,7 +245,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
for (Map<Viewport::CanvasKey, Viewport::CanvasData *>::Element *E = canvas_map.front(); E; E = E->next()) {
- VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas *>(E->get()->canvas);
+ RenderingServerCanvas::Canvas *canvas = static_cast<RenderingServerCanvas::Canvas *>(E->get()->canvas);
Transform2D xform = _canvas_get_transform(p_viewport, canvas, E->get(), clip_rect.size);
@@ -260,12 +260,12 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
ptr = ptr->filter_next_ptr;
}
- VSG::canvas->render_canvas(p_viewport->render_target, canvas, xform, canvas_lights, lights_with_mask, clip_rect);
+ RSG::canvas->render_canvas(p_viewport->render_target, canvas, xform, canvas_lights, lights_with_mask, clip_rect);
i++;
if (scenario_draw_canvas_bg && E->key().get_layer() >= scenario_canvas_max_layer) {
if (!can_draw_3d) {
- VSG::scene->render_empty_scene(p_viewport->render_buffers, p_viewport->scenario, p_viewport->shadow_atlas);
+ RSG::scene->render_empty_scene(p_viewport->render_buffers, p_viewport->scenario, p_viewport->shadow_atlas);
} else {
_draw_3d(p_viewport, p_eye);
}
@@ -276,22 +276,22 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
if (scenario_draw_canvas_bg) {
if (!can_draw_3d) {
- VSG::scene->render_empty_scene(p_viewport->render_buffers, p_viewport->scenario, p_viewport->shadow_atlas);
+ RSG::scene->render_empty_scene(p_viewport->render_buffers, p_viewport->scenario, p_viewport->shadow_atlas);
} else {
_draw_3d(p_viewport, p_eye);
}
}
- //VSG::canvas_render->canvas_debug_viewport_shadows(lights_with_shadow);
+ //RSG::canvas_render->canvas_debug_viewport_shadows(lights_with_shadow);
}
- if (VSG::storage->render_target_is_clear_requested(p_viewport->render_target)) {
+ if (RSG::storage->render_target_is_clear_requested(p_viewport->render_target)) {
//was never cleared in the end, force clear it
- VSG::storage->render_target_do_clear_request(p_viewport->render_target);
+ RSG::storage->render_target_do_clear_request(p_viewport->render_target);
}
}
-void VisualServerViewport::draw_viewports() {
+void RenderingServerViewport::draw_viewports() {
#if 0
// get our arvr interface in case we need it
@@ -323,7 +323,7 @@ void VisualServerViewport::draw_viewports() {
Viewport *vp = active_viewports[i];
- if (vp->update_mode == VS::VIEWPORT_UPDATE_DISABLED)
+ if (vp->update_mode == RS::VIEWPORT_UPDATE_DISABLED)
continue;
if (!vp->render_target.is_valid()) {
@@ -333,15 +333,15 @@ void VisualServerViewport::draw_viewports() {
bool visible = vp->viewport_to_screen_rect != Rect2();
- if (vp->update_mode == VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == VS::VIEWPORT_UPDATE_ONCE) {
+ if (vp->update_mode == RS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == RS::VIEWPORT_UPDATE_ONCE) {
visible = true;
}
- if (vp->update_mode == VS::VIEWPORT_UPDATE_WHEN_VISIBLE && VSG::storage->render_target_was_used(vp->render_target)) {
+ if (vp->update_mode == RS::VIEWPORT_UPDATE_WHEN_VISIBLE && RSG::storage->render_target_was_used(vp->render_target)) {
visible = true;
}
- if (vp->update_mode == VS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE) {
+ if (vp->update_mode == RS::VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE) {
Viewport *parent = viewport_owner.getornull(vp->parent);
if (parent && parent->last_pass == draw_viewports_pass) {
visible = true;
@@ -365,21 +365,21 @@ void VisualServerViewport::draw_viewports() {
RENDER_TIMESTAMP(">Rendering Viewport " + itos(i));
- VSG::storage->render_target_set_as_unused(vp->render_target);
+ RSG::storage->render_target_set_as_unused(vp->render_target);
#if 0
if (vp->use_arvr && arvr_interface.is_valid()) {
// override our size, make sure it matches our required size
vp->size = arvr_interface->get_render_targetsize();
- VSG::storage->render_target_set_size(vp->render_target, vp->size.x, vp->size.y);
+ RSG::storage->render_target_set_size(vp->render_target, vp->size.x, vp->size.y);
// render mono or left eye first
ARVRInterface::Eyes leftOrMono = arvr_interface->is_stereo() ? ARVRInterface::EYE_LEFT : ARVRInterface::EYE_MONO;
// check for an external texture destination for our left eye/mono
- VSG::storage->render_target_set_external_texture(vp->render_target, arvr_interface->get_external_texture_for_eye(leftOrMono));
+ RSG::storage->render_target_set_external_texture(vp->render_target, arvr_interface->get_external_texture_for_eye(leftOrMono));
// set our render target as current
- VSG::rasterizer->set_current_render_target(vp->render_target);
+ RSG::rasterizer->set_current_render_target(vp->render_target);
// and draw left eye/mono
_draw_viewport(vp, leftOrMono);
@@ -388,10 +388,10 @@ void VisualServerViewport::draw_viewports() {
// render right eye
if (leftOrMono == ARVRInterface::EYE_LEFT) {
// check for an external texture destination for our right eye
- VSG::storage->render_target_set_external_texture(vp->render_target, arvr_interface->get_external_texture_for_eye(ARVRInterface::EYE_RIGHT));
+ RSG::storage->render_target_set_external_texture(vp->render_target, arvr_interface->get_external_texture_for_eye(ARVRInterface::EYE_RIGHT));
// commit for eye may have changed the render target
- VSG::rasterizer->set_current_render_target(vp->render_target);
+ RSG::rasterizer->set_current_render_target(vp->render_target);
_draw_viewport(vp, ARVRInterface::EYE_RIGHT);
arvr_interface->commit_for_eye(ARVRInterface::EYE_RIGHT, vp->render_target, vp->viewport_to_screen_rect);
@@ -402,23 +402,23 @@ void VisualServerViewport::draw_viewports() {
} else {
#endif
{
- VSG::storage->render_target_set_external_texture(vp->render_target, 0);
+ RSG::storage->render_target_set_external_texture(vp->render_target, 0);
- VSG::scene_render->set_debug_draw_mode(vp->debug_draw);
- VSG::storage->render_info_begin_capture();
+ RSG::scene_render->set_debug_draw_mode(vp->debug_draw);
+ RSG::storage->render_info_begin_capture();
// render standard mono camera
_draw_viewport(vp);
- VSG::storage->render_info_end_capture();
- vp->render_info[VS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_OBJECTS_IN_FRAME);
- vp->render_info[VS::VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_VERTICES_IN_FRAME);
- vp->render_info[VS::VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_MATERIAL_CHANGES_IN_FRAME);
- vp->render_info[VS::VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_SHADER_CHANGES_IN_FRAME);
- vp->render_info[VS::VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_SURFACE_CHANGES_IN_FRAME);
- vp->render_info[VS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME] = VSG::storage->get_captured_render_info(VS::INFO_DRAW_CALLS_IN_FRAME);
+ RSG::storage->render_info_end_capture();
+ vp->render_info[RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME] = RSG::storage->get_captured_render_info(RS::INFO_OBJECTS_IN_FRAME);
+ vp->render_info[RS::VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME] = RSG::storage->get_captured_render_info(RS::INFO_VERTICES_IN_FRAME);
+ vp->render_info[RS::VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME] = RSG::storage->get_captured_render_info(RS::INFO_MATERIAL_CHANGES_IN_FRAME);
+ vp->render_info[RS::VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME] = RSG::storage->get_captured_render_info(RS::INFO_SHADER_CHANGES_IN_FRAME);
+ vp->render_info[RS::VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME] = RSG::storage->get_captured_render_info(RS::INFO_SURFACE_CHANGES_IN_FRAME);
+ vp->render_info[RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME] = RSG::storage->get_captured_render_info(RS::INFO_DRAW_CALLS_IN_FRAME);
- if (vp->viewport_to_screen != DisplayServer::INVALID_WINDOW_ID && (!vp->viewport_render_direct_to_screen || !VSG::rasterizer->is_low_end())) {
+ if (vp->viewport_to_screen != DisplayServer::INVALID_WINDOW_ID && (!vp->viewport_render_direct_to_screen || !RSG::rasterizer->is_low_end())) {
//copy to screen if set as such
Rasterizer::BlitToScreen blit;
blit.render_target = vp->render_target;
@@ -437,24 +437,24 @@ void VisualServerViewport::draw_viewports() {
}
}
- if (vp->update_mode == VS::VIEWPORT_UPDATE_ONCE) {
- vp->update_mode = VS::VIEWPORT_UPDATE_DISABLED;
+ if (vp->update_mode == RS::VIEWPORT_UPDATE_ONCE) {
+ vp->update_mode = RS::VIEWPORT_UPDATE_DISABLED;
}
RENDER_TIMESTAMP("<Rendering Viewport " + itos(i));
}
- VSG::scene_render->set_debug_draw_mode(VS::VIEWPORT_DEBUG_DRAW_DISABLED);
+ RSG::scene_render->set_debug_draw_mode(RS::VIEWPORT_DEBUG_DRAW_DISABLED);
RENDER_TIMESTAMP("<Render Viewports");
//this needs to be called to make screen swapping more efficient
- VSG::rasterizer->prepare_for_blitting_render_targets();
+ RSG::rasterizer->prepare_for_blitting_render_targets();
for (Map<int, Vector<Rasterizer::BlitToScreen>>::Element *E = blit_to_screen_list.front(); E; E = E->next()) {
- VSG::rasterizer->blit_render_targets_to_screen(E->key(), E->get().ptr(), E->get().size());
+ RSG::rasterizer->blit_render_targets_to_screen(E->key(), E->get().ptr(), E->get().size());
}
}
-RID VisualServerViewport::viewport_create() {
+RID RenderingServerViewport::viewport_create() {
Viewport *viewport = memnew(Viewport);
@@ -463,21 +463,21 @@ RID VisualServerViewport::viewport_create() {
viewport->self = rid;
viewport->hide_scenario = false;
viewport->hide_canvas = false;
- viewport->render_target = VSG::storage->render_target_create();
- viewport->shadow_atlas = VSG::scene_render->shadow_atlas_create();
+ viewport->render_target = RSG::storage->render_target_create();
+ viewport->shadow_atlas = RSG::scene_render->shadow_atlas_create();
viewport->viewport_render_direct_to_screen = false;
return rid;
}
-void VisualServerViewport::viewport_set_use_arvr(RID p_viewport, bool p_use_arvr) {
+void RenderingServerViewport::viewport_set_use_arvr(RID p_viewport, bool p_use_arvr) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->use_arvr = p_use_arvr;
}
-void VisualServerViewport::viewport_set_size(RID p_viewport, int p_width, int p_height) {
+void RenderingServerViewport::viewport_set_size(RID p_viewport, int p_width, int p_height) {
ERR_FAIL_COND(p_width < 0 && p_height < 0);
@@ -485,18 +485,18 @@ void VisualServerViewport::viewport_set_size(RID p_viewport, int p_width, int p_
ERR_FAIL_COND(!viewport);
viewport->size = Size2(p_width, p_height);
- VSG::storage->render_target_set_size(viewport->render_target, p_width, p_height);
+ RSG::storage->render_target_set_size(viewport->render_target, p_width, p_height);
if (viewport->render_buffers.is_valid()) {
if (p_width == 0 || p_height == 0) {
- VSG::scene_render->free(viewport->render_buffers);
+ RSG::scene_render->free(viewport->render_buffers);
viewport->render_buffers = RID();
} else {
- VSG::scene_render->render_buffers_configure(viewport->render_buffers, viewport->render_target, viewport->size.width, viewport->size.height, viewport->msaa);
+ RSG::scene_render->render_buffers_configure(viewport->render_buffers, viewport->render_target, viewport->size.width, viewport->size.height, viewport->msaa);
}
}
}
-void VisualServerViewport::viewport_set_active(RID p_viewport, bool p_active) {
+void RenderingServerViewport::viewport_set_active(RID p_viewport, bool p_active) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -509,7 +509,7 @@ void VisualServerViewport::viewport_set_active(RID p_viewport, bool p_active) {
}
}
-void VisualServerViewport::viewport_set_parent_viewport(RID p_viewport, RID p_parent_viewport) {
+void RenderingServerViewport::viewport_set_parent_viewport(RID p_viewport, RID p_parent_viewport) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -517,7 +517,7 @@ void VisualServerViewport::viewport_set_parent_viewport(RID p_viewport, RID p_pa
viewport->parent = p_parent_viewport;
}
-void VisualServerViewport::viewport_set_clear_mode(RID p_viewport, VS::ViewportClearMode p_clear_mode) {
+void RenderingServerViewport::viewport_set_clear_mode(RID p_viewport, RS::ViewportClearMode p_clear_mode) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -525,7 +525,7 @@ void VisualServerViewport::viewport_set_clear_mode(RID p_viewport, VS::ViewportC
viewport->clear_mode = p_clear_mode;
}
-void VisualServerViewport::viewport_attach_to_screen(RID p_viewport, const Rect2 &p_rect, DisplayServer::WindowID p_screen) {
+void RenderingServerViewport::viewport_attach_to_screen(RID p_viewport, const Rect2 &p_rect, DisplayServer::WindowID p_screen) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -533,10 +533,10 @@ void VisualServerViewport::viewport_attach_to_screen(RID p_viewport, const Rect2
if (p_screen != DisplayServer::INVALID_WINDOW_ID) {
// If using GLES2 we can optimize this operation by rendering directly to system_fbo
// instead of rendering to fbo and copying to system_fbo after
- if (VSG::rasterizer->is_low_end() && viewport->viewport_render_direct_to_screen) {
+ if (RSG::rasterizer->is_low_end() && viewport->viewport_render_direct_to_screen) {
- VSG::storage->render_target_set_size(viewport->render_target, p_rect.size.x, p_rect.size.y);
- VSG::storage->render_target_set_position(viewport->render_target, p_rect.position.x, p_rect.position.y);
+ RSG::storage->render_target_set_size(viewport->render_target, p_rect.size.x, p_rect.size.y);
+ RSG::storage->render_target_set_position(viewport->render_target, p_rect.position.x, p_rect.position.y);
}
viewport->viewport_to_screen_rect = p_rect;
@@ -544,10 +544,10 @@ void VisualServerViewport::viewport_attach_to_screen(RID p_viewport, const Rect2
} else {
// if render_direct_to_screen was used, reset size and position
- if (VSG::rasterizer->is_low_end() && viewport->viewport_render_direct_to_screen) {
+ if (RSG::rasterizer->is_low_end() && viewport->viewport_render_direct_to_screen) {
- VSG::storage->render_target_set_position(viewport->render_target, 0, 0);
- VSG::storage->render_target_set_size(viewport->render_target, viewport->size.x, viewport->size.y);
+ RSG::storage->render_target_set_position(viewport->render_target, 0, 0);
+ RSG::storage->render_target_set_size(viewport->render_target, viewport->size.x, viewport->size.y);
}
viewport->viewport_to_screen_rect = Rect2();
@@ -555,7 +555,7 @@ void VisualServerViewport::viewport_attach_to_screen(RID p_viewport, const Rect2
}
}
-void VisualServerViewport::viewport_set_render_direct_to_screen(RID p_viewport, bool p_enable) {
+void RenderingServerViewport::viewport_set_render_direct_to_screen(RID p_viewport, bool p_enable) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -565,22 +565,22 @@ void VisualServerViewport::viewport_set_render_direct_to_screen(RID p_viewport,
// if disabled, reset render_target size and position
if (!p_enable) {
- VSG::storage->render_target_set_position(viewport->render_target, 0, 0);
- VSG::storage->render_target_set_size(viewport->render_target, viewport->size.x, viewport->size.y);
+ RSG::storage->render_target_set_position(viewport->render_target, 0, 0);
+ RSG::storage->render_target_set_size(viewport->render_target, viewport->size.x, viewport->size.y);
}
- VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_DIRECT_TO_SCREEN, p_enable);
+ RSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_DIRECT_TO_SCREEN, p_enable);
viewport->viewport_render_direct_to_screen = p_enable;
// if attached to screen already, setup screen size and position, this needs to happen after setting flag to avoid an unnecessary buffer allocation
- if (VSG::rasterizer->is_low_end() && viewport->viewport_to_screen_rect != Rect2() && p_enable) {
+ if (RSG::rasterizer->is_low_end() && viewport->viewport_to_screen_rect != Rect2() && p_enable) {
- VSG::storage->render_target_set_size(viewport->render_target, viewport->viewport_to_screen_rect.size.x, viewport->viewport_to_screen_rect.size.y);
- VSG::storage->render_target_set_position(viewport->render_target, viewport->viewport_to_screen_rect.position.x, viewport->viewport_to_screen_rect.position.y);
+ RSG::storage->render_target_set_size(viewport->render_target, viewport->viewport_to_screen_rect.size.x, viewport->viewport_to_screen_rect.size.y);
+ RSG::storage->render_target_set_position(viewport->render_target, viewport->viewport_to_screen_rect.position.x, viewport->viewport_to_screen_rect.position.y);
}
}
-void VisualServerViewport::viewport_set_update_mode(RID p_viewport, VS::ViewportUpdateMode p_mode) {
+void RenderingServerViewport::viewport_set_update_mode(RID p_viewport, RS::ViewportUpdateMode p_mode) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -588,29 +588,29 @@ void VisualServerViewport::viewport_set_update_mode(RID p_viewport, VS::Viewport
viewport->update_mode = p_mode;
}
-RID VisualServerViewport::viewport_get_texture(RID p_viewport) const {
+RID RenderingServerViewport::viewport_get_texture(RID p_viewport) const {
const Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND_V(!viewport, RID());
- return VSG::storage->render_target_get_texture(viewport->render_target);
+ return RSG::storage->render_target_get_texture(viewport->render_target);
}
-void VisualServerViewport::viewport_set_hide_scenario(RID p_viewport, bool p_hide) {
+void RenderingServerViewport::viewport_set_hide_scenario(RID p_viewport, bool p_hide) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->hide_scenario = p_hide;
}
-void VisualServerViewport::viewport_set_hide_canvas(RID p_viewport, bool p_hide) {
+void RenderingServerViewport::viewport_set_hide_canvas(RID p_viewport, bool p_hide) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->hide_canvas = p_hide;
}
-void VisualServerViewport::viewport_set_disable_environment(RID p_viewport, bool p_disable) {
+void RenderingServerViewport::viewport_set_disable_environment(RID p_viewport, bool p_disable) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -618,27 +618,27 @@ void VisualServerViewport::viewport_set_disable_environment(RID p_viewport, bool
viewport->disable_environment = p_disable;
}
-void VisualServerViewport::viewport_attach_camera(RID p_viewport, RID p_camera) {
+void RenderingServerViewport::viewport_attach_camera(RID p_viewport, RID p_camera) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->camera = p_camera;
}
-void VisualServerViewport::viewport_set_scenario(RID p_viewport, RID p_scenario) {
+void RenderingServerViewport::viewport_set_scenario(RID p_viewport, RID p_scenario) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->scenario = p_scenario;
}
-void VisualServerViewport::viewport_attach_canvas(RID p_viewport, RID p_canvas) {
+void RenderingServerViewport::viewport_attach_canvas(RID p_viewport, RID p_canvas) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
ERR_FAIL_COND(viewport->canvas_map.has(p_canvas));
- VisualServerCanvas::Canvas *canvas = VSG::canvas->canvas_owner.getornull(p_canvas);
+ RenderingServerCanvas::Canvas *canvas = RSG::canvas->canvas_owner.getornull(p_canvas);
ERR_FAIL_COND(!canvas);
canvas->viewports.insert(p_viewport);
@@ -648,18 +648,18 @@ void VisualServerViewport::viewport_attach_canvas(RID p_viewport, RID p_canvas)
viewport->canvas_map[p_canvas].canvas = canvas;
}
-void VisualServerViewport::viewport_remove_canvas(RID p_viewport, RID p_canvas) {
+void RenderingServerViewport::viewport_remove_canvas(RID p_viewport, RID p_canvas) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
- VisualServerCanvas::Canvas *canvas = VSG::canvas->canvas_owner.getornull(p_canvas);
+ RenderingServerCanvas::Canvas *canvas = RSG::canvas->canvas_owner.getornull(p_canvas);
ERR_FAIL_COND(!canvas);
viewport->canvas_map.erase(p_canvas);
canvas->viewports.erase(p_viewport);
}
-void VisualServerViewport::viewport_set_canvas_transform(RID p_viewport, RID p_canvas, const Transform2D &p_offset) {
+void RenderingServerViewport::viewport_set_canvas_transform(RID p_viewport, RID p_canvas, const Transform2D &p_offset) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -667,23 +667,23 @@ void VisualServerViewport::viewport_set_canvas_transform(RID p_viewport, RID p_c
ERR_FAIL_COND(!viewport->canvas_map.has(p_canvas));
viewport->canvas_map[p_canvas].transform = p_offset;
}
-void VisualServerViewport::viewport_set_transparent_background(RID p_viewport, bool p_enabled) {
+void RenderingServerViewport::viewport_set_transparent_background(RID p_viewport, bool p_enabled) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
- VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_TRANSPARENT, p_enabled);
+ RSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_TRANSPARENT, p_enabled);
viewport->transparent_bg = p_enabled;
}
-void VisualServerViewport::viewport_set_global_canvas_transform(RID p_viewport, const Transform2D &p_transform) {
+void RenderingServerViewport::viewport_set_global_canvas_transform(RID p_viewport, const Transform2D &p_transform) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->global_transform = p_transform;
}
-void VisualServerViewport::viewport_set_canvas_stacking(RID p_viewport, RID p_canvas, int p_layer, int p_sublayer) {
+void RenderingServerViewport::viewport_set_canvas_stacking(RID p_viewport, RID p_canvas, int p_layer, int p_sublayer) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -693,25 +693,25 @@ void VisualServerViewport::viewport_set_canvas_stacking(RID p_viewport, RID p_ca
viewport->canvas_map[p_canvas].sublayer = p_sublayer;
}
-void VisualServerViewport::viewport_set_shadow_atlas_size(RID p_viewport, int p_size) {
+void RenderingServerViewport::viewport_set_shadow_atlas_size(RID p_viewport, int p_size) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
viewport->shadow_atlas_size = p_size;
- VSG::scene_render->shadow_atlas_set_size(viewport->shadow_atlas, viewport->shadow_atlas_size);
+ RSG::scene_render->shadow_atlas_set_size(viewport->shadow_atlas, viewport->shadow_atlas_size);
}
-void VisualServerViewport::viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport, int p_quadrant, int p_subdiv) {
+void RenderingServerViewport::viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport, int p_quadrant, int p_subdiv) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
- VSG::scene_render->shadow_atlas_set_quadrant_subdivision(viewport->shadow_atlas, p_quadrant, p_subdiv);
+ RSG::scene_render->shadow_atlas_set_quadrant_subdivision(viewport->shadow_atlas, p_quadrant, p_subdiv);
}
-void VisualServerViewport::viewport_set_msaa(RID p_viewport, VS::ViewportMSAA p_msaa) {
+void RenderingServerViewport::viewport_set_msaa(RID p_viewport, RS::ViewportMSAA p_msaa) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -721,13 +721,13 @@ void VisualServerViewport::viewport_set_msaa(RID p_viewport, VS::ViewportMSAA p_
}
viewport->msaa = p_msaa;
if (viewport->render_buffers.is_valid()) {
- VSG::scene_render->render_buffers_configure(viewport->render_buffers, viewport->render_target, viewport->size.width, viewport->size.height, p_msaa);
+ RSG::scene_render->render_buffers_configure(viewport->render_buffers, viewport->render_target, viewport->size.width, viewport->size.height, p_msaa);
}
}
-int VisualServerViewport::viewport_get_render_info(RID p_viewport, VS::ViewportRenderInfo p_info) {
+int RenderingServerViewport::viewport_get_render_info(RID p_viewport, RS::ViewportRenderInfo p_info) {
- ERR_FAIL_INDEX_V(p_info, VS::VIEWPORT_RENDER_INFO_MAX, -1);
+ ERR_FAIL_INDEX_V(p_info, RS::VIEWPORT_RENDER_INFO_MAX, -1);
Viewport *viewport = viewport_owner.getornull(p_viewport);
if (!viewport)
@@ -736,7 +736,7 @@ int VisualServerViewport::viewport_get_render_info(RID p_viewport, VS::ViewportR
return viewport->render_info[p_info];
}
-void VisualServerViewport::viewport_set_debug_draw(RID p_viewport, VS::ViewportDebugDraw p_draw) {
+void RenderingServerViewport::viewport_set_debug_draw(RID p_viewport, RS::ViewportDebugDraw p_draw) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
@@ -744,16 +744,16 @@ void VisualServerViewport::viewport_set_debug_draw(RID p_viewport, VS::ViewportD
viewport->debug_draw = p_draw;
}
-bool VisualServerViewport::free(RID p_rid) {
+bool RenderingServerViewport::free(RID p_rid) {
if (viewport_owner.owns(p_rid)) {
Viewport *viewport = viewport_owner.getornull(p_rid);
- VSG::storage->free(viewport->render_target);
- VSG::scene_render->free(viewport->shadow_atlas);
+ RSG::storage->free(viewport->render_target);
+ RSG::scene_render->free(viewport->shadow_atlas);
if (viewport->render_buffers.is_valid()) {
- VSG::scene_render->free(viewport->render_buffers);
+ RSG::scene_render->free(viewport->render_buffers);
}
while (viewport->canvas_map.front()) {
@@ -772,9 +772,9 @@ bool VisualServerViewport::free(RID p_rid) {
return false;
}
-void VisualServerViewport::set_default_clear_color(const Color &p_color) {
- VSG::storage->set_default_clear_color(p_color);
+void RenderingServerViewport::set_default_clear_color(const Color &p_color) {
+ RSG::storage->set_default_clear_color(p_color);
}
-VisualServerViewport::VisualServerViewport() {
+RenderingServerViewport::RenderingServerViewport() {
}
diff --git a/servers/visual/visual_server_viewport.h b/servers/rendering/rendering_server_viewport.h
index 06372376f8..4ae7a7f536 100644
--- a/servers/visual/visual_server_viewport.h
+++ b/servers/rendering/rendering_server_viewport.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_viewport.h */
+/* rendering_server_viewport.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -35,9 +35,9 @@
#include "core/self_list.h"
#include "rasterizer.h"
#include "servers/arvr/arvr_interface.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
-class VisualServerViewport {
+class RenderingServerViewport {
public:
struct CanvasBase {
};
@@ -53,12 +53,12 @@ public:
RID camera;
RID scenario;
- VS::ViewportUpdateMode update_mode;
+ RS::ViewportUpdateMode update_mode;
RID render_target;
RID render_target_texture;
RID render_buffers;
- VS::ViewportMSAA msaa;
+ RS::ViewportMSAA msaa;
DisplayServer::WindowID viewport_to_screen;
Rect2 viewport_to_screen_rect;
@@ -75,10 +75,10 @@ public:
uint64_t last_pass = 0;
- int render_info[VS::VIEWPORT_RENDER_INFO_MAX];
- VS::ViewportDebugDraw debug_draw;
+ int render_info[RS::VIEWPORT_RENDER_INFO_MAX];
+ RS::ViewportDebugDraw debug_draw;
- VS::ViewportClearMode clear_mode;
+ RS::ViewportClearMode clear_mode;
bool transparent_bg;
@@ -115,16 +115,16 @@ public:
Map<RID, CanvasData> canvas_map;
Viewport() {
- update_mode = VS::VIEWPORT_UPDATE_WHEN_VISIBLE;
- clear_mode = VS::VIEWPORT_CLEAR_ALWAYS;
+ update_mode = RS::VIEWPORT_UPDATE_WHEN_VISIBLE;
+ clear_mode = RS::VIEWPORT_CLEAR_ALWAYS;
transparent_bg = false;
disable_environment = false;
viewport_to_screen = DisplayServer::INVALID_WINDOW_ID;
shadow_atlas_size = 0;
keep_3d_linear = false;
- debug_draw = VS::VIEWPORT_DEBUG_DRAW_DISABLED;
- msaa = VS::VIEWPORT_MSAA_DISABLED;
- for (int i = 0; i < VS::VIEWPORT_RENDER_INFO_MAX; i++) {
+ debug_draw = RS::VIEWPORT_DEBUG_DRAW_DISABLED;
+ msaa = RS::VIEWPORT_MSAA_DISABLED;
+ for (int i = 0; i < RS::VIEWPORT_RENDER_INFO_MAX; i++) {
render_info[i] = 0;
}
use_arvr = false;
@@ -167,10 +167,10 @@ public:
void viewport_set_active(RID p_viewport, bool p_active);
void viewport_set_parent_viewport(RID p_viewport, RID p_parent_viewport);
- void viewport_set_update_mode(RID p_viewport, VS::ViewportUpdateMode p_mode);
+ void viewport_set_update_mode(RID p_viewport, RS::ViewportUpdateMode p_mode);
void viewport_set_vflip(RID p_viewport, bool p_enable);
- void viewport_set_clear_mode(RID p_viewport, VS::ViewportClearMode p_clear_mode);
+ void viewport_set_clear_mode(RID p_viewport, RS::ViewportClearMode p_clear_mode);
RID viewport_get_texture(RID p_viewport) const;
@@ -191,18 +191,18 @@ public:
void viewport_set_shadow_atlas_size(RID p_viewport, int p_size);
void viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport, int p_quadrant, int p_subdiv);
- void viewport_set_msaa(RID p_viewport, VS::ViewportMSAA p_msaa);
+ void viewport_set_msaa(RID p_viewport, RS::ViewportMSAA p_msaa);
- virtual int viewport_get_render_info(RID p_viewport, VS::ViewportRenderInfo p_info);
- virtual void viewport_set_debug_draw(RID p_viewport, VS::ViewportDebugDraw p_draw);
+ virtual int viewport_get_render_info(RID p_viewport, RS::ViewportRenderInfo p_info);
+ virtual void viewport_set_debug_draw(RID p_viewport, RS::ViewportDebugDraw p_draw);
void set_default_clear_color(const Color &p_color);
void draw_viewports();
bool free(RID p_rid);
- VisualServerViewport();
- virtual ~VisualServerViewport() {}
+ RenderingServerViewport();
+ virtual ~RenderingServerViewport() {}
};
#endif // VISUALSERVERVIEWPORT_H
diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/rendering/rendering_server_wrap_mt.cpp
index 4169144fc9..d1bb7b67c6 100644
--- a/servers/visual/visual_server_wrap_mt.cpp
+++ b/servers/rendering/rendering_server_wrap_mt.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_wrap_mt.cpp */
+/* rendering_server_wrap_mt.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,43 +28,43 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server_wrap_mt.h"
+#include "rendering_server_wrap_mt.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "servers/display_server.h"
-void VisualServerWrapMT::thread_exit() {
+void RenderingServerWrapMT::thread_exit() {
exit = true;
}
-void VisualServerWrapMT::thread_draw(bool p_swap_buffers, double frame_step) {
+void RenderingServerWrapMT::thread_draw(bool p_swap_buffers, double frame_step) {
if (!atomic_decrement(&draw_pending)) {
- visual_server->draw(p_swap_buffers, frame_step);
+ rendering_server->draw(p_swap_buffers, frame_step);
}
}
-void VisualServerWrapMT::thread_flush() {
+void RenderingServerWrapMT::thread_flush() {
atomic_decrement(&draw_pending);
}
-void VisualServerWrapMT::_thread_callback(void *_instance) {
+void RenderingServerWrapMT::_thread_callback(void *_instance) {
- VisualServerWrapMT *vsmt = reinterpret_cast<VisualServerWrapMT *>(_instance);
+ RenderingServerWrapMT *vsmt = reinterpret_cast<RenderingServerWrapMT *>(_instance);
vsmt->thread_loop();
}
-void VisualServerWrapMT::thread_loop() {
+void RenderingServerWrapMT::thread_loop() {
server_thread = Thread::get_caller_id();
DisplayServer::get_singleton()->make_rendering_thread();
- visual_server->init();
+ rendering_server->init();
exit = false;
draw_thread_up = true;
@@ -75,66 +75,66 @@ void VisualServerWrapMT::thread_loop() {
command_queue.flush_all(); // flush all
- visual_server->finish();
+ rendering_server->finish();
}
/* EVENT QUEUING */
-void VisualServerWrapMT::sync() {
+void RenderingServerWrapMT::sync() {
if (create_thread) {
atomic_increment(&draw_pending);
- command_queue.push_and_sync(this, &VisualServerWrapMT::thread_flush);
+ command_queue.push_and_sync(this, &RenderingServerWrapMT::thread_flush);
} else {
command_queue.flush_all(); //flush all pending from other threads
}
}
-void VisualServerWrapMT::draw(bool p_swap_buffers, double frame_step) {
+void RenderingServerWrapMT::draw(bool p_swap_buffers, double frame_step) {
if (create_thread) {
atomic_increment(&draw_pending);
- command_queue.push(this, &VisualServerWrapMT::thread_draw, p_swap_buffers, frame_step);
+ command_queue.push(this, &RenderingServerWrapMT::thread_draw, p_swap_buffers, frame_step);
} else {
- visual_server->draw(p_swap_buffers, frame_step);
+ rendering_server->draw(p_swap_buffers, frame_step);
}
}
-void VisualServerWrapMT::init() {
+void RenderingServerWrapMT::init() {
if (create_thread) {
- print_verbose("VisualServerWrapMT: Creating render thread");
+ print_verbose("RenderingServerWrapMT: Creating render thread");
DisplayServer::get_singleton()->release_rendering_thread();
if (create_thread) {
thread = Thread::create(_thread_callback, this);
- print_verbose("VisualServerWrapMT: Starting render thread");
+ print_verbose("RenderingServerWrapMT: Starting render thread");
}
while (!draw_thread_up) {
OS::get_singleton()->delay_usec(1000);
}
- print_verbose("VisualServerWrapMT: Finished render thread");
+ print_verbose("RenderingServerWrapMT: Finished render thread");
} else {
- visual_server->init();
+ rendering_server->init();
}
}
-void VisualServerWrapMT::finish() {
+void RenderingServerWrapMT::finish() {
if (thread) {
- command_queue.push(this, &VisualServerWrapMT::thread_exit);
+ command_queue.push(this, &RenderingServerWrapMT::thread_exit);
Thread::wait_to_finish(thread);
memdelete(thread);
thread = NULL;
} else {
- visual_server->finish();
+ rendering_server->finish();
}
sky_free_cached_ids();
@@ -163,20 +163,20 @@ void VisualServerWrapMT::finish() {
canvas_occluder_polygon_free_cached_ids();
}
-void VisualServerWrapMT::set_use_vsync_callback(bool p_enable) {
+void RenderingServerWrapMT::set_use_vsync_callback(bool p_enable) {
singleton_mt->call_set_use_vsync(p_enable);
}
-VisualServerWrapMT *VisualServerWrapMT::singleton_mt = NULL;
+RenderingServerWrapMT *RenderingServerWrapMT::singleton_mt = NULL;
-VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread) :
+RenderingServerWrapMT::RenderingServerWrapMT(RenderingServer *p_contained, bool p_create_thread) :
command_queue(p_create_thread) {
singleton_mt = this;
DisplayServer::switch_vsync_function = set_use_vsync_callback; //as this goes to another thread, make sure it goes properly
- visual_server = p_contained;
+ rendering_server = p_contained;
create_thread = p_create_thread;
thread = NULL;
draw_pending = 0;
@@ -190,8 +190,8 @@ VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_
}
}
-VisualServerWrapMT::~VisualServerWrapMT() {
+RenderingServerWrapMT::~RenderingServerWrapMT() {
- memdelete(visual_server);
+ memdelete(rendering_server);
//finish();
}
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/rendering/rendering_server_wrap_mt.h
index e043ac5214..4d449ea913 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/rendering/rendering_server_wrap_mt.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server_wrap_mt.h */
+/* rendering_server_wrap_mt.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,17 +28,17 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef VISUAL_SERVER_WRAP_MT_H
-#define VISUAL_SERVER_WRAP_MT_H
+#ifndef RENDERING_SERVER_WRAP_MT_H
+#define RENDERING_SERVER_WRAP_MT_H
#include "core/command_queue_mt.h"
#include "core/os/thread.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
-class VisualServerWrapMT : public VisualServer {
+class RenderingServerWrapMT : public RenderingServer {
// the real visual server
- mutable VisualServer *visual_server;
+ mutable RenderingServer *rendering_server;
mutable CommandQueueMT command_queue;
@@ -63,7 +63,7 @@ class VisualServerWrapMT : public VisualServer {
//#define DEBUG_SYNC
- static VisualServerWrapMT *singleton_mt;
+ static RenderingServerWrapMT *singleton_mt;
#ifdef DEBUG_SYNC
#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));
@@ -72,28 +72,28 @@ class VisualServerWrapMT : public VisualServer {
#endif
public:
-#define ServerName VisualServer
-#define ServerNameWrapMT VisualServerWrapMT
-#define server_name visual_server
+#define ServerName RenderingServer
+#define ServerNameWrapMT RenderingServerWrapMT
+#define server_name rendering_server
#include "servers/server_wrap_mt_common.h"
//these go pass-through, as they can be called from any thread
- virtual RID texture_2d_create(const Ref<Image> &p_image) { return visual_server->texture_2d_create(p_image); }
- virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, TextureLayeredType p_layered_type) { return visual_server->texture_2d_layered_create(p_layers, p_layered_type); }
- virtual RID texture_3d_create(const Vector<Ref<Image>> &p_slices) { return visual_server->texture_3d_create(p_slices); }
- virtual RID texture_proxy_create(RID p_base) { return visual_server->texture_proxy_create(p_base); }
+ virtual RID texture_2d_create(const Ref<Image> &p_image) { return rendering_server->texture_2d_create(p_image); }
+ virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, TextureLayeredType p_layered_type) { return rendering_server->texture_2d_layered_create(p_layers, p_layered_type); }
+ virtual RID texture_3d_create(const Vector<Ref<Image>> &p_slices) { return rendering_server->texture_3d_create(p_slices); }
+ virtual RID texture_proxy_create(RID p_base) { return rendering_server->texture_proxy_create(p_base); }
//goes pass-through
- virtual void texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) { visual_server->texture_2d_update_immediate(p_texture, p_image, p_layer); }
+ virtual void texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) { rendering_server->texture_2d_update_immediate(p_texture, p_image, p_layer); }
//these go through command queue if they are in another thread
FUNC3(texture_2d_update, RID, const Ref<Image> &, int)
FUNC4(texture_3d_update, RID, const Ref<Image> &, int, int)
FUNC2(texture_proxy_update, RID, RID)
//these also go pass-through
- virtual RID texture_2d_placeholder_create() { return visual_server->texture_2d_placeholder_create(); }
- virtual RID texture_2d_layered_placeholder_create() { return visual_server->texture_2d_layered_placeholder_create(); }
- virtual RID texture_3d_placeholder_create() { return visual_server->texture_3d_placeholder_create(); }
+ virtual RID texture_2d_placeholder_create() { return rendering_server->texture_2d_placeholder_create(); }
+ virtual RID texture_2d_layered_placeholder_create() { return rendering_server->texture_2d_layered_placeholder_create(); }
+ virtual RID texture_3d_placeholder_create() { return rendering_server->texture_3d_placeholder_create(); }
FUNC1RC(Ref<Image>, texture_2d_get, RID)
FUNC2RC(Ref<Image>, texture_2d_layer_get, RID, int)
@@ -145,7 +145,7 @@ public:
/* MESH API */
virtual RID mesh_create_from_surfaces(const Vector<SurfaceData> &p_surfaces) {
- return visual_server->mesh_create_from_surfaces(p_surfaces);
+ return rendering_server->mesh_create_from_surfaces(p_surfaces);
}
FUNCRID(mesh)
@@ -346,7 +346,7 @@ public:
FUNC1(particles_request_process, RID)
FUNC1(particles_restart, RID)
- FUNC2(particles_set_draw_order, RID, VS::ParticlesDrawOrder)
+ FUNC2(particles_set_draw_order, RID, RS::ParticlesDrawOrder)
FUNC2(particles_set_draw_passes, RID, int)
FUNC3(particles_set_draw_pass_mesh, RID, int, RID)
@@ -406,7 +406,7 @@ public:
//this passes directly to avoid stalling, but it's pretty dangerous, so don't call after freeing a viewport
virtual int viewport_get_render_info(RID p_viewport, ViewportRenderInfo p_info) {
- return visual_server->viewport_get_render_info(p_viewport, p_info);
+ return rendering_server->viewport_get_render_info(p_viewport, p_info);
}
FUNC2(viewport_set_debug_draw, RID, ViewportDebugDraw)
@@ -617,15 +617,15 @@ public:
//this passes directly to avoid stalling
virtual int get_render_info(RenderInfo p_info) {
- return visual_server->get_render_info(p_info);
+ return rendering_server->get_render_info(p_info);
}
virtual String get_video_adapter_name() const {
- return visual_server->get_video_adapter_name();
+ return rendering_server->get_video_adapter_name();
}
virtual String get_video_adapter_vendor() const {
- return visual_server->get_video_adapter_vendor();
+ return rendering_server->get_video_adapter_vendor();
}
FUNC4(set_boot_image, const Ref<Image> &, const Color &, bool, bool)
@@ -636,10 +636,10 @@ public:
FUNC1(set_debug_generate_wireframes, bool)
virtual bool has_feature(Features p_feature) const {
- return visual_server->has_feature(p_feature);
+ return rendering_server->has_feature(p_feature);
}
virtual bool has_os_feature(const String &p_feature) const {
- return visual_server->has_os_feature(p_feature);
+ return rendering_server->has_os_feature(p_feature);
}
FUNC1(call_set_use_vsync, bool)
@@ -647,23 +647,23 @@ public:
static void set_use_vsync_callback(bool p_enable);
virtual bool is_low_end() const {
- return visual_server->is_low_end();
+ return rendering_server->is_low_end();
}
virtual uint64_t get_frame_profile_frame() {
- return visual_server->get_frame_profile_frame();
+ return rendering_server->get_frame_profile_frame();
}
virtual void set_frame_profiling_enabled(bool p_enabled) {
- visual_server->set_frame_profiling_enabled(p_enabled);
+ rendering_server->set_frame_profiling_enabled(p_enabled);
}
virtual Vector<FrameProfileArea> get_frame_profile() {
- return visual_server->get_frame_profile();
+ return rendering_server->get_frame_profile();
}
- VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread);
- ~VisualServerWrapMT();
+ RenderingServerWrapMT(RenderingServer *p_contained, bool p_create_thread);
+ ~RenderingServerWrapMT();
#undef ServerName
#undef ServerNameWrapMT
diff --git a/servers/visual/shader_language.cpp b/servers/rendering/shader_language.cpp
index 98786fad3b..cf2a01c07c 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -31,7 +31,7 @@
#include "shader_language.h"
#include "core/os/os.h"
#include "core/print_string.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
static bool _is_text_char(CharType c) {
@@ -2165,7 +2165,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, const Map<Strin
}
if (!fail) {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
if (builtin_func_defs[idx].high_end) {
fail = true;
unsupported_builtin = true;
@@ -4772,7 +4772,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
if (tk.type == TK_BRACKET_OPEN) {
bool unknown_size = false;
- if (VisualServer::get_singleton()->is_low_end() && is_const) {
+ if (RenderingServer::get_singleton()->is_low_end() && is_const) {
_set_error("Local const arrays are supported only on high-end platform!");
return ERR_PARSE_ERROR;
}
@@ -4818,7 +4818,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
tk = _get_token();
if (tk.type == TK_OP_ASSIGN) {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
_set_error("Array initialization is supported only on high-end platform!");
return ERR_PARSE_ERROR;
}
@@ -5136,7 +5136,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
}
} else if (tk.type == TK_CF_SWITCH) {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
_set_error("\"switch\" operator is supported only on high-end platform!");
return ERR_PARSE_ERROR;
}
@@ -5617,7 +5617,7 @@ String ShaderLanguage::_get_qualifier_str(ArgumentQualifier p_qualifier) const {
}
Error ShaderLanguage::_validate_datatype(DataType p_type) {
- if (VisualServer::get_singleton()->is_low_end()) {
+ if (RenderingServer::get_singleton()->is_low_end()) {
bool invalid_type = false;
switch (p_type) {
@@ -6763,7 +6763,7 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
}
int idx = 0;
- bool low_end = VisualServer::get_singleton()->is_low_end();
+ bool low_end = RenderingServer::get_singleton()->is_low_end();
while (builtin_func_defs[idx].name) {
if (low_end && builtin_func_defs[idx].high_end) {
@@ -6776,7 +6776,7 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
} else { // sub-class
int idx = 0;
- bool low_end = VisualServer::get_singleton()->is_low_end();
+ bool low_end = RenderingServer::get_singleton()->is_low_end();
while (builtin_func_defs[idx].name) {
if (low_end && builtin_func_defs[idx].high_end) {
@@ -6854,7 +6854,7 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
int idx = 0;
String calltip;
- bool low_end = VisualServer::get_singleton()->is_low_end();
+ bool low_end = RenderingServer::get_singleton()->is_low_end();
while (builtin_func_defs[idx].name) {
diff --git a/servers/visual/shader_language.h b/servers/rendering/shader_language.h
index bdc15cc4aa..bdc15cc4aa 100644
--- a/servers/visual/shader_language.h
+++ b/servers/rendering/shader_language.h
diff --git a/servers/rendering/shader_types.cpp b/servers/rendering/shader_types.cpp
new file mode 100644
index 0000000000..b144d6d612
--- /dev/null
+++ b/servers/rendering/shader_types.cpp
@@ -0,0 +1,328 @@
+/*************************************************************************/
+/* shader_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "shader_types.h"
+
+const Map<StringName, ShaderLanguage::FunctionInfo> &ShaderTypes::get_functions(RS::ShaderMode p_mode) {
+
+ return shader_modes[p_mode].functions;
+}
+
+const Vector<StringName> &ShaderTypes::get_modes(RS::ShaderMode p_mode) {
+
+ return shader_modes[p_mode].modes;
+}
+
+const Set<String> &ShaderTypes::get_types() {
+ return shader_types;
+}
+
+ShaderTypes *ShaderTypes::singleton = NULL;
+
+static ShaderLanguage::BuiltInInfo constt(ShaderLanguage::DataType p_type) {
+
+ return ShaderLanguage::BuiltInInfo(p_type, true);
+}
+
+ShaderTypes::ShaderTypes() {
+ singleton = this;
+
+ /*************** SPATIAL ***********************/
+
+ shader_modes[RS::SHADER_SPATIAL].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
+
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["VERTEX"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["NORMAL"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["TANGENT"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["BINORMAL"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["POSITION"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["UV"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["UV2"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["POINT_SIZE"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["INSTANCE_ID"] = constt(ShaderLanguage::TYPE_INT);
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["INSTANCE_CUSTOM"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["ROUGHNESS"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].can_discard = false;
+
+ //builtins
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["WORLD_MATRIX"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["WORLD_NORMAL_MATRIX"] = ShaderLanguage::TYPE_MAT3;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["INV_CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["PROJECTION_MATRIX"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["INV_PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["MODELVIEW_MATRIX"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["MODELVIEW_NORMAL_MATRIX"] = ShaderLanguage::TYPE_MAT3;
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["VIEWPORT_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SPATIAL].functions["vertex"].built_ins["OUTPUT_IS_SRGB"] = constt(ShaderLanguage::TYPE_BOOL);
+
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["VERTEX"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["FRONT_FACING"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["NORMAL"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["TANGENT"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["BINORMAL"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["VIEW"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["NORMALMAP"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["NORMALMAP_DEPTH"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["UV2"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["ALBEDO"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["METALLIC"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["SPECULAR"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["ROUGHNESS"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["RIM"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["RIM_TINT"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["CLEARCOAT"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["CLEARCOAT_GLOSS"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["ANISOTROPY"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["ANISOTROPY_FLOW"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["SSS_STRENGTH"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["TRANSMISSION"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["AO"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["AO_LIGHT_AFFECT"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["EMISSION"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["SCREEN_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["DEPTH_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["DEPTH"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["SCREEN_UV"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["POINT_COORD"] = constt(ShaderLanguage::TYPE_VEC2);
+
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["OUTPUT_IS_SRGB"] = constt(ShaderLanguage::TYPE_BOOL);
+
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["WORLD_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["WORLD_NORMAL_MATRIX"] = constt(ShaderLanguage::TYPE_MAT3);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["INV_CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["INV_PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].built_ins["VIEWPORT_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SPATIAL].functions["fragment"].can_discard = true;
+
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["WORLD_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["INV_CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["INV_PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["VIEWPORT_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["NORMAL"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["UV2"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["VIEW"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["LIGHT"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["LIGHT_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["ATTENUATION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["ALBEDO"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["TRANSMISSION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["ROUGHNESS"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["DIFFUSE_LIGHT"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["SPECULAR_LIGHT"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["OUTPUT_IS_SRGB"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].built_ins["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
+
+ shader_modes[RS::SHADER_SPATIAL].functions["light"].can_discard = true;
+
+ //order used puts first enum mode (default) first
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("blend_mix");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("blend_add");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("blend_sub");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("blend_mul");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("depth_draw_opaque");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("depth_draw_always");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("depth_draw_never");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("depth_prepass_alpha");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("depth_test_disabled");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("cull_back");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("cull_front");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("cull_disabled");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("unshaded");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("wireframe");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("diffuse_lambert");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("diffuse_lambert_wrap");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("diffuse_oren_nayar");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("diffuse_burley");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("diffuse_toon");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("specular_schlick_ggx");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("specular_blinn");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("specular_phong");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("specular_toon");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("specular_disabled");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("skip_vertex_transform");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("world_vertex_coords");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("ensure_correct_normals");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("shadows_disabled");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("ambient_light_disabled");
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("shadow_to_opacity");
+
+ shader_modes[RS::SHADER_SPATIAL].modes.push_back("vertex_lighting");
+
+ /************ CANVAS ITEM **************************/
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["VERTEX"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["UV"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["POINT_SIZE"] = ShaderLanguage::TYPE_FLOAT;
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["WORLD_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["CANVAS_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["SCREEN_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["INSTANCE_CUSTOM"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["AT_LIGHT_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["vertex"].can_discard = false;
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["VERTEX"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SHADOW_VERTEX"] = ShaderLanguage::TYPE_VEC2;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["LIGHT_VERTEX"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMAL"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMALMAP"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMALMAP_DEPTH"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMAL_TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SPECULAR_SHININESS_TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SPECULAR_SHININESS"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SCREEN_UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SCREEN_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["POINT_COORD"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["AT_LIGHT_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SCREEN_TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["fragment"].can_discard = true;
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["NORMAL"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["SPECULAR_SHININESS"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT_COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT_POSITION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT_VERTEX"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["SHADOW_MODULATE"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["SCREEN_UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].built_ins["POINT_COORD"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_CANVAS_ITEM].functions["light"].can_discard = true;
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("skip_vertex_transform");
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("blend_mix");
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("blend_add");
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("blend_sub");
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("blend_mul");
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("blend_premul_alpha");
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("blend_disabled");
+
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("unshaded");
+ shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("light_only");
+
+ /************ PARTICLES **************************/
+
+ shader_modes[RS::SHADER_PARTICLES].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["VELOCITY"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["MASS"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["ACTIVE"] = ShaderLanguage::TYPE_BOOL;
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["RESTART"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["CUSTOM"] = ShaderLanguage::TYPE_VEC4;
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["TRANSFORM"] = ShaderLanguage::TYPE_MAT4;
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["LIFETIME"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["DELTA"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["NUMBER"] = constt(ShaderLanguage::TYPE_UINT);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["INDEX"] = constt(ShaderLanguage::TYPE_INT);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["EMISSION_TRANSFORM"] = constt(ShaderLanguage::TYPE_MAT4);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["RANDOM_SEED"] = constt(ShaderLanguage::TYPE_UINT);
+ shader_modes[RS::SHADER_PARTICLES].functions["vertex"].can_discard = false;
+
+ shader_modes[RS::SHADER_PARTICLES].modes.push_back("disable_force");
+ shader_modes[RS::SHADER_PARTICLES].modes.push_back("disable_velocity");
+ shader_modes[RS::SHADER_PARTICLES].modes.push_back("keep_data");
+
+ /************ SKY **************************/
+
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["POSITION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["RADIANCE"] = constt(ShaderLanguage::TYPE_SAMPLERCUBE);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["AT_HALF_RES_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["AT_QUARTER_RES_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["AT_CUBEMAP_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT0_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT0_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT0_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT0_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT1_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT1_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT1_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT1_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT2_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT2_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT2_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT2_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT3_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT3_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT3_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
+ shader_modes[RS::SHADER_SKY].functions["global"].built_ins["LIGHT3_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
+
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC3;
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["EYEDIR"] = constt(ShaderLanguage::TYPE_VEC3);
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["SCREEN_UV"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["SKY_COORDS"] = constt(ShaderLanguage::TYPE_VEC2);
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["HALF_RES_COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
+ shader_modes[RS::SHADER_SKY].functions["fragment"].built_ins["QUARTER_RES_COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
+
+ shader_modes[RS::SHADER_SKY].modes.push_back("use_half_res_pass");
+ shader_modes[RS::SHADER_SKY].modes.push_back("use_quarter_res_pass");
+
+ shader_types.insert("spatial");
+ shader_types.insert("canvas_item");
+ shader_types.insert("particles");
+ shader_types.insert("sky");
+}
diff --git a/servers/visual/shader_types.h b/servers/rendering/shader_types.h
index 7d674bfb5c..499a761265 100644
--- a/servers/visual/shader_types.h
+++ b/servers/rendering/shader_types.h
@@ -32,7 +32,7 @@
#define SHADERTYPES_H
#include "core/ordered_hash_map.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
#include "shader_language.h"
class ShaderTypes {
@@ -43,7 +43,7 @@ class ShaderTypes {
Vector<StringName> modes;
};
- Map<VS::ShaderMode, Type> shader_modes;
+ Map<RS::ShaderMode, Type> shader_modes;
static ShaderTypes *singleton;
@@ -52,8 +52,8 @@ class ShaderTypes {
public:
static ShaderTypes *get_singleton() { return singleton; }
- const Map<StringName, ShaderLanguage::FunctionInfo> &get_functions(VS::ShaderMode p_mode);
- const Vector<StringName> &get_modes(VS::ShaderMode p_mode);
+ const Map<StringName, ShaderLanguage::FunctionInfo> &get_functions(RS::ShaderMode p_mode);
+ const Vector<StringName> &get_modes(RS::ShaderMode p_mode);
const Set<String> &get_types();
ShaderTypes();
diff --git a/servers/visual_server.cpp b/servers/rendering_server.cpp
index fecaf563db..0c5b9a258f 100644
--- a/servers/visual_server.cpp
+++ b/servers/rendering_server.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server.cpp */
+/* rendering_server.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,20 +28,20 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visual_server.h"
+#include "rendering_server.h"
#include "core/method_bind_ext.gen.inc"
#include "core/project_settings.h"
-VisualServer *VisualServer::singleton = NULL;
-VisualServer *(*VisualServer::create_func)() = NULL;
+RenderingServer *RenderingServer::singleton = NULL;
+RenderingServer *(*RenderingServer::create_func)() = NULL;
-VisualServer *VisualServer::get_singleton() {
+RenderingServer *RenderingServer::get_singleton() {
return singleton;
}
-VisualServer *VisualServer::create() {
+RenderingServer *RenderingServer::create() {
ERR_FAIL_COND_V(singleton, NULL);
@@ -51,7 +51,7 @@ VisualServer *VisualServer::create() {
return NULL;
}
-Array VisualServer::_texture_debug_usage_bind() {
+Array RenderingServer::_texture_debug_usage_bind() {
List<TextureInfo> list;
texture_debug_usage(&list);
@@ -71,7 +71,7 @@ Array VisualServer::_texture_debug_usage_bind() {
return arr;
}
-Array VisualServer::_shader_get_param_list_bind(RID p_shader) const {
+Array RenderingServer::_shader_get_param_list_bind(RID p_shader) const {
List<PropertyInfo> l;
shader_get_param_list(p_shader, &l);
@@ -87,19 +87,19 @@ static Array to_array(const Vector<ObjectID> &ids) {
return a;
}
-Array VisualServer::_instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario) const {
+Array RenderingServer::_instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario) const {
Vector<ObjectID> ids = instances_cull_aabb(p_aabb, p_scenario);
return to_array(ids);
}
-Array VisualServer::_instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
+Array RenderingServer::_instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
Vector<ObjectID> ids = instances_cull_ray(p_from, p_to, p_scenario);
return to_array(ids);
}
-Array VisualServer::_instances_cull_convex_bind(const Array &p_convex, RID p_scenario) const {
+Array RenderingServer::_instances_cull_convex_bind(const Array &p_convex, RID p_scenario) const {
Vector<Plane> planes;
for (int i = 0; i < p_convex.size(); ++i) {
@@ -112,7 +112,7 @@ Array VisualServer::_instances_cull_convex_bind(const Array &p_convex, RID p_sce
return to_array(ids);
}
-RID VisualServer::get_test_texture() {
+RID RenderingServer::get_test_texture() {
if (test_texture.is_valid()) {
return test_texture;
@@ -160,7 +160,7 @@ RID VisualServer::get_test_texture() {
return test_texture;
}
-void VisualServer::_free_internal_rids() {
+void RenderingServer::_free_internal_rids() {
if (test_texture.is_valid())
free(test_texture);
@@ -170,7 +170,7 @@ void VisualServer::_free_internal_rids() {
free(test_material);
}
-RID VisualServer::_make_test_cube() {
+RID RenderingServer::_make_test_cube() {
Vector<Vector3> vertices;
Vector<Vector3> normals;
@@ -223,17 +223,17 @@ RID VisualServer::_make_test_cube() {
RID test_cube = mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VisualServer::ARRAY_NORMAL] = normals;
- d[VisualServer::ARRAY_TANGENT] = tangents;
- d[VisualServer::ARRAY_TEX_UV] = uvs;
- d[VisualServer::ARRAY_VERTEX] = vertices;
+ d.resize(RS::ARRAY_MAX);
+ d[RenderingServer::ARRAY_NORMAL] = normals;
+ d[RenderingServer::ARRAY_TANGENT] = tangents;
+ d[RenderingServer::ARRAY_TEX_UV] = uvs;
+ d[RenderingServer::ARRAY_VERTEX] = vertices;
Vector<int> indices;
indices.resize(vertices.size());
for (int i = 0; i < vertices.size(); i++)
indices.set(i, i);
- d[VisualServer::ARRAY_INDEX] = indices;
+ d[RenderingServer::ARRAY_INDEX] = indices;
mesh_add_surface_from_arrays(test_cube, PRIMITIVE_TRIANGLES, d);
@@ -252,7 +252,7 @@ RID VisualServer::_make_test_cube() {
return test_cube;
}
-RID VisualServer::make_sphere_mesh(int p_lats, int p_lons, float p_radius) {
+RID RenderingServer::make_sphere_mesh(int p_lats, int p_lons, float p_radius) {
Vector<Vector3> vertices;
Vector<Vector3> normals;
@@ -299,7 +299,7 @@ RID VisualServer::make_sphere_mesh(int p_lats, int p_lons, float p_radius) {
RID mesh = mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
d[ARRAY_VERTEX] = vertices;
d[ARRAY_NORMAL] = normals;
@@ -309,7 +309,7 @@ RID VisualServer::make_sphere_mesh(int p_lats, int p_lons, float p_radius) {
return mesh;
}
-RID VisualServer::get_white_texture() {
+RID RenderingServer::get_white_texture() {
if (white_texture.is_valid())
return white_texture;
@@ -329,7 +329,7 @@ RID VisualServer::get_white_texture() {
#define SMALL_VEC2 Vector2(0.00001, 0.00001)
#define SMALL_VEC3 Vector3(0.00001, 0.00001, 0.00001)
-Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_t *p_offsets, uint32_t p_stride, Vector<uint8_t> &r_vertex_array, int p_vertex_array_len, Vector<uint8_t> &r_index_array, int p_index_array_len, AABB &r_aabb, Vector<AABB> &r_bone_aabb) {
+Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_t *p_offsets, uint32_t p_stride, Vector<uint8_t> &r_vertex_array, int p_vertex_array_len, Vector<uint8_t> &r_index_array, int p_index_array_len, AABB &r_aabb, Vector<AABB> &r_bone_aabb) {
uint8_t *vw = r_vertex_array.ptrw();
@@ -340,16 +340,16 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
int max_bone = 0;
- for (int ai = 0; ai < VS::ARRAY_MAX; ai++) {
+ for (int ai = 0; ai < RS::ARRAY_MAX; ai++) {
if (!(p_format & (1 << ai))) // no array
continue;
switch (ai) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
- if (p_format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ if (p_format & RS::ARRAY_FLAG_USE_2D_VERTICES) {
Vector<Vector2> array = p_arrays[ai];
ERR_FAIL_COND_V(array.size() != p_vertex_array_len, ERR_INVALID_PARAMETER);
@@ -408,7 +408,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_VECTOR3_ARRAY, ERR_INVALID_PARAMETER);
@@ -443,7 +443,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_FLOAT32_ARRAY, ERR_INVALID_PARAMETER);
@@ -481,7 +481,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_COLOR_ARRAY, ERR_INVALID_PARAMETER);
@@ -513,7 +513,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_VECTOR3_ARRAY && p_arrays[ai].get_type() != Variant::PACKED_VECTOR2_ARRAY, ERR_INVALID_PARAMETER);
@@ -542,7 +542,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_VECTOR3_ARRAY && p_arrays[ai].get_type() != Variant::PACKED_VECTOR2_ARRAY, ERR_INVALID_PARAMETER);
@@ -569,13 +569,13 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
}
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_FLOAT32_ARRAY, ERR_INVALID_PARAMETER);
Vector<real_t> array = p_arrays[ai];
- ERR_FAIL_COND_V(array.size() != p_vertex_array_len * VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(array.size() != p_vertex_array_len * RS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER);
const real_t *src = array.ptr();
@@ -583,9 +583,9 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
for (int i = 0; i < p_vertex_array_len; i++) {
- uint16_t data[VS::ARRAY_WEIGHTS_SIZE];
- for (int j = 0; j < VS::ARRAY_WEIGHTS_SIZE; j++) {
- data[j] = CLAMP(src[i * VS::ARRAY_WEIGHTS_SIZE + j] * 65535, 0, 65535);
+ uint16_t data[RS::ARRAY_WEIGHTS_SIZE];
+ for (int j = 0; j < RS::ARRAY_WEIGHTS_SIZE; j++) {
+ data[j] = CLAMP(src[i * RS::ARRAY_WEIGHTS_SIZE + j] * 65535, 0, 65535);
}
copymem(&vw[p_offsets[ai] + i * p_stride], data, 2 * 4);
@@ -593,21 +593,21 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT32_ARRAY && p_arrays[ai].get_type() != Variant::PACKED_FLOAT32_ARRAY, ERR_INVALID_PARAMETER);
Vector<int> array = p_arrays[ai];
- ERR_FAIL_COND_V(array.size() != p_vertex_array_len * VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(array.size() != p_vertex_array_len * RS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER);
const int *src = array.ptr();
for (int i = 0; i < p_vertex_array_len; i++) {
- uint16_t data[VS::ARRAY_WEIGHTS_SIZE];
- for (int j = 0; j < VS::ARRAY_WEIGHTS_SIZE; j++) {
- data[j] = src[i * VS::ARRAY_WEIGHTS_SIZE + j];
+ uint16_t data[RS::ARRAY_WEIGHTS_SIZE];
+ for (int j = 0; j < RS::ARRAY_WEIGHTS_SIZE; j++) {
+ data[j] = src[i * RS::ARRAY_WEIGHTS_SIZE + j];
max_bone = MAX(data[j], max_bone);
}
@@ -615,7 +615,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
ERR_FAIL_NULL_V(iw, ERR_INVALID_DATA);
ERR_FAIL_COND_V(p_index_array_len <= 0, ERR_INVALID_DATA);
@@ -648,7 +648,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
}
- if (p_format & VS::ARRAY_FORMAT_BONES) {
+ if (p_format & RS::ARRAY_FORMAT_BONES) {
//create AABBs for each detected bone
int total_bones = max_bone + 1;
@@ -662,9 +662,9 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
}
}
- Vector<Vector3> vertices = p_arrays[VS::ARRAY_VERTEX];
- Vector<int> bones = p_arrays[VS::ARRAY_BONES];
- Vector<float> weights = p_arrays[VS::ARRAY_WEIGHTS];
+ Vector<Vector3> vertices = p_arrays[RS::ARRAY_VERTEX];
+ Vector<int> bones = p_arrays[RS::ARRAY_BONES];
+ Vector<float> weights = p_arrays[RS::ARRAY_WEIGHTS];
bool any_valid = false;
@@ -707,22 +707,22 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
return OK;
}
-uint32_t VisualServer::mesh_surface_get_format_offset(uint32_t p_format, int p_vertex_len, int p_index_len, int p_array_index) const {
+uint32_t RenderingServer::mesh_surface_get_format_offset(uint32_t p_format, int p_vertex_len, int p_index_len, int p_array_index) const {
uint32_t offsets[ARRAY_MAX];
mesh_surface_make_offsets_from_format(p_format, p_vertex_len, p_index_len, offsets);
return offsets[p_array_index];
}
-uint32_t VisualServer::mesh_surface_get_format_stride(uint32_t p_format, int p_vertex_len, int p_index_len) const {
+uint32_t RenderingServer::mesh_surface_get_format_stride(uint32_t p_format, int p_vertex_len, int p_index_len) const {
uint32_t offsets[ARRAY_MAX];
return mesh_surface_make_offsets_from_format(p_format, p_vertex_len, p_index_len, offsets);
}
-uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format, int p_vertex_len, int p_index_len, uint32_t *r_offsets) const {
+uint32_t RenderingServer::mesh_surface_make_offsets_from_format(uint32_t p_format, int p_vertex_len, int p_index_len, uint32_t *r_offsets) const {
int total_elem_size = 0;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
r_offsets[i] = 0; //reset
@@ -733,7 +733,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
if (p_format & ARRAY_FLAG_USE_2D_VERTICES) {
elem_size = 2;
@@ -750,7 +750,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
if (p_format & ARRAY_COMPRESS_NORMAL) {
elem_size = sizeof(uint32_t);
@@ -760,7 +760,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
if (p_format & ARRAY_COMPRESS_TANGENT) {
elem_size = sizeof(uint32_t);
} else {
@@ -768,7 +768,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
if (p_format & ARRAY_COMPRESS_COLOR) {
elem_size = sizeof(uint32_t);
@@ -776,7 +776,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
elem_size = sizeof(float) * 4;
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
if (p_format & ARRAY_COMPRESS_TEX_UV) {
elem_size = sizeof(uint32_t);
} else {
@@ -785,7 +785,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
if (p_format & ARRAY_COMPRESS_TEX_UV2) {
elem_size = sizeof(uint32_t);
} else {
@@ -793,17 +793,17 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
}
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
elem_size = sizeof(uint16_t) * 4;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
elem_size = sizeof(uint16_t) * 4;
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
if (p_index_len <= 0) {
ERR_PRINT("index_array_len==NO_INDEX_ARRAY");
@@ -831,10 +831,10 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
return total_elem_size;
}
-Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_data, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, const Dictionary &p_lods, uint32_t p_compress_format) {
+Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_data, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, const Dictionary &p_lods, uint32_t p_compress_format) {
- ERR_FAIL_INDEX_V(p_primitive, VS::PRIMITIVE_MAX, ERR_INVALID_PARAMETER);
- ERR_FAIL_COND_V(p_arrays.size() != VS::ARRAY_MAX, ERR_INVALID_PARAMETER);
+ ERR_FAIL_INDEX_V(p_primitive, RS::PRIMITIVE_MAX, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_arrays.size() != RS::ARRAY_MAX, ERR_INVALID_PARAMETER);
uint32_t format = 0;
@@ -849,7 +849,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
format |= (1 << i);
- if (i == VS::ARRAY_VERTEX) {
+ if (i == RS::ARRAY_VERTEX) {
Variant var = p_arrays[i];
switch (var.get_type()) {
@@ -866,13 +866,13 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
array_len = PackedVector3Array(p_arrays[i]).size();
ERR_FAIL_COND_V(array_len == 0, ERR_INVALID_DATA);
- } else if (i == VS::ARRAY_INDEX) {
+ } else if (i == RS::ARRAY_INDEX) {
index_array_len = PackedInt32Array(p_arrays[i]).size();
}
}
- ERR_FAIL_COND_V((format & VS::ARRAY_FORMAT_VERTEX) == 0, ERR_INVALID_PARAMETER); // mandatory
+ ERR_FAIL_COND_V((format & RS::ARRAY_FORMAT_VERTEX) == 0, ERR_INVALID_PARAMETER); // mandatory
if (p_blend_shapes.size()) {
//validate format for morphs
@@ -886,15 +886,15 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
bsformat |= (1 << j);
}
- ERR_FAIL_COND_V((bsformat) != (format & (VS::ARRAY_FORMAT_INDEX - 1)), ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V((bsformat) != (format & (RS::ARRAY_FORMAT_INDEX - 1)), ERR_INVALID_PARAMETER);
}
}
- uint32_t offsets[VS::ARRAY_MAX];
+ uint32_t offsets[RS::ARRAY_MAX];
int total_elem_size = 0;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
offsets[i] = 0; //reset
@@ -905,7 +905,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
Variant arr = p_arrays[0];
if (arr.get_type() == Variant::PACKED_VECTOR2_ARRAY) {
@@ -923,7 +923,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
if (p_compress_format & ARRAY_COMPRESS_NORMAL) {
elem_size = sizeof(uint32_t);
@@ -933,7 +933,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
if (p_compress_format & ARRAY_COMPRESS_TANGENT) {
elem_size = sizeof(uint32_t);
} else {
@@ -941,7 +941,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
if (p_compress_format & ARRAY_COMPRESS_COLOR) {
elem_size = sizeof(uint32_t);
@@ -949,7 +949,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
elem_size = sizeof(float) * 4;
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
if (p_compress_format & ARRAY_COMPRESS_TEX_UV) {
elem_size = sizeof(uint32_t);
} else {
@@ -958,7 +958,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
if (p_compress_format & ARRAY_COMPRESS_TEX_UV2) {
elem_size = sizeof(uint32_t);
} else {
@@ -966,17 +966,17 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
}
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
elem_size = sizeof(uint16_t) * 4;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
elem_size = sizeof(uint16_t) * 4;
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
if (index_array_len <= 0) {
ERR_PRINT("index_array_len==NO_INDEX_ARRAY");
@@ -1010,7 +1010,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
Vector<uint8_t> vertex_array;
vertex_array.resize(array_size);
- int index_array_size = offsets[VS::ARRAY_INDEX] * index_array_len;
+ int index_array_size = offsets[RS::ARRAY_INDEX] * index_array_len;
Vector<uint8_t> index_array;
index_array.resize(index_array_size);
@@ -1092,7 +1092,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_
return OK;
}
-void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, const Dictionary &p_lods, uint32_t p_compress_format) {
+void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, const Dictionary &p_lods, uint32_t p_compress_format) {
SurfaceData sd;
Error err = mesh_create_surface_data_from_arrays(&sd, p_primitive, p_arrays, p_blend_shapes, p_lods, p_compress_format);
@@ -1102,13 +1102,13 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
mesh_add_surface(p_mesh, sd);
}
-Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p_vertex_data, int p_vertex_len, Vector<uint8_t> p_index_data, int p_index_len) const {
+Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p_vertex_data, int p_vertex_len, Vector<uint8_t> p_index_data, int p_index_len) const {
uint32_t offsets[ARRAY_MAX];
int total_elem_size = 0;
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
offsets[i] = 0; //reset
@@ -1119,7 +1119,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
if (p_format & ARRAY_FLAG_USE_2D_VERTICES) {
elem_size = 2;
@@ -1132,7 +1132,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
if (p_format & ARRAY_COMPRESS_NORMAL) {
elem_size = sizeof(uint32_t);
@@ -1142,7 +1142,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
if (p_format & ARRAY_COMPRESS_TANGENT) {
elem_size = sizeof(uint32_t);
} else {
@@ -1150,7 +1150,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
}
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
if (p_format & ARRAY_COMPRESS_COLOR) {
elem_size = sizeof(uint32_t);
@@ -1158,7 +1158,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
elem_size = sizeof(float) * 4;
}
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
if (p_format & ARRAY_COMPRESS_TEX_UV) {
elem_size = sizeof(uint32_t);
} else {
@@ -1167,7 +1167,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
if (p_format & ARRAY_COMPRESS_TEX_UV2) {
elem_size = sizeof(uint32_t);
} else {
@@ -1175,17 +1175,17 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
}
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
elem_size = sizeof(uint16_t) * 4;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
elem_size = sizeof(uint16_t) * 4;
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
if (p_index_len <= 0) {
ERR_PRINT("index_array_len==NO_INDEX_ARRAY");
@@ -1212,18 +1212,18 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
}
Array ret;
- ret.resize(VS::ARRAY_MAX);
+ ret.resize(RS::ARRAY_MAX);
const uint8_t *r = p_vertex_data.ptr();
- for (int i = 0; i < VS::ARRAY_MAX; i++) {
+ for (int i = 0; i < RS::ARRAY_MAX; i++) {
if (!(p_format & (1 << i)))
continue;
switch (i) {
- case VS::ARRAY_VERTEX: {
+ case RS::ARRAY_VERTEX: {
if (p_format & ARRAY_FLAG_USE_2D_VERTICES) {
@@ -1262,7 +1262,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
}
} break;
- case VS::ARRAY_NORMAL: {
+ case RS::ARRAY_NORMAL: {
Vector<Vector3> arr;
arr.resize(p_vertex_len);
@@ -1290,7 +1290,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
} break;
- case VS::ARRAY_TANGENT: {
+ case RS::ARRAY_TANGENT: {
Vector<float> arr;
arr.resize(p_vertex_len * 4);
if (p_format & ARRAY_COMPRESS_TANGENT) {
@@ -1318,7 +1318,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
ret[i] = arr;
} break;
- case VS::ARRAY_COLOR: {
+ case RS::ARRAY_COLOR: {
Vector<Color> arr;
arr.resize(p_vertex_len);
@@ -1344,7 +1344,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
ret[i] = arr;
} break;
- case VS::ARRAY_TEX_UV: {
+ case RS::ARRAY_TEX_UV: {
Vector<Vector2> arr;
arr.resize(p_vertex_len);
@@ -1372,7 +1372,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
ret[i] = arr;
} break;
- case VS::ARRAY_TEX_UV2: {
+ case RS::ARRAY_TEX_UV2: {
Vector<Vector2> arr;
arr.resize(p_vertex_len);
@@ -1399,7 +1399,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
ret[i] = arr;
} break;
- case VS::ARRAY_WEIGHTS: {
+ case RS::ARRAY_WEIGHTS: {
Vector<float> arr;
arr.resize(p_vertex_len * 4);
@@ -1418,7 +1418,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
ret[i] = arr;
} break;
- case VS::ARRAY_BONES: {
+ case RS::ARRAY_BONES: {
Vector<int> arr;
arr.resize(p_vertex_len * 4);
@@ -1436,7 +1436,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
ret[i] = arr;
} break;
- case VS::ARRAY_INDEX: {
+ case RS::ARRAY_INDEX: {
/* determine whether using 16 or 32 bits indices */
const uint8_t *ir = p_index_data.ptr();
@@ -1472,13 +1472,13 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, Vector<uint8_t> p
return ret;
}
-Array VisualServer::mesh_surface_get_arrays(RID p_mesh, int p_surface) const {
+Array RenderingServer::mesh_surface_get_arrays(RID p_mesh, int p_surface) const {
SurfaceData sd = mesh_get_surface(p_mesh, p_surface);
return mesh_create_arrays_from_surface_data(sd);
}
-Dictionary VisualServer::mesh_surface_get_lods(RID p_mesh, int p_surface) const {
+Dictionary RenderingServer::mesh_surface_get_lods(RID p_mesh, int p_surface) const {
SurfaceData sd = mesh_get_surface(p_mesh, p_surface);
ERR_FAIL_COND_V(sd.vertex_count == 0, Dictionary());
@@ -1513,7 +1513,7 @@ Dictionary VisualServer::mesh_surface_get_lods(RID p_mesh, int p_surface) const
return ret;
}
-Array VisualServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const {
+Array RenderingServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const {
SurfaceData sd = mesh_get_surface(p_mesh, p_surface);
ERR_FAIL_COND_V(sd.vertex_count == 0, Array());
@@ -1540,7 +1540,7 @@ Array VisualServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surfac
}
}
-Array VisualServer::mesh_create_arrays_from_surface_data(const SurfaceData &p_data) const {
+Array RenderingServer::mesh_create_arrays_from_surface_data(const SurfaceData &p_data) const {
Vector<uint8_t> vertex_data = p_data.vertex_data;
@@ -1555,9 +1555,9 @@ Array VisualServer::mesh_create_arrays_from_surface_data(const SurfaceData &p_da
return _get_array_from_surface(format, vertex_data, vertex_len, index_data, index_len);
}
#if 0
-Array VisualServer::_mesh_surface_get_skeleton_aabb_bind(RID p_mesh, int p_surface) const {
+Array RenderingServer::_mesh_surface_get_skeleton_aabb_bind(RID p_mesh, int p_surface) const {
- Vector<AABB> vec = VS::get_singleton()->mesh_surface_get_skeleton_aabb(p_mesh, p_surface);
+ Vector<AABB> vec = RS::get_singleton()->mesh_surface_get_skeleton_aabb(p_mesh, p_surface);
Array arr;
for (int i = 0; i < vec.size(); i++) {
arr[i] = vec[i];
@@ -1565,388 +1565,388 @@ Array VisualServer::_mesh_surface_get_skeleton_aabb_bind(RID p_mesh, int p_surfa
return arr;
}
#endif
-void VisualServer::_bind_methods() {
+void RenderingServer::_bind_methods() {
- ClassDB::bind_method(D_METHOD("force_sync"), &VisualServer::sync);
- ClassDB::bind_method(D_METHOD("force_draw", "swap_buffers", "frame_step"), &VisualServer::draw, DEFVAL(true), DEFVAL(0.0));
+ ClassDB::bind_method(D_METHOD("force_sync"), &RenderingServer::sync);
+ ClassDB::bind_method(D_METHOD("force_draw", "swap_buffers", "frame_step"), &RenderingServer::draw, DEFVAL(true), DEFVAL(0.0));
#ifndef _MSC_VER
#warning TODO all texture methods need re-binding
#endif
- ClassDB::bind_method(D_METHOD("texture_2d_create", "image"), &VisualServer::texture_2d_create);
- ClassDB::bind_method(D_METHOD("texture_2d_get", "texture"), &VisualServer::texture_2d_get);
+ ClassDB::bind_method(D_METHOD("texture_2d_create", "image"), &RenderingServer::texture_2d_create);
+ ClassDB::bind_method(D_METHOD("texture_2d_get", "texture"), &RenderingServer::texture_2d_get);
#ifndef _3D_DISABLED
- ClassDB::bind_method(D_METHOD("sky_create"), &VisualServer::sky_create);
- ClassDB::bind_method(D_METHOD("sky_set_material", "sky", "material"), &VisualServer::sky_set_material);
+ ClassDB::bind_method(D_METHOD("sky_create"), &RenderingServer::sky_create);
+ ClassDB::bind_method(D_METHOD("sky_set_material", "sky", "material"), &RenderingServer::sky_set_material);
#endif
- ClassDB::bind_method(D_METHOD("shader_create"), &VisualServer::shader_create);
- ClassDB::bind_method(D_METHOD("shader_set_code", "shader", "code"), &VisualServer::shader_set_code);
- ClassDB::bind_method(D_METHOD("shader_get_code", "shader"), &VisualServer::shader_get_code);
- ClassDB::bind_method(D_METHOD("shader_get_param_list", "shader"), &VisualServer::_shader_get_param_list_bind);
- ClassDB::bind_method(D_METHOD("shader_set_default_texture_param", "shader", "name", "texture"), &VisualServer::shader_set_default_texture_param);
- ClassDB::bind_method(D_METHOD("shader_get_default_texture_param", "shader", "name"), &VisualServer::shader_get_default_texture_param);
- ClassDB::bind_method(D_METHOD("shader_get_param_default", "material", "parameter"), &VisualServer::shader_get_param_default);
-
- ClassDB::bind_method(D_METHOD("material_create"), &VisualServer::material_create);
- ClassDB::bind_method(D_METHOD("material_set_shader", "shader_material", "shader"), &VisualServer::material_set_shader);
- ClassDB::bind_method(D_METHOD("material_set_param", "material", "parameter", "value"), &VisualServer::material_set_param);
- ClassDB::bind_method(D_METHOD("material_get_param", "material", "parameter"), &VisualServer::material_get_param);
- ClassDB::bind_method(D_METHOD("material_set_render_priority", "material", "priority"), &VisualServer::material_set_render_priority);
-
- ClassDB::bind_method(D_METHOD("material_set_next_pass", "material", "next_material"), &VisualServer::material_set_next_pass);
-
- ClassDB::bind_method(D_METHOD("mesh_create"), &VisualServer::mesh_create);
- ClassDB::bind_method(D_METHOD("mesh_surface_get_format_offset", "format", "vertex_len", "index_len", "array_index"), &VisualServer::mesh_surface_get_format_offset);
- ClassDB::bind_method(D_METHOD("mesh_surface_get_format_stride", "format", "vertex_len", "index_len"), &VisualServer::mesh_surface_get_format_stride);
- ClassDB::bind_method(D_METHOD("mesh_add_surface_from_arrays", "mesh", "primitive", "arrays", "blend_shapes", "lods", "compress_format"), &VisualServer::mesh_add_surface_from_arrays, DEFVAL(Array()), DEFVAL(Dictionary()), DEFVAL(ARRAY_COMPRESS_DEFAULT));
- ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_count", "mesh"), &VisualServer::mesh_get_blend_shape_count);
- ClassDB::bind_method(D_METHOD("mesh_set_blend_shape_mode", "mesh", "mode"), &VisualServer::mesh_set_blend_shape_mode);
- ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_mode", "mesh"), &VisualServer::mesh_get_blend_shape_mode);
- ClassDB::bind_method(D_METHOD("mesh_surface_update_region", "mesh", "surface", "offset", "data"), &VisualServer::mesh_surface_update_region);
- ClassDB::bind_method(D_METHOD("mesh_surface_set_material", "mesh", "surface", "material"), &VisualServer::mesh_surface_set_material);
- ClassDB::bind_method(D_METHOD("mesh_surface_get_material", "mesh", "surface"), &VisualServer::mesh_surface_get_material);
- ClassDB::bind_method(D_METHOD("mesh_surface_get_arrays", "mesh", "surface"), &VisualServer::mesh_surface_get_arrays);
- ClassDB::bind_method(D_METHOD("mesh_surface_get_blend_shape_arrays", "mesh", "surface"), &VisualServer::mesh_surface_get_blend_shape_arrays);
- ClassDB::bind_method(D_METHOD("mesh_get_surface_count", "mesh"), &VisualServer::mesh_get_surface_count);
- ClassDB::bind_method(D_METHOD("mesh_set_custom_aabb", "mesh", "aabb"), &VisualServer::mesh_set_custom_aabb);
- ClassDB::bind_method(D_METHOD("mesh_get_custom_aabb", "mesh"), &VisualServer::mesh_get_custom_aabb);
- ClassDB::bind_method(D_METHOD("mesh_clear", "mesh"), &VisualServer::mesh_clear);
-
- ClassDB::bind_method(D_METHOD("multimesh_create"), &VisualServer::multimesh_create);
- ClassDB::bind_method(D_METHOD("multimesh_allocate", "multimesh", "instances", "transform_format", "color_format", "custom_data_format"), &VisualServer::multimesh_allocate, DEFVAL(false), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("multimesh_get_instance_count", "multimesh"), &VisualServer::multimesh_get_instance_count);
- ClassDB::bind_method(D_METHOD("multimesh_set_mesh", "multimesh", "mesh"), &VisualServer::multimesh_set_mesh);
- ClassDB::bind_method(D_METHOD("multimesh_instance_set_transform", "multimesh", "index", "transform"), &VisualServer::multimesh_instance_set_transform);
- ClassDB::bind_method(D_METHOD("multimesh_instance_set_transform_2d", "multimesh", "index", "transform"), &VisualServer::multimesh_instance_set_transform_2d);
- ClassDB::bind_method(D_METHOD("multimesh_instance_set_color", "multimesh", "index", "color"), &VisualServer::multimesh_instance_set_color);
- ClassDB::bind_method(D_METHOD("multimesh_instance_set_custom_data", "multimesh", "index", "custom_data"), &VisualServer::multimesh_instance_set_custom_data);
- ClassDB::bind_method(D_METHOD("multimesh_get_mesh", "multimesh"), &VisualServer::multimesh_get_mesh);
- ClassDB::bind_method(D_METHOD("multimesh_get_aabb", "multimesh"), &VisualServer::multimesh_get_aabb);
- ClassDB::bind_method(D_METHOD("multimesh_instance_get_transform", "multimesh", "index"), &VisualServer::multimesh_instance_get_transform);
- ClassDB::bind_method(D_METHOD("multimesh_instance_get_transform_2d", "multimesh", "index"), &VisualServer::multimesh_instance_get_transform_2d);
- ClassDB::bind_method(D_METHOD("multimesh_instance_get_color", "multimesh", "index"), &VisualServer::multimesh_instance_get_color);
- ClassDB::bind_method(D_METHOD("multimesh_instance_get_custom_data", "multimesh", "index"), &VisualServer::multimesh_instance_get_custom_data);
- ClassDB::bind_method(D_METHOD("multimesh_set_visible_instances", "multimesh", "visible"), &VisualServer::multimesh_set_visible_instances);
- ClassDB::bind_method(D_METHOD("multimesh_get_visible_instances", "multimesh"), &VisualServer::multimesh_get_visible_instances);
- ClassDB::bind_method(D_METHOD("multimesh_set_buffer", "multimesh", "buffer"), &VisualServer::multimesh_set_buffer);
- ClassDB::bind_method(D_METHOD("multimesh_get_buffer", "multimesh"), &VisualServer::multimesh_get_buffer);
+ ClassDB::bind_method(D_METHOD("shader_create"), &RenderingServer::shader_create);
+ ClassDB::bind_method(D_METHOD("shader_set_code", "shader", "code"), &RenderingServer::shader_set_code);
+ ClassDB::bind_method(D_METHOD("shader_get_code", "shader"), &RenderingServer::shader_get_code);
+ ClassDB::bind_method(D_METHOD("shader_get_param_list", "shader"), &RenderingServer::_shader_get_param_list_bind);
+ ClassDB::bind_method(D_METHOD("shader_set_default_texture_param", "shader", "name", "texture"), &RenderingServer::shader_set_default_texture_param);
+ ClassDB::bind_method(D_METHOD("shader_get_default_texture_param", "shader", "name"), &RenderingServer::shader_get_default_texture_param);
+ ClassDB::bind_method(D_METHOD("shader_get_param_default", "material", "parameter"), &RenderingServer::shader_get_param_default);
+
+ ClassDB::bind_method(D_METHOD("material_create"), &RenderingServer::material_create);
+ ClassDB::bind_method(D_METHOD("material_set_shader", "shader_material", "shader"), &RenderingServer::material_set_shader);
+ ClassDB::bind_method(D_METHOD("material_set_param", "material", "parameter", "value"), &RenderingServer::material_set_param);
+ ClassDB::bind_method(D_METHOD("material_get_param", "material", "parameter"), &RenderingServer::material_get_param);
+ ClassDB::bind_method(D_METHOD("material_set_render_priority", "material", "priority"), &RenderingServer::material_set_render_priority);
+
+ ClassDB::bind_method(D_METHOD("material_set_next_pass", "material", "next_material"), &RenderingServer::material_set_next_pass);
+
+ ClassDB::bind_method(D_METHOD("mesh_create"), &RenderingServer::mesh_create);
+ ClassDB::bind_method(D_METHOD("mesh_surface_get_format_offset", "format", "vertex_len", "index_len", "array_index"), &RenderingServer::mesh_surface_get_format_offset);
+ ClassDB::bind_method(D_METHOD("mesh_surface_get_format_stride", "format", "vertex_len", "index_len"), &RenderingServer::mesh_surface_get_format_stride);
+ ClassDB::bind_method(D_METHOD("mesh_add_surface_from_arrays", "mesh", "primitive", "arrays", "blend_shapes", "lods", "compress_format"), &RenderingServer::mesh_add_surface_from_arrays, DEFVAL(Array()), DEFVAL(Dictionary()), DEFVAL(ARRAY_COMPRESS_DEFAULT));
+ ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_count", "mesh"), &RenderingServer::mesh_get_blend_shape_count);
+ ClassDB::bind_method(D_METHOD("mesh_set_blend_shape_mode", "mesh", "mode"), &RenderingServer::mesh_set_blend_shape_mode);
+ ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_mode", "mesh"), &RenderingServer::mesh_get_blend_shape_mode);
+ ClassDB::bind_method(D_METHOD("mesh_surface_update_region", "mesh", "surface", "offset", "data"), &RenderingServer::mesh_surface_update_region);
+ ClassDB::bind_method(D_METHOD("mesh_surface_set_material", "mesh", "surface", "material"), &RenderingServer::mesh_surface_set_material);
+ ClassDB::bind_method(D_METHOD("mesh_surface_get_material", "mesh", "surface"), &RenderingServer::mesh_surface_get_material);
+ ClassDB::bind_method(D_METHOD("mesh_surface_get_arrays", "mesh", "surface"), &RenderingServer::mesh_surface_get_arrays);
+ ClassDB::bind_method(D_METHOD("mesh_surface_get_blend_shape_arrays", "mesh", "surface"), &RenderingServer::mesh_surface_get_blend_shape_arrays);
+ ClassDB::bind_method(D_METHOD("mesh_get_surface_count", "mesh"), &RenderingServer::mesh_get_surface_count);
+ ClassDB::bind_method(D_METHOD("mesh_set_custom_aabb", "mesh", "aabb"), &RenderingServer::mesh_set_custom_aabb);
+ ClassDB::bind_method(D_METHOD("mesh_get_custom_aabb", "mesh"), &RenderingServer::mesh_get_custom_aabb);
+ ClassDB::bind_method(D_METHOD("mesh_clear", "mesh"), &RenderingServer::mesh_clear);
+
+ ClassDB::bind_method(D_METHOD("multimesh_create"), &RenderingServer::multimesh_create);
+ ClassDB::bind_method(D_METHOD("multimesh_allocate", "multimesh", "instances", "transform_format", "color_format", "custom_data_format"), &RenderingServer::multimesh_allocate, DEFVAL(false), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("multimesh_get_instance_count", "multimesh"), &RenderingServer::multimesh_get_instance_count);
+ ClassDB::bind_method(D_METHOD("multimesh_set_mesh", "multimesh", "mesh"), &RenderingServer::multimesh_set_mesh);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_set_transform", "multimesh", "index", "transform"), &RenderingServer::multimesh_instance_set_transform);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_set_transform_2d", "multimesh", "index", "transform"), &RenderingServer::multimesh_instance_set_transform_2d);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_set_color", "multimesh", "index", "color"), &RenderingServer::multimesh_instance_set_color);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_set_custom_data", "multimesh", "index", "custom_data"), &RenderingServer::multimesh_instance_set_custom_data);
+ ClassDB::bind_method(D_METHOD("multimesh_get_mesh", "multimesh"), &RenderingServer::multimesh_get_mesh);
+ ClassDB::bind_method(D_METHOD("multimesh_get_aabb", "multimesh"), &RenderingServer::multimesh_get_aabb);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_get_transform", "multimesh", "index"), &RenderingServer::multimesh_instance_get_transform);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_get_transform_2d", "multimesh", "index"), &RenderingServer::multimesh_instance_get_transform_2d);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_get_color", "multimesh", "index"), &RenderingServer::multimesh_instance_get_color);
+ ClassDB::bind_method(D_METHOD("multimesh_instance_get_custom_data", "multimesh", "index"), &RenderingServer::multimesh_instance_get_custom_data);
+ ClassDB::bind_method(D_METHOD("multimesh_set_visible_instances", "multimesh", "visible"), &RenderingServer::multimesh_set_visible_instances);
+ ClassDB::bind_method(D_METHOD("multimesh_get_visible_instances", "multimesh"), &RenderingServer::multimesh_get_visible_instances);
+ ClassDB::bind_method(D_METHOD("multimesh_set_buffer", "multimesh", "buffer"), &RenderingServer::multimesh_set_buffer);
+ ClassDB::bind_method(D_METHOD("multimesh_get_buffer", "multimesh"), &RenderingServer::multimesh_get_buffer);
#ifndef _3D_DISABLED
- ClassDB::bind_method(D_METHOD("immediate_create"), &VisualServer::immediate_create);
- ClassDB::bind_method(D_METHOD("immediate_begin", "immediate", "primitive", "texture"), &VisualServer::immediate_begin, DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("immediate_vertex", "immediate", "vertex"), &VisualServer::immediate_vertex);
- ClassDB::bind_method(D_METHOD("immediate_vertex_2d", "immediate", "vertex"), &VisualServer::immediate_vertex_2d);
- ClassDB::bind_method(D_METHOD("immediate_normal", "immediate", "normal"), &VisualServer::immediate_normal);
- ClassDB::bind_method(D_METHOD("immediate_tangent", "immediate", "tangent"), &VisualServer::immediate_tangent);
- ClassDB::bind_method(D_METHOD("immediate_color", "immediate", "color"), &VisualServer::immediate_color);
- ClassDB::bind_method(D_METHOD("immediate_uv", "immediate", "tex_uv"), &VisualServer::immediate_uv);
- ClassDB::bind_method(D_METHOD("immediate_uv2", "immediate", "tex_uv"), &VisualServer::immediate_uv2);
- ClassDB::bind_method(D_METHOD("immediate_end", "immediate"), &VisualServer::immediate_end);
- ClassDB::bind_method(D_METHOD("immediate_clear", "immediate"), &VisualServer::immediate_clear);
- ClassDB::bind_method(D_METHOD("immediate_set_material", "immediate", "material"), &VisualServer::immediate_set_material);
- ClassDB::bind_method(D_METHOD("immediate_get_material", "immediate"), &VisualServer::immediate_get_material);
+ ClassDB::bind_method(D_METHOD("immediate_create"), &RenderingServer::immediate_create);
+ ClassDB::bind_method(D_METHOD("immediate_begin", "immediate", "primitive", "texture"), &RenderingServer::immediate_begin, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("immediate_vertex", "immediate", "vertex"), &RenderingServer::immediate_vertex);
+ ClassDB::bind_method(D_METHOD("immediate_vertex_2d", "immediate", "vertex"), &RenderingServer::immediate_vertex_2d);
+ ClassDB::bind_method(D_METHOD("immediate_normal", "immediate", "normal"), &RenderingServer::immediate_normal);
+ ClassDB::bind_method(D_METHOD("immediate_tangent", "immediate", "tangent"), &RenderingServer::immediate_tangent);
+ ClassDB::bind_method(D_METHOD("immediate_color", "immediate", "color"), &RenderingServer::immediate_color);
+ ClassDB::bind_method(D_METHOD("immediate_uv", "immediate", "tex_uv"), &RenderingServer::immediate_uv);
+ ClassDB::bind_method(D_METHOD("immediate_uv2", "immediate", "tex_uv"), &RenderingServer::immediate_uv2);
+ ClassDB::bind_method(D_METHOD("immediate_end", "immediate"), &RenderingServer::immediate_end);
+ ClassDB::bind_method(D_METHOD("immediate_clear", "immediate"), &RenderingServer::immediate_clear);
+ ClassDB::bind_method(D_METHOD("immediate_set_material", "immediate", "material"), &RenderingServer::immediate_set_material);
+ ClassDB::bind_method(D_METHOD("immediate_get_material", "immediate"), &RenderingServer::immediate_get_material);
#endif
- ClassDB::bind_method(D_METHOD("skeleton_create"), &VisualServer::skeleton_create);
- ClassDB::bind_method(D_METHOD("skeleton_allocate", "skeleton", "bones", "is_2d_skeleton"), &VisualServer::skeleton_allocate, DEFVAL(false));
- ClassDB::bind_method(D_METHOD("skeleton_get_bone_count", "skeleton"), &VisualServer::skeleton_get_bone_count);
- ClassDB::bind_method(D_METHOD("skeleton_bone_set_transform", "skeleton", "bone", "transform"), &VisualServer::skeleton_bone_set_transform);
- ClassDB::bind_method(D_METHOD("skeleton_bone_get_transform", "skeleton", "bone"), &VisualServer::skeleton_bone_get_transform);
- ClassDB::bind_method(D_METHOD("skeleton_bone_set_transform_2d", "skeleton", "bone", "transform"), &VisualServer::skeleton_bone_set_transform_2d);
- ClassDB::bind_method(D_METHOD("skeleton_bone_get_transform_2d", "skeleton", "bone"), &VisualServer::skeleton_bone_get_transform_2d);
+ ClassDB::bind_method(D_METHOD("skeleton_create"), &RenderingServer::skeleton_create);
+ ClassDB::bind_method(D_METHOD("skeleton_allocate", "skeleton", "bones", "is_2d_skeleton"), &RenderingServer::skeleton_allocate, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("skeleton_get_bone_count", "skeleton"), &RenderingServer::skeleton_get_bone_count);
+ ClassDB::bind_method(D_METHOD("skeleton_bone_set_transform", "skeleton", "bone", "transform"), &RenderingServer::skeleton_bone_set_transform);
+ ClassDB::bind_method(D_METHOD("skeleton_bone_get_transform", "skeleton", "bone"), &RenderingServer::skeleton_bone_get_transform);
+ ClassDB::bind_method(D_METHOD("skeleton_bone_set_transform_2d", "skeleton", "bone", "transform"), &RenderingServer::skeleton_bone_set_transform_2d);
+ ClassDB::bind_method(D_METHOD("skeleton_bone_get_transform_2d", "skeleton", "bone"), &RenderingServer::skeleton_bone_get_transform_2d);
#ifndef _3D_DISABLED
- ClassDB::bind_method(D_METHOD("directional_light_create"), &VisualServer::directional_light_create);
- ClassDB::bind_method(D_METHOD("omni_light_create"), &VisualServer::omni_light_create);
- ClassDB::bind_method(D_METHOD("spot_light_create"), &VisualServer::spot_light_create);
-
- ClassDB::bind_method(D_METHOD("light_set_color", "light", "color"), &VisualServer::light_set_color);
- ClassDB::bind_method(D_METHOD("light_set_param", "light", "param", "value"), &VisualServer::light_set_param);
- ClassDB::bind_method(D_METHOD("light_set_shadow", "light", "enabled"), &VisualServer::light_set_shadow);
- ClassDB::bind_method(D_METHOD("light_set_shadow_color", "light", "color"), &VisualServer::light_set_shadow_color);
- ClassDB::bind_method(D_METHOD("light_set_projector", "light", "texture"), &VisualServer::light_set_projector);
- ClassDB::bind_method(D_METHOD("light_set_negative", "light", "enable"), &VisualServer::light_set_negative);
- ClassDB::bind_method(D_METHOD("light_set_cull_mask", "light", "mask"), &VisualServer::light_set_cull_mask);
- ClassDB::bind_method(D_METHOD("light_set_reverse_cull_face_mode", "light", "enabled"), &VisualServer::light_set_reverse_cull_face_mode);
- ClassDB::bind_method(D_METHOD("light_set_use_gi", "light", "enabled"), &VisualServer::light_set_use_gi);
-
- ClassDB::bind_method(D_METHOD("light_omni_set_shadow_mode", "light", "mode"), &VisualServer::light_omni_set_shadow_mode);
-
- ClassDB::bind_method(D_METHOD("light_directional_set_shadow_mode", "light", "mode"), &VisualServer::light_directional_set_shadow_mode);
- ClassDB::bind_method(D_METHOD("light_directional_set_blend_splits", "light", "enable"), &VisualServer::light_directional_set_blend_splits);
- ClassDB::bind_method(D_METHOD("light_directional_set_shadow_depth_range_mode", "light", "range_mode"), &VisualServer::light_directional_set_shadow_depth_range_mode);
-
- ClassDB::bind_method(D_METHOD("reflection_probe_create"), &VisualServer::reflection_probe_create);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_update_mode", "probe", "mode"), &VisualServer::reflection_probe_set_update_mode);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_intensity", "probe", "intensity"), &VisualServer::reflection_probe_set_intensity);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_interior_ambient", "probe", "color"), &VisualServer::reflection_probe_set_interior_ambient);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_interior_ambient_energy", "probe", "energy"), &VisualServer::reflection_probe_set_interior_ambient_energy);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_interior_ambient_probe_contribution", "probe", "contrib"), &VisualServer::reflection_probe_set_interior_ambient_probe_contribution);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_max_distance", "probe", "distance"), &VisualServer::reflection_probe_set_max_distance);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_extents", "probe", "extents"), &VisualServer::reflection_probe_set_extents);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_origin_offset", "probe", "offset"), &VisualServer::reflection_probe_set_origin_offset);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_as_interior", "probe", "enable"), &VisualServer::reflection_probe_set_as_interior);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_enable_box_projection", "probe", "enable"), &VisualServer::reflection_probe_set_enable_box_projection);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_enable_shadows", "probe", "enable"), &VisualServer::reflection_probe_set_enable_shadows);
- ClassDB::bind_method(D_METHOD("reflection_probe_set_cull_mask", "probe", "layers"), &VisualServer::reflection_probe_set_cull_mask);
+ ClassDB::bind_method(D_METHOD("directional_light_create"), &RenderingServer::directional_light_create);
+ ClassDB::bind_method(D_METHOD("omni_light_create"), &RenderingServer::omni_light_create);
+ ClassDB::bind_method(D_METHOD("spot_light_create"), &RenderingServer::spot_light_create);
+
+ ClassDB::bind_method(D_METHOD("light_set_color", "light", "color"), &RenderingServer::light_set_color);
+ ClassDB::bind_method(D_METHOD("light_set_param", "light", "param", "value"), &RenderingServer::light_set_param);
+ ClassDB::bind_method(D_METHOD("light_set_shadow", "light", "enabled"), &RenderingServer::light_set_shadow);
+ ClassDB::bind_method(D_METHOD("light_set_shadow_color", "light", "color"), &RenderingServer::light_set_shadow_color);
+ ClassDB::bind_method(D_METHOD("light_set_projector", "light", "texture"), &RenderingServer::light_set_projector);
+ ClassDB::bind_method(D_METHOD("light_set_negative", "light", "enable"), &RenderingServer::light_set_negative);
+ ClassDB::bind_method(D_METHOD("light_set_cull_mask", "light", "mask"), &RenderingServer::light_set_cull_mask);
+ ClassDB::bind_method(D_METHOD("light_set_reverse_cull_face_mode", "light", "enabled"), &RenderingServer::light_set_reverse_cull_face_mode);
+ ClassDB::bind_method(D_METHOD("light_set_use_gi", "light", "enabled"), &RenderingServer::light_set_use_gi);
+
+ ClassDB::bind_method(D_METHOD("light_omni_set_shadow_mode", "light", "mode"), &RenderingServer::light_omni_set_shadow_mode);
+
+ ClassDB::bind_method(D_METHOD("light_directional_set_shadow_mode", "light", "mode"), &RenderingServer::light_directional_set_shadow_mode);
+ ClassDB::bind_method(D_METHOD("light_directional_set_blend_splits", "light", "enable"), &RenderingServer::light_directional_set_blend_splits);
+ ClassDB::bind_method(D_METHOD("light_directional_set_shadow_depth_range_mode", "light", "range_mode"), &RenderingServer::light_directional_set_shadow_depth_range_mode);
+
+ ClassDB::bind_method(D_METHOD("reflection_probe_create"), &RenderingServer::reflection_probe_create);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_update_mode", "probe", "mode"), &RenderingServer::reflection_probe_set_update_mode);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_intensity", "probe", "intensity"), &RenderingServer::reflection_probe_set_intensity);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_interior_ambient", "probe", "color"), &RenderingServer::reflection_probe_set_interior_ambient);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_interior_ambient_energy", "probe", "energy"), &RenderingServer::reflection_probe_set_interior_ambient_energy);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_interior_ambient_probe_contribution", "probe", "contrib"), &RenderingServer::reflection_probe_set_interior_ambient_probe_contribution);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_max_distance", "probe", "distance"), &RenderingServer::reflection_probe_set_max_distance);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_extents", "probe", "extents"), &RenderingServer::reflection_probe_set_extents);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_origin_offset", "probe", "offset"), &RenderingServer::reflection_probe_set_origin_offset);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_as_interior", "probe", "enable"), &RenderingServer::reflection_probe_set_as_interior);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_enable_box_projection", "probe", "enable"), &RenderingServer::reflection_probe_set_enable_box_projection);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_enable_shadows", "probe", "enable"), &RenderingServer::reflection_probe_set_enable_shadows);
+ ClassDB::bind_method(D_METHOD("reflection_probe_set_cull_mask", "probe", "layers"), &RenderingServer::reflection_probe_set_cull_mask);
#ifndef _MSC_VER
#warning TODO all giprobe methods need re-binding
#endif
#if 0
- ClassDB::bind_method(D_METHOD("gi_probe_create"), &VisualServer::gi_probe_create);
- ClassDB::bind_method(D_METHOD("gi_probe_set_bounds", "probe", "bounds"), &VisualServer::gi_probe_set_bounds);
- ClassDB::bind_method(D_METHOD("gi_probe_get_bounds", "probe"), &VisualServer::gi_probe_get_bounds);
- ClassDB::bind_method(D_METHOD("gi_probe_set_cell_size", "probe", "range"), &VisualServer::gi_probe_set_cell_size);
- ClassDB::bind_method(D_METHOD("gi_probe_get_cell_size", "probe"), &VisualServer::gi_probe_get_cell_size);
- ClassDB::bind_method(D_METHOD("gi_probe_set_to_cell_xform", "probe", "xform"), &VisualServer::gi_probe_set_to_cell_xform);
- ClassDB::bind_method(D_METHOD("gi_probe_get_to_cell_xform", "probe"), &VisualServer::gi_probe_get_to_cell_xform);
- ClassDB::bind_method(D_METHOD("gi_probe_set_dynamic_data", "probe", "data"), &VisualServer::gi_probe_set_dynamic_data);
- ClassDB::bind_method(D_METHOD("gi_probe_get_dynamic_data", "probe"), &VisualServer::gi_probe_get_dynamic_data);
- ClassDB::bind_method(D_METHOD("gi_probe_set_dynamic_range", "probe", "range"), &VisualServer::gi_probe_set_dynamic_range);
- ClassDB::bind_method(D_METHOD("gi_probe_get_dynamic_range", "probe"), &VisualServer::gi_probe_get_dynamic_range);
- ClassDB::bind_method(D_METHOD("gi_probe_set_energy", "probe", "energy"), &VisualServer::gi_probe_set_energy);
- ClassDB::bind_method(D_METHOD("gi_probe_get_energy", "probe"), &VisualServer::gi_probe_get_energy);
- ClassDB::bind_method(D_METHOD("gi_probe_set_bias", "probe", "bias"), &VisualServer::gi_probe_set_bias);
- ClassDB::bind_method(D_METHOD("gi_probe_get_bias", "probe"), &VisualServer::gi_probe_get_bias);
- ClassDB::bind_method(D_METHOD("gi_probe_set_normal_bias", "probe", "bias"), &VisualServer::gi_probe_set_normal_bias);
- ClassDB::bind_method(D_METHOD("gi_probe_get_normal_bias", "probe"), &VisualServer::gi_probe_get_normal_bias);
- ClassDB::bind_method(D_METHOD("gi_probe_set_propagation", "probe", "propagation"), &VisualServer::gi_probe_set_propagation);
- ClassDB::bind_method(D_METHOD("gi_probe_get_propagation", "probe"), &VisualServer::gi_probe_get_propagation);
- ClassDB::bind_method(D_METHOD("gi_probe_set_interior", "probe", "enable"), &VisualServer::gi_probe_set_interior);
- ClassDB::bind_method(D_METHOD("gi_probe_is_interior", "probe"), &VisualServer::gi_probe_is_interior);
- ClassDB::bind_method(D_METHOD("gi_probe_set_compress", "probe", "enable"), &VisualServer::gi_probe_set_compress);
- ClassDB::bind_method(D_METHOD("gi_probe_is_compressed", "probe"), &VisualServer::gi_probe_is_compressed);
+ ClassDB::bind_method(D_METHOD("gi_probe_create"), &RenderingServer::gi_probe_create);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_bounds", "probe", "bounds"), &RenderingServer::gi_probe_set_bounds);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_bounds", "probe"), &RenderingServer::gi_probe_get_bounds);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_cell_size", "probe", "range"), &RenderingServer::gi_probe_set_cell_size);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_cell_size", "probe"), &RenderingServer::gi_probe_get_cell_size);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_to_cell_xform", "probe", "xform"), &RenderingServer::gi_probe_set_to_cell_xform);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_to_cell_xform", "probe"), &RenderingServer::gi_probe_get_to_cell_xform);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_dynamic_data", "probe", "data"), &RenderingServer::gi_probe_set_dynamic_data);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_dynamic_data", "probe"), &RenderingServer::gi_probe_get_dynamic_data);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_dynamic_range", "probe", "range"), &RenderingServer::gi_probe_set_dynamic_range);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_dynamic_range", "probe"), &RenderingServer::gi_probe_get_dynamic_range);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_energy", "probe", "energy"), &RenderingServer::gi_probe_set_energy);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_energy", "probe"), &RenderingServer::gi_probe_get_energy);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_bias", "probe", "bias"), &RenderingServer::gi_probe_set_bias);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_bias", "probe"), &RenderingServer::gi_probe_get_bias);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_normal_bias", "probe", "bias"), &RenderingServer::gi_probe_set_normal_bias);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_normal_bias", "probe"), &RenderingServer::gi_probe_get_normal_bias);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_propagation", "probe", "propagation"), &RenderingServer::gi_probe_set_propagation);
+ ClassDB::bind_method(D_METHOD("gi_probe_get_propagation", "probe"), &RenderingServer::gi_probe_get_propagation);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_interior", "probe", "enable"), &RenderingServer::gi_probe_set_interior);
+ ClassDB::bind_method(D_METHOD("gi_probe_is_interior", "probe"), &RenderingServer::gi_probe_is_interior);
+ ClassDB::bind_method(D_METHOD("gi_probe_set_compress", "probe", "enable"), &RenderingServer::gi_probe_set_compress);
+ ClassDB::bind_method(D_METHOD("gi_probe_is_compressed", "probe"), &RenderingServer::gi_probe_is_compressed);
#endif
- ClassDB::bind_method(D_METHOD("lightmap_capture_create"), &VisualServer::lightmap_capture_create);
- ClassDB::bind_method(D_METHOD("lightmap_capture_set_bounds", "capture", "bounds"), &VisualServer::lightmap_capture_set_bounds);
- ClassDB::bind_method(D_METHOD("lightmap_capture_get_bounds", "capture"), &VisualServer::lightmap_capture_get_bounds);
- ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree", "capture", "octree"), &VisualServer::lightmap_capture_set_octree);
- ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree_cell_transform", "capture", "xform"), &VisualServer::lightmap_capture_set_octree_cell_transform);
- ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree_cell_transform", "capture"), &VisualServer::lightmap_capture_get_octree_cell_transform);
- ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree_cell_subdiv", "capture", "subdiv"), &VisualServer::lightmap_capture_set_octree_cell_subdiv);
- ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree_cell_subdiv", "capture"), &VisualServer::lightmap_capture_get_octree_cell_subdiv);
- ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree", "capture"), &VisualServer::lightmap_capture_get_octree);
- ClassDB::bind_method(D_METHOD("lightmap_capture_set_energy", "capture", "energy"), &VisualServer::lightmap_capture_set_energy);
- ClassDB::bind_method(D_METHOD("lightmap_capture_get_energy", "capture"), &VisualServer::lightmap_capture_get_energy);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_create"), &RenderingServer::lightmap_capture_create);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_set_bounds", "capture", "bounds"), &RenderingServer::lightmap_capture_set_bounds);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_get_bounds", "capture"), &RenderingServer::lightmap_capture_get_bounds);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree", "capture", "octree"), &RenderingServer::lightmap_capture_set_octree);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree_cell_transform", "capture", "xform"), &RenderingServer::lightmap_capture_set_octree_cell_transform);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree_cell_transform", "capture"), &RenderingServer::lightmap_capture_get_octree_cell_transform);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree_cell_subdiv", "capture", "subdiv"), &RenderingServer::lightmap_capture_set_octree_cell_subdiv);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree_cell_subdiv", "capture"), &RenderingServer::lightmap_capture_get_octree_cell_subdiv);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree", "capture"), &RenderingServer::lightmap_capture_get_octree);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_set_energy", "capture", "energy"), &RenderingServer::lightmap_capture_set_energy);
+ ClassDB::bind_method(D_METHOD("lightmap_capture_get_energy", "capture"), &RenderingServer::lightmap_capture_get_energy);
#endif
- ClassDB::bind_method(D_METHOD("particles_create"), &VisualServer::particles_create);
- ClassDB::bind_method(D_METHOD("particles_set_emitting", "particles", "emitting"), &VisualServer::particles_set_emitting);
- ClassDB::bind_method(D_METHOD("particles_get_emitting", "particles"), &VisualServer::particles_get_emitting);
- ClassDB::bind_method(D_METHOD("particles_set_amount", "particles", "amount"), &VisualServer::particles_set_amount);
- ClassDB::bind_method(D_METHOD("particles_set_lifetime", "particles", "lifetime"), &VisualServer::particles_set_lifetime);
- ClassDB::bind_method(D_METHOD("particles_set_one_shot", "particles", "one_shot"), &VisualServer::particles_set_one_shot);
- ClassDB::bind_method(D_METHOD("particles_set_pre_process_time", "particles", "time"), &VisualServer::particles_set_pre_process_time);
- ClassDB::bind_method(D_METHOD("particles_set_explosiveness_ratio", "particles", "ratio"), &VisualServer::particles_set_explosiveness_ratio);
- ClassDB::bind_method(D_METHOD("particles_set_randomness_ratio", "particles", "ratio"), &VisualServer::particles_set_randomness_ratio);
- ClassDB::bind_method(D_METHOD("particles_set_custom_aabb", "particles", "aabb"), &VisualServer::particles_set_custom_aabb);
- ClassDB::bind_method(D_METHOD("particles_set_speed_scale", "particles", "scale"), &VisualServer::particles_set_speed_scale);
- ClassDB::bind_method(D_METHOD("particles_set_use_local_coordinates", "particles", "enable"), &VisualServer::particles_set_use_local_coordinates);
- ClassDB::bind_method(D_METHOD("particles_set_process_material", "particles", "material"), &VisualServer::particles_set_process_material);
- ClassDB::bind_method(D_METHOD("particles_set_fixed_fps", "particles", "fps"), &VisualServer::particles_set_fixed_fps);
- ClassDB::bind_method(D_METHOD("particles_set_fractional_delta", "particles", "enable"), &VisualServer::particles_set_fractional_delta);
- ClassDB::bind_method(D_METHOD("particles_is_inactive", "particles"), &VisualServer::particles_is_inactive);
- ClassDB::bind_method(D_METHOD("particles_request_process", "particles"), &VisualServer::particles_request_process);
- ClassDB::bind_method(D_METHOD("particles_restart", "particles"), &VisualServer::particles_restart);
- ClassDB::bind_method(D_METHOD("particles_set_draw_order", "particles", "order"), &VisualServer::particles_set_draw_order);
- ClassDB::bind_method(D_METHOD("particles_set_draw_passes", "particles", "count"), &VisualServer::particles_set_draw_passes);
- ClassDB::bind_method(D_METHOD("particles_set_draw_pass_mesh", "particles", "pass", "mesh"), &VisualServer::particles_set_draw_pass_mesh);
- ClassDB::bind_method(D_METHOD("particles_get_current_aabb", "particles"), &VisualServer::particles_get_current_aabb);
- ClassDB::bind_method(D_METHOD("particles_set_emission_transform", "particles", "transform"), &VisualServer::particles_set_emission_transform);
-
- ClassDB::bind_method(D_METHOD("camera_create"), &VisualServer::camera_create);
- ClassDB::bind_method(D_METHOD("camera_set_perspective", "camera", "fovy_degrees", "z_near", "z_far"), &VisualServer::camera_set_perspective);
- ClassDB::bind_method(D_METHOD("camera_set_orthogonal", "camera", "size", "z_near", "z_far"), &VisualServer::camera_set_orthogonal);
- ClassDB::bind_method(D_METHOD("camera_set_frustum", "camera", "size", "offset", "z_near", "z_far"), &VisualServer::camera_set_frustum);
- ClassDB::bind_method(D_METHOD("camera_set_transform", "camera", "transform"), &VisualServer::camera_set_transform);
- ClassDB::bind_method(D_METHOD("camera_set_cull_mask", "camera", "layers"), &VisualServer::camera_set_cull_mask);
- ClassDB::bind_method(D_METHOD("camera_set_environment", "camera", "env"), &VisualServer::camera_set_environment);
- ClassDB::bind_method(D_METHOD("camera_set_use_vertical_aspect", "camera", "enable"), &VisualServer::camera_set_use_vertical_aspect);
-
- ClassDB::bind_method(D_METHOD("viewport_create"), &VisualServer::viewport_create);
- ClassDB::bind_method(D_METHOD("viewport_set_use_arvr", "viewport", "use_arvr"), &VisualServer::viewport_set_use_arvr);
- ClassDB::bind_method(D_METHOD("viewport_set_size", "viewport", "width", "height"), &VisualServer::viewport_set_size);
- ClassDB::bind_method(D_METHOD("viewport_set_active", "viewport", "active"), &VisualServer::viewport_set_active);
- ClassDB::bind_method(D_METHOD("viewport_set_parent_viewport", "viewport", "parent_viewport"), &VisualServer::viewport_set_parent_viewport);
- ClassDB::bind_method(D_METHOD("viewport_attach_to_screen", "viewport", "rect", "screen"), &VisualServer::viewport_attach_to_screen, DEFVAL(Rect2()), DEFVAL(DisplayServer::MAIN_WINDOW_ID));
- ClassDB::bind_method(D_METHOD("viewport_set_render_direct_to_screen", "viewport", "enabled"), &VisualServer::viewport_set_render_direct_to_screen);
-
- ClassDB::bind_method(D_METHOD("viewport_set_update_mode", "viewport", "update_mode"), &VisualServer::viewport_set_update_mode);
- ClassDB::bind_method(D_METHOD("viewport_set_clear_mode", "viewport", "clear_mode"), &VisualServer::viewport_set_clear_mode);
- ClassDB::bind_method(D_METHOD("viewport_get_texture", "viewport"), &VisualServer::viewport_get_texture);
- ClassDB::bind_method(D_METHOD("viewport_set_hide_scenario", "viewport", "hidden"), &VisualServer::viewport_set_hide_scenario);
- ClassDB::bind_method(D_METHOD("viewport_set_hide_canvas", "viewport", "hidden"), &VisualServer::viewport_set_hide_canvas);
- ClassDB::bind_method(D_METHOD("viewport_set_disable_environment", "viewport", "disabled"), &VisualServer::viewport_set_disable_environment);
- ClassDB::bind_method(D_METHOD("viewport_attach_camera", "viewport", "camera"), &VisualServer::viewport_attach_camera);
- ClassDB::bind_method(D_METHOD("viewport_set_scenario", "viewport", "scenario"), &VisualServer::viewport_set_scenario);
- ClassDB::bind_method(D_METHOD("viewport_attach_canvas", "viewport", "canvas"), &VisualServer::viewport_attach_canvas);
- ClassDB::bind_method(D_METHOD("viewport_remove_canvas", "viewport", "canvas"), &VisualServer::viewport_remove_canvas);
- ClassDB::bind_method(D_METHOD("viewport_set_canvas_transform", "viewport", "canvas", "offset"), &VisualServer::viewport_set_canvas_transform);
- ClassDB::bind_method(D_METHOD("viewport_set_transparent_background", "viewport", "enabled"), &VisualServer::viewport_set_transparent_background);
- ClassDB::bind_method(D_METHOD("viewport_set_global_canvas_transform", "viewport", "transform"), &VisualServer::viewport_set_global_canvas_transform);
- ClassDB::bind_method(D_METHOD("viewport_set_canvas_stacking", "viewport", "canvas", "layer", "sublayer"), &VisualServer::viewport_set_canvas_stacking);
- ClassDB::bind_method(D_METHOD("viewport_set_shadow_atlas_size", "viewport", "size"), &VisualServer::viewport_set_shadow_atlas_size);
- ClassDB::bind_method(D_METHOD("viewport_set_shadow_atlas_quadrant_subdivision", "viewport", "quadrant", "subdivision"), &VisualServer::viewport_set_shadow_atlas_quadrant_subdivision);
- ClassDB::bind_method(D_METHOD("viewport_set_msaa", "viewport", "msaa"), &VisualServer::viewport_set_msaa);
- ClassDB::bind_method(D_METHOD("viewport_get_render_info", "viewport", "info"), &VisualServer::viewport_get_render_info);
- ClassDB::bind_method(D_METHOD("viewport_set_debug_draw", "viewport", "draw"), &VisualServer::viewport_set_debug_draw);
-
- ClassDB::bind_method(D_METHOD("environment_create"), &VisualServer::environment_create);
- ClassDB::bind_method(D_METHOD("environment_set_background", "env", "bg"), &VisualServer::environment_set_background);
- ClassDB::bind_method(D_METHOD("environment_set_sky", "env", "sky"), &VisualServer::environment_set_sky);
- ClassDB::bind_method(D_METHOD("environment_set_sky_custom_fov", "env", "scale"), &VisualServer::environment_set_sky_custom_fov);
- ClassDB::bind_method(D_METHOD("environment_set_sky_orientation", "env", "orientation"), &VisualServer::environment_set_sky_orientation);
- ClassDB::bind_method(D_METHOD("environment_set_bg_color", "env", "color"), &VisualServer::environment_set_bg_color);
- ClassDB::bind_method(D_METHOD("environment_set_bg_energy", "env", "energy"), &VisualServer::environment_set_bg_energy);
- ClassDB::bind_method(D_METHOD("environment_set_canvas_max_layer", "env", "max_layer"), &VisualServer::environment_set_canvas_max_layer);
- ClassDB::bind_method(D_METHOD("environment_set_ambient_light", "env", "color", "ambient", "energy", "sky_contibution", "reflection_source", "ao_color"), &VisualServer::environment_set_ambient_light, DEFVAL(VS::ENV_AMBIENT_SOURCE_BG), DEFVAL(1.0), DEFVAL(0.0), DEFVAL(VS::ENV_REFLECTION_SOURCE_BG), DEFVAL(Color()));
- ClassDB::bind_method(D_METHOD("environment_set_glow", "env", "enable", "level_flags", "intensity", "strength", "mix", "bloom_threshold", "blend_mode", "hdr_bleed_threshold", "hdr_bleed_scale", "hdr_luminance_cap", "bicubic_upscale"), &VisualServer::environment_set_glow);
- ClassDB::bind_method(D_METHOD("environment_set_tonemap", "env", "tone_mapper", "exposure", "white", "auto_exposure", "min_luminance", "max_luminance", "auto_exp_speed", "auto_exp_grey"), &VisualServer::environment_set_tonemap);
- ClassDB::bind_method(D_METHOD("environment_set_adjustment", "env", "enable", "brightness", "contrast", "saturation", "ramp"), &VisualServer::environment_set_adjustment);
- ClassDB::bind_method(D_METHOD("environment_set_ssr", "env", "enable", "max_steps", "fade_in", "fade_out", "depth_tolerance", "roughness"), &VisualServer::environment_set_ssr);
- ClassDB::bind_method(D_METHOD("environment_set_ssao", "env", "enable", "radius", "intensity", "bias", "light_affect", "ao_channel_affect", "blur", "bilateral_sharpness"), &VisualServer::environment_set_ssao);
- ClassDB::bind_method(D_METHOD("environment_set_fog", "env", "enable", "color", "sun_color", "sun_amount"), &VisualServer::environment_set_fog);
-
- ClassDB::bind_method(D_METHOD("environment_set_fog_depth", "env", "enable", "depth_begin", "depth_end", "depth_curve", "transmit", "transmit_curve"), &VisualServer::environment_set_fog_depth);
-
- ClassDB::bind_method(D_METHOD("environment_set_fog_height", "env", "enable", "min_height", "max_height", "height_curve"), &VisualServer::environment_set_fog_height);
-
- ClassDB::bind_method(D_METHOD("scenario_create"), &VisualServer::scenario_create);
- ClassDB::bind_method(D_METHOD("scenario_set_debug", "scenario", "debug_mode"), &VisualServer::scenario_set_debug);
- ClassDB::bind_method(D_METHOD("scenario_set_environment", "scenario", "environment"), &VisualServer::scenario_set_environment);
- ClassDB::bind_method(D_METHOD("scenario_set_fallback_environment", "scenario", "environment"), &VisualServer::scenario_set_fallback_environment);
+ ClassDB::bind_method(D_METHOD("particles_create"), &RenderingServer::particles_create);
+ ClassDB::bind_method(D_METHOD("particles_set_emitting", "particles", "emitting"), &RenderingServer::particles_set_emitting);
+ ClassDB::bind_method(D_METHOD("particles_get_emitting", "particles"), &RenderingServer::particles_get_emitting);
+ ClassDB::bind_method(D_METHOD("particles_set_amount", "particles", "amount"), &RenderingServer::particles_set_amount);
+ ClassDB::bind_method(D_METHOD("particles_set_lifetime", "particles", "lifetime"), &RenderingServer::particles_set_lifetime);
+ ClassDB::bind_method(D_METHOD("particles_set_one_shot", "particles", "one_shot"), &RenderingServer::particles_set_one_shot);
+ ClassDB::bind_method(D_METHOD("particles_set_pre_process_time", "particles", "time"), &RenderingServer::particles_set_pre_process_time);
+ ClassDB::bind_method(D_METHOD("particles_set_explosiveness_ratio", "particles", "ratio"), &RenderingServer::particles_set_explosiveness_ratio);
+ ClassDB::bind_method(D_METHOD("particles_set_randomness_ratio", "particles", "ratio"), &RenderingServer::particles_set_randomness_ratio);
+ ClassDB::bind_method(D_METHOD("particles_set_custom_aabb", "particles", "aabb"), &RenderingServer::particles_set_custom_aabb);
+ ClassDB::bind_method(D_METHOD("particles_set_speed_scale", "particles", "scale"), &RenderingServer::particles_set_speed_scale);
+ ClassDB::bind_method(D_METHOD("particles_set_use_local_coordinates", "particles", "enable"), &RenderingServer::particles_set_use_local_coordinates);
+ ClassDB::bind_method(D_METHOD("particles_set_process_material", "particles", "material"), &RenderingServer::particles_set_process_material);
+ ClassDB::bind_method(D_METHOD("particles_set_fixed_fps", "particles", "fps"), &RenderingServer::particles_set_fixed_fps);
+ ClassDB::bind_method(D_METHOD("particles_set_fractional_delta", "particles", "enable"), &RenderingServer::particles_set_fractional_delta);
+ ClassDB::bind_method(D_METHOD("particles_is_inactive", "particles"), &RenderingServer::particles_is_inactive);
+ ClassDB::bind_method(D_METHOD("particles_request_process", "particles"), &RenderingServer::particles_request_process);
+ ClassDB::bind_method(D_METHOD("particles_restart", "particles"), &RenderingServer::particles_restart);
+ ClassDB::bind_method(D_METHOD("particles_set_draw_order", "particles", "order"), &RenderingServer::particles_set_draw_order);
+ ClassDB::bind_method(D_METHOD("particles_set_draw_passes", "particles", "count"), &RenderingServer::particles_set_draw_passes);
+ ClassDB::bind_method(D_METHOD("particles_set_draw_pass_mesh", "particles", "pass", "mesh"), &RenderingServer::particles_set_draw_pass_mesh);
+ ClassDB::bind_method(D_METHOD("particles_get_current_aabb", "particles"), &RenderingServer::particles_get_current_aabb);
+ ClassDB::bind_method(D_METHOD("particles_set_emission_transform", "particles", "transform"), &RenderingServer::particles_set_emission_transform);
+
+ ClassDB::bind_method(D_METHOD("camera_create"), &RenderingServer::camera_create);
+ ClassDB::bind_method(D_METHOD("camera_set_perspective", "camera", "fovy_degrees", "z_near", "z_far"), &RenderingServer::camera_set_perspective);
+ ClassDB::bind_method(D_METHOD("camera_set_orthogonal", "camera", "size", "z_near", "z_far"), &RenderingServer::camera_set_orthogonal);
+ ClassDB::bind_method(D_METHOD("camera_set_frustum", "camera", "size", "offset", "z_near", "z_far"), &RenderingServer::camera_set_frustum);
+ ClassDB::bind_method(D_METHOD("camera_set_transform", "camera", "transform"), &RenderingServer::camera_set_transform);
+ ClassDB::bind_method(D_METHOD("camera_set_cull_mask", "camera", "layers"), &RenderingServer::camera_set_cull_mask);
+ ClassDB::bind_method(D_METHOD("camera_set_environment", "camera", "env"), &RenderingServer::camera_set_environment);
+ ClassDB::bind_method(D_METHOD("camera_set_use_vertical_aspect", "camera", "enable"), &RenderingServer::camera_set_use_vertical_aspect);
+
+ ClassDB::bind_method(D_METHOD("viewport_create"), &RenderingServer::viewport_create);
+ ClassDB::bind_method(D_METHOD("viewport_set_use_arvr", "viewport", "use_arvr"), &RenderingServer::viewport_set_use_arvr);
+ ClassDB::bind_method(D_METHOD("viewport_set_size", "viewport", "width", "height"), &RenderingServer::viewport_set_size);
+ ClassDB::bind_method(D_METHOD("viewport_set_active", "viewport", "active"), &RenderingServer::viewport_set_active);
+ ClassDB::bind_method(D_METHOD("viewport_set_parent_viewport", "viewport", "parent_viewport"), &RenderingServer::viewport_set_parent_viewport);
+ ClassDB::bind_method(D_METHOD("viewport_attach_to_screen", "viewport", "rect", "screen"), &RenderingServer::viewport_attach_to_screen, DEFVAL(Rect2()), DEFVAL(DisplayServer::MAIN_WINDOW_ID));
+ ClassDB::bind_method(D_METHOD("viewport_set_render_direct_to_screen", "viewport", "enabled"), &RenderingServer::viewport_set_render_direct_to_screen);
+
+ ClassDB::bind_method(D_METHOD("viewport_set_update_mode", "viewport", "update_mode"), &RenderingServer::viewport_set_update_mode);
+ ClassDB::bind_method(D_METHOD("viewport_set_clear_mode", "viewport", "clear_mode"), &RenderingServer::viewport_set_clear_mode);
+ ClassDB::bind_method(D_METHOD("viewport_get_texture", "viewport"), &RenderingServer::viewport_get_texture);
+ ClassDB::bind_method(D_METHOD("viewport_set_hide_scenario", "viewport", "hidden"), &RenderingServer::viewport_set_hide_scenario);
+ ClassDB::bind_method(D_METHOD("viewport_set_hide_canvas", "viewport", "hidden"), &RenderingServer::viewport_set_hide_canvas);
+ ClassDB::bind_method(D_METHOD("viewport_set_disable_environment", "viewport", "disabled"), &RenderingServer::viewport_set_disable_environment);
+ ClassDB::bind_method(D_METHOD("viewport_attach_camera", "viewport", "camera"), &RenderingServer::viewport_attach_camera);
+ ClassDB::bind_method(D_METHOD("viewport_set_scenario", "viewport", "scenario"), &RenderingServer::viewport_set_scenario);
+ ClassDB::bind_method(D_METHOD("viewport_attach_canvas", "viewport", "canvas"), &RenderingServer::viewport_attach_canvas);
+ ClassDB::bind_method(D_METHOD("viewport_remove_canvas", "viewport", "canvas"), &RenderingServer::viewport_remove_canvas);
+ ClassDB::bind_method(D_METHOD("viewport_set_canvas_transform", "viewport", "canvas", "offset"), &RenderingServer::viewport_set_canvas_transform);
+ ClassDB::bind_method(D_METHOD("viewport_set_transparent_background", "viewport", "enabled"), &RenderingServer::viewport_set_transparent_background);
+ ClassDB::bind_method(D_METHOD("viewport_set_global_canvas_transform", "viewport", "transform"), &RenderingServer::viewport_set_global_canvas_transform);
+ ClassDB::bind_method(D_METHOD("viewport_set_canvas_stacking", "viewport", "canvas", "layer", "sublayer"), &RenderingServer::viewport_set_canvas_stacking);
+ ClassDB::bind_method(D_METHOD("viewport_set_shadow_atlas_size", "viewport", "size"), &RenderingServer::viewport_set_shadow_atlas_size);
+ ClassDB::bind_method(D_METHOD("viewport_set_shadow_atlas_quadrant_subdivision", "viewport", "quadrant", "subdivision"), &RenderingServer::viewport_set_shadow_atlas_quadrant_subdivision);
+ ClassDB::bind_method(D_METHOD("viewport_set_msaa", "viewport", "msaa"), &RenderingServer::viewport_set_msaa);
+ ClassDB::bind_method(D_METHOD("viewport_get_render_info", "viewport", "info"), &RenderingServer::viewport_get_render_info);
+ ClassDB::bind_method(D_METHOD("viewport_set_debug_draw", "viewport", "draw"), &RenderingServer::viewport_set_debug_draw);
+
+ ClassDB::bind_method(D_METHOD("environment_create"), &RenderingServer::environment_create);
+ ClassDB::bind_method(D_METHOD("environment_set_background", "env", "bg"), &RenderingServer::environment_set_background);
+ ClassDB::bind_method(D_METHOD("environment_set_sky", "env", "sky"), &RenderingServer::environment_set_sky);
+ ClassDB::bind_method(D_METHOD("environment_set_sky_custom_fov", "env", "scale"), &RenderingServer::environment_set_sky_custom_fov);
+ ClassDB::bind_method(D_METHOD("environment_set_sky_orientation", "env", "orientation"), &RenderingServer::environment_set_sky_orientation);
+ ClassDB::bind_method(D_METHOD("environment_set_bg_color", "env", "color"), &RenderingServer::environment_set_bg_color);
+ ClassDB::bind_method(D_METHOD("environment_set_bg_energy", "env", "energy"), &RenderingServer::environment_set_bg_energy);
+ ClassDB::bind_method(D_METHOD("environment_set_canvas_max_layer", "env", "max_layer"), &RenderingServer::environment_set_canvas_max_layer);
+ ClassDB::bind_method(D_METHOD("environment_set_ambient_light", "env", "color", "ambient", "energy", "sky_contibution", "reflection_source", "ao_color"), &RenderingServer::environment_set_ambient_light, DEFVAL(RS::ENV_AMBIENT_SOURCE_BG), DEFVAL(1.0), DEFVAL(0.0), DEFVAL(RS::ENV_REFLECTION_SOURCE_BG), DEFVAL(Color()));
+ ClassDB::bind_method(D_METHOD("environment_set_glow", "env", "enable", "level_flags", "intensity", "strength", "mix", "bloom_threshold", "blend_mode", "hdr_bleed_threshold", "hdr_bleed_scale", "hdr_luminance_cap", "bicubic_upscale"), &RenderingServer::environment_set_glow);
+ ClassDB::bind_method(D_METHOD("environment_set_tonemap", "env", "tone_mapper", "exposure", "white", "auto_exposure", "min_luminance", "max_luminance", "auto_exp_speed", "auto_exp_grey"), &RenderingServer::environment_set_tonemap);
+ ClassDB::bind_method(D_METHOD("environment_set_adjustment", "env", "enable", "brightness", "contrast", "saturation", "ramp"), &RenderingServer::environment_set_adjustment);
+ ClassDB::bind_method(D_METHOD("environment_set_ssr", "env", "enable", "max_steps", "fade_in", "fade_out", "depth_tolerance", "roughness"), &RenderingServer::environment_set_ssr);
+ ClassDB::bind_method(D_METHOD("environment_set_ssao", "env", "enable", "radius", "intensity", "bias", "light_affect", "ao_channel_affect", "blur", "bilateral_sharpness"), &RenderingServer::environment_set_ssao);
+ ClassDB::bind_method(D_METHOD("environment_set_fog", "env", "enable", "color", "sun_color", "sun_amount"), &RenderingServer::environment_set_fog);
+
+ ClassDB::bind_method(D_METHOD("environment_set_fog_depth", "env", "enable", "depth_begin", "depth_end", "depth_curve", "transmit", "transmit_curve"), &RenderingServer::environment_set_fog_depth);
+
+ ClassDB::bind_method(D_METHOD("environment_set_fog_height", "env", "enable", "min_height", "max_height", "height_curve"), &RenderingServer::environment_set_fog_height);
+
+ ClassDB::bind_method(D_METHOD("scenario_create"), &RenderingServer::scenario_create);
+ ClassDB::bind_method(D_METHOD("scenario_set_debug", "scenario", "debug_mode"), &RenderingServer::scenario_set_debug);
+ ClassDB::bind_method(D_METHOD("scenario_set_environment", "scenario", "environment"), &RenderingServer::scenario_set_environment);
+ ClassDB::bind_method(D_METHOD("scenario_set_fallback_environment", "scenario", "environment"), &RenderingServer::scenario_set_fallback_environment);
#ifndef _3D_DISABLED
- ClassDB::bind_method(D_METHOD("instance_create2", "base", "scenario"), &VisualServer::instance_create2);
- ClassDB::bind_method(D_METHOD("instance_create"), &VisualServer::instance_create);
- ClassDB::bind_method(D_METHOD("instance_set_base", "instance", "base"), &VisualServer::instance_set_base);
- ClassDB::bind_method(D_METHOD("instance_set_scenario", "instance", "scenario"), &VisualServer::instance_set_scenario);
- ClassDB::bind_method(D_METHOD("instance_set_layer_mask", "instance", "mask"), &VisualServer::instance_set_layer_mask);
- ClassDB::bind_method(D_METHOD("instance_set_transform", "instance", "transform"), &VisualServer::instance_set_transform);
- ClassDB::bind_method(D_METHOD("instance_attach_object_instance_id", "instance", "id"), &VisualServer::instance_attach_object_instance_id);
- ClassDB::bind_method(D_METHOD("instance_set_blend_shape_weight", "instance", "shape", "weight"), &VisualServer::instance_set_blend_shape_weight);
- ClassDB::bind_method(D_METHOD("instance_set_surface_material", "instance", "surface", "material"), &VisualServer::instance_set_surface_material);
- ClassDB::bind_method(D_METHOD("instance_set_visible", "instance", "visible"), &VisualServer::instance_set_visible);
- ClassDB::bind_method(D_METHOD("instance_set_use_lightmap", "instance", "lightmap_instance", "lightmap"), &VisualServer::instance_set_use_lightmap);
- ClassDB::bind_method(D_METHOD("instance_set_custom_aabb", "instance", "aabb"), &VisualServer::instance_set_custom_aabb);
- ClassDB::bind_method(D_METHOD("instance_attach_skeleton", "instance", "skeleton"), &VisualServer::instance_attach_skeleton);
- ClassDB::bind_method(D_METHOD("instance_set_exterior", "instance", "enabled"), &VisualServer::instance_set_exterior);
- ClassDB::bind_method(D_METHOD("instance_set_extra_visibility_margin", "instance", "margin"), &VisualServer::instance_set_extra_visibility_margin);
- ClassDB::bind_method(D_METHOD("instance_geometry_set_flag", "instance", "flag", "enabled"), &VisualServer::instance_geometry_set_flag);
- ClassDB::bind_method(D_METHOD("instance_geometry_set_cast_shadows_setting", "instance", "shadow_casting_setting"), &VisualServer::instance_geometry_set_cast_shadows_setting);
- ClassDB::bind_method(D_METHOD("instance_geometry_set_material_override", "instance", "material"), &VisualServer::instance_geometry_set_material_override);
- ClassDB::bind_method(D_METHOD("instance_geometry_set_draw_range", "instance", "min", "max", "min_margin", "max_margin"), &VisualServer::instance_geometry_set_draw_range);
- ClassDB::bind_method(D_METHOD("instance_geometry_set_as_instance_lod", "instance", "as_lod_of_instance"), &VisualServer::instance_geometry_set_as_instance_lod);
-
- ClassDB::bind_method(D_METHOD("instances_cull_aabb", "aabb", "scenario"), &VisualServer::_instances_cull_aabb_bind, DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("instances_cull_ray", "from", "to", "scenario"), &VisualServer::_instances_cull_ray_bind, DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("instances_cull_convex", "convex", "scenario"), &VisualServer::_instances_cull_convex_bind, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("instance_create2", "base", "scenario"), &RenderingServer::instance_create2);
+ ClassDB::bind_method(D_METHOD("instance_create"), &RenderingServer::instance_create);
+ ClassDB::bind_method(D_METHOD("instance_set_base", "instance", "base"), &RenderingServer::instance_set_base);
+ ClassDB::bind_method(D_METHOD("instance_set_scenario", "instance", "scenario"), &RenderingServer::instance_set_scenario);
+ ClassDB::bind_method(D_METHOD("instance_set_layer_mask", "instance", "mask"), &RenderingServer::instance_set_layer_mask);
+ ClassDB::bind_method(D_METHOD("instance_set_transform", "instance", "transform"), &RenderingServer::instance_set_transform);
+ ClassDB::bind_method(D_METHOD("instance_attach_object_instance_id", "instance", "id"), &RenderingServer::instance_attach_object_instance_id);
+ ClassDB::bind_method(D_METHOD("instance_set_blend_shape_weight", "instance", "shape", "weight"), &RenderingServer::instance_set_blend_shape_weight);
+ ClassDB::bind_method(D_METHOD("instance_set_surface_material", "instance", "surface", "material"), &RenderingServer::instance_set_surface_material);
+ ClassDB::bind_method(D_METHOD("instance_set_visible", "instance", "visible"), &RenderingServer::instance_set_visible);
+ ClassDB::bind_method(D_METHOD("instance_set_use_lightmap", "instance", "lightmap_instance", "lightmap"), &RenderingServer::instance_set_use_lightmap);
+ ClassDB::bind_method(D_METHOD("instance_set_custom_aabb", "instance", "aabb"), &RenderingServer::instance_set_custom_aabb);
+ ClassDB::bind_method(D_METHOD("instance_attach_skeleton", "instance", "skeleton"), &RenderingServer::instance_attach_skeleton);
+ ClassDB::bind_method(D_METHOD("instance_set_exterior", "instance", "enabled"), &RenderingServer::instance_set_exterior);
+ ClassDB::bind_method(D_METHOD("instance_set_extra_visibility_margin", "instance", "margin"), &RenderingServer::instance_set_extra_visibility_margin);
+ ClassDB::bind_method(D_METHOD("instance_geometry_set_flag", "instance", "flag", "enabled"), &RenderingServer::instance_geometry_set_flag);
+ ClassDB::bind_method(D_METHOD("instance_geometry_set_cast_shadows_setting", "instance", "shadow_casting_setting"), &RenderingServer::instance_geometry_set_cast_shadows_setting);
+ ClassDB::bind_method(D_METHOD("instance_geometry_set_material_override", "instance", "material"), &RenderingServer::instance_geometry_set_material_override);
+ ClassDB::bind_method(D_METHOD("instance_geometry_set_draw_range", "instance", "min", "max", "min_margin", "max_margin"), &RenderingServer::instance_geometry_set_draw_range);
+ ClassDB::bind_method(D_METHOD("instance_geometry_set_as_instance_lod", "instance", "as_lod_of_instance"), &RenderingServer::instance_geometry_set_as_instance_lod);
+
+ ClassDB::bind_method(D_METHOD("instances_cull_aabb", "aabb", "scenario"), &RenderingServer::_instances_cull_aabb_bind, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("instances_cull_ray", "from", "to", "scenario"), &RenderingServer::_instances_cull_ray_bind, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("instances_cull_convex", "convex", "scenario"), &RenderingServer::_instances_cull_convex_bind, DEFVAL(RID()));
#endif
- ClassDB::bind_method(D_METHOD("canvas_create"), &VisualServer::canvas_create);
- ClassDB::bind_method(D_METHOD("canvas_set_item_mirroring", "canvas", "item", "mirroring"), &VisualServer::canvas_set_item_mirroring);
- ClassDB::bind_method(D_METHOD("canvas_set_modulate", "canvas", "color"), &VisualServer::canvas_set_modulate);
+ ClassDB::bind_method(D_METHOD("canvas_create"), &RenderingServer::canvas_create);
+ ClassDB::bind_method(D_METHOD("canvas_set_item_mirroring", "canvas", "item", "mirroring"), &RenderingServer::canvas_set_item_mirroring);
+ ClassDB::bind_method(D_METHOD("canvas_set_modulate", "canvas", "color"), &RenderingServer::canvas_set_modulate);
#ifndef _MSC_VER
#warning TODO method bindings need to be fixed
#endif
#if 0
- ClassDB::bind_method(D_METHOD("canvas_item_create"), &VisualServer::canvas_item_create);
- ClassDB::bind_method(D_METHOD("canvas_item_set_parent", "item", "parent"), &VisualServer::canvas_item_set_parent);
- ClassDB::bind_method(D_METHOD("canvas_item_set_visible", "item", "visible"), &VisualServer::canvas_item_set_visible);
- ClassDB::bind_method(D_METHOD("canvas_item_set_light_mask", "item", "mask"), &VisualServer::canvas_item_set_light_mask);
- ClassDB::bind_method(D_METHOD("canvas_item_set_transform", "item", "transform"), &VisualServer::canvas_item_set_transform);
- ClassDB::bind_method(D_METHOD("canvas_item_set_clip", "item", "clip"), &VisualServer::canvas_item_set_clip);
- ClassDB::bind_method(D_METHOD("canvas_item_set_distance_field_mode", "item", "enabled"), &VisualServer::canvas_item_set_distance_field_mode);
- ClassDB::bind_method(D_METHOD("canvas_item_set_custom_rect", "item", "use_custom_rect", "rect"), &VisualServer::canvas_item_set_custom_rect, DEFVAL(Rect2()));
- ClassDB::bind_method(D_METHOD("canvas_item_set_modulate", "item", "color"), &VisualServer::canvas_item_set_modulate);
- ClassDB::bind_method(D_METHOD("canvas_item_set_self_modulate", "item", "color"), &VisualServer::canvas_item_set_self_modulate);
- ClassDB::bind_method(D_METHOD("canvas_item_set_draw_behind_parent", "item", "enabled"), &VisualServer::canvas_item_set_draw_behind_parent);
- ClassDB::bind_method(D_METHOD("canvas_item_add_line", "item", "from", "to", "color", "width", "antialiased"), &VisualServer::canvas_item_add_line, DEFVAL(1.0), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("canvas_item_add_polyline", "item", "points", "colors", "width", "antialiased"), &VisualServer::canvas_item_add_polyline, DEFVAL(1.0), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("canvas_item_add_rect", "item", "rect", "color"), &VisualServer::canvas_item_add_rect);
- ClassDB::bind_method(D_METHOD("canvas_item_add_circle", "item", "pos", "radius", "color"), &VisualServer::canvas_item_add_circle);
- ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect", "item", "rect", "texture", "tile", "modulate", "transpose", "normal_map"), &VisualServer::canvas_item_add_texture_rect, DEFVAL(false), DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect_region", "item", "rect", "texture", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &VisualServer::canvas_item_add_texture_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(RID()), DEFVAL(true));
- ClassDB::bind_method(D_METHOD("canvas_item_add_nine_patch", "item", "rect", "source", "texture", "topleft", "bottomright", "x_axis_mode", "y_axis_mode", "draw_center", "modulate", "normal_map"), &VisualServer::canvas_item_add_nine_patch, DEFVAL(NINE_PATCH_STRETCH), DEFVAL(NINE_PATCH_STRETCH), DEFVAL(true), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("canvas_item_add_primitive", "item", "points", "colors", "uvs", "texture", "width", "normal_map"), &VisualServer::canvas_item_add_primitive, DEFVAL(1.0), DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("canvas_item_add_polygon", "item", "points", "colors", "uvs", "texture", "normal_map", "antialiased"), &VisualServer::canvas_item_add_polygon, DEFVAL(Vector<Point2>()), DEFVAL(RID()), DEFVAL(RID()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map", "antialiased"), &VisualServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(Vector<int>()), DEFVAL(Vector<float>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "transform", "modulate", "texture", "normal_map"), &VisualServer::canvas_item_add_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()), DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture", "normal_map"), &VisualServer::canvas_item_add_multimesh, DEFVAL(RID()));
- ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map"), &VisualServer::canvas_item_add_particles);
- ClassDB::bind_method(D_METHOD("canvas_item_add_set_transform", "item", "transform"), &VisualServer::canvas_item_add_set_transform);
- ClassDB::bind_method(D_METHOD("canvas_item_add_clip_ignore", "item", "ignore"), &VisualServer::canvas_item_add_clip_ignore);
- ClassDB::bind_method(D_METHOD("canvas_item_set_sort_children_by_y", "item", "enabled"), &VisualServer::canvas_item_set_sort_children_by_y);
+ ClassDB::bind_method(D_METHOD("canvas_item_create"), &RenderingServer::canvas_item_create);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_parent", "item", "parent"), &RenderingServer::canvas_item_set_parent);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_visible", "item", "visible"), &RenderingServer::canvas_item_set_visible);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_light_mask", "item", "mask"), &RenderingServer::canvas_item_set_light_mask);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_transform", "item", "transform"), &RenderingServer::canvas_item_set_transform);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_clip", "item", "clip"), &RenderingServer::canvas_item_set_clip);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_distance_field_mode", "item", "enabled"), &RenderingServer::canvas_item_set_distance_field_mode);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_custom_rect", "item", "use_custom_rect", "rect"), &RenderingServer::canvas_item_set_custom_rect, DEFVAL(Rect2()));
+ ClassDB::bind_method(D_METHOD("canvas_item_set_modulate", "item", "color"), &RenderingServer::canvas_item_set_modulate);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_self_modulate", "item", "color"), &RenderingServer::canvas_item_set_self_modulate);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_draw_behind_parent", "item", "enabled"), &RenderingServer::canvas_item_set_draw_behind_parent);
+ ClassDB::bind_method(D_METHOD("canvas_item_add_line", "item", "from", "to", "color", "width", "antialiased"), &RenderingServer::canvas_item_add_line, DEFVAL(1.0), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_polyline", "item", "points", "colors", "width", "antialiased"), &RenderingServer::canvas_item_add_polyline, DEFVAL(1.0), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_rect", "item", "rect", "color"), &RenderingServer::canvas_item_add_rect);
+ ClassDB::bind_method(D_METHOD("canvas_item_add_circle", "item", "pos", "radius", "color"), &RenderingServer::canvas_item_add_circle);
+ ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect", "item", "rect", "texture", "tile", "modulate", "transpose", "normal_map"), &RenderingServer::canvas_item_add_texture_rect, DEFVAL(false), DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect_region", "item", "rect", "texture", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &RenderingServer::canvas_item_add_texture_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(RID()), DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_nine_patch", "item", "rect", "source", "texture", "topleft", "bottomright", "x_axis_mode", "y_axis_mode", "draw_center", "modulate", "normal_map"), &RenderingServer::canvas_item_add_nine_patch, DEFVAL(NINE_PATCH_STRETCH), DEFVAL(NINE_PATCH_STRETCH), DEFVAL(true), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_primitive", "item", "points", "colors", "uvs", "texture", "width", "normal_map"), &RenderingServer::canvas_item_add_primitive, DEFVAL(1.0), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_polygon", "item", "points", "colors", "uvs", "texture", "normal_map", "antialiased"), &RenderingServer::canvas_item_add_polygon, DEFVAL(Vector<Point2>()), DEFVAL(RID()), DEFVAL(RID()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map", "antialiased"), &RenderingServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(Vector<int>()), DEFVAL(Vector<float>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "transform", "modulate", "texture", "normal_map"), &RenderingServer::canvas_item_add_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture", "normal_map"), &RenderingServer::canvas_item_add_multimesh, DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map"), &RenderingServer::canvas_item_add_particles);
+ ClassDB::bind_method(D_METHOD("canvas_item_add_set_transform", "item", "transform"), &RenderingServer::canvas_item_add_set_transform);
+ ClassDB::bind_method(D_METHOD("canvas_item_add_clip_ignore", "item", "ignore"), &RenderingServer::canvas_item_add_clip_ignore);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_sort_children_by_y", "item", "enabled"), &RenderingServer::canvas_item_set_sort_children_by_y);
#endif
- ClassDB::bind_method(D_METHOD("canvas_item_set_z_index", "item", "z_index"), &VisualServer::canvas_item_set_z_index);
- ClassDB::bind_method(D_METHOD("canvas_item_set_z_as_relative_to_parent", "item", "enabled"), &VisualServer::canvas_item_set_z_as_relative_to_parent);
- ClassDB::bind_method(D_METHOD("canvas_item_set_copy_to_backbuffer", "item", "enabled", "rect"), &VisualServer::canvas_item_set_copy_to_backbuffer);
- ClassDB::bind_method(D_METHOD("canvas_item_clear", "item"), &VisualServer::canvas_item_clear);
- ClassDB::bind_method(D_METHOD("canvas_item_set_draw_index", "item", "index"), &VisualServer::canvas_item_set_draw_index);
- ClassDB::bind_method(D_METHOD("canvas_item_set_material", "item", "material"), &VisualServer::canvas_item_set_material);
- ClassDB::bind_method(D_METHOD("canvas_item_set_use_parent_material", "item", "enabled"), &VisualServer::canvas_item_set_use_parent_material);
- ClassDB::bind_method(D_METHOD("canvas_light_create"), &VisualServer::canvas_light_create);
- ClassDB::bind_method(D_METHOD("canvas_light_attach_to_canvas", "light", "canvas"), &VisualServer::canvas_light_attach_to_canvas);
- ClassDB::bind_method(D_METHOD("canvas_light_set_enabled", "light", "enabled"), &VisualServer::canvas_light_set_enabled);
- ClassDB::bind_method(D_METHOD("canvas_light_set_scale", "light", "scale"), &VisualServer::canvas_light_set_scale);
- ClassDB::bind_method(D_METHOD("canvas_light_set_transform", "light", "transform"), &VisualServer::canvas_light_set_transform);
- ClassDB::bind_method(D_METHOD("canvas_light_set_texture", "light", "texture"), &VisualServer::canvas_light_set_texture);
- ClassDB::bind_method(D_METHOD("canvas_light_set_texture_offset", "light", "offset"), &VisualServer::canvas_light_set_texture_offset);
- ClassDB::bind_method(D_METHOD("canvas_light_set_color", "light", "color"), &VisualServer::canvas_light_set_color);
- ClassDB::bind_method(D_METHOD("canvas_light_set_height", "light", "height"), &VisualServer::canvas_light_set_height);
- ClassDB::bind_method(D_METHOD("canvas_light_set_energy", "light", "energy"), &VisualServer::canvas_light_set_energy);
- ClassDB::bind_method(D_METHOD("canvas_light_set_z_range", "light", "min_z", "max_z"), &VisualServer::canvas_light_set_z_range);
- ClassDB::bind_method(D_METHOD("canvas_light_set_layer_range", "light", "min_layer", "max_layer"), &VisualServer::canvas_light_set_layer_range);
- ClassDB::bind_method(D_METHOD("canvas_light_set_item_cull_mask", "light", "mask"), &VisualServer::canvas_light_set_item_cull_mask);
- ClassDB::bind_method(D_METHOD("canvas_light_set_item_shadow_cull_mask", "light", "mask"), &VisualServer::canvas_light_set_item_shadow_cull_mask);
- ClassDB::bind_method(D_METHOD("canvas_light_set_mode", "light", "mode"), &VisualServer::canvas_light_set_mode);
- ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_enabled", "light", "enabled"), &VisualServer::canvas_light_set_shadow_enabled);
- ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_buffer_size", "light", "size"), &VisualServer::canvas_light_set_shadow_buffer_size);
- ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_filter", "light", "filter"), &VisualServer::canvas_light_set_shadow_filter);
- ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_color", "light", "color"), &VisualServer::canvas_light_set_shadow_color);
- ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_smooth", "light", "smooth"), &VisualServer::canvas_light_set_shadow_smooth);
-
- ClassDB::bind_method(D_METHOD("canvas_light_occluder_create"), &VisualServer::canvas_light_occluder_create);
- ClassDB::bind_method(D_METHOD("canvas_light_occluder_attach_to_canvas", "occluder", "canvas"), &VisualServer::canvas_light_occluder_attach_to_canvas);
- ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_enabled", "occluder", "enabled"), &VisualServer::canvas_light_occluder_set_enabled);
- ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_polygon", "occluder", "polygon"), &VisualServer::canvas_light_occluder_set_polygon);
- ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_transform", "occluder", "transform"), &VisualServer::canvas_light_occluder_set_transform);
- ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_light_mask", "occluder", "mask"), &VisualServer::canvas_light_occluder_set_light_mask);
-
- ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_create"), &VisualServer::canvas_occluder_polygon_create);
- ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_shape", "occluder_polygon", "shape", "closed"), &VisualServer::canvas_occluder_polygon_set_shape);
- ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_shape_as_lines", "occluder_polygon", "shape"), &VisualServer::canvas_occluder_polygon_set_shape_as_lines);
- ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_cull_mode", "occluder_polygon", "mode"), &VisualServer::canvas_occluder_polygon_set_cull_mode);
-
- ClassDB::bind_method(D_METHOD("black_bars_set_margins", "left", "top", "right", "bottom"), &VisualServer::black_bars_set_margins);
- ClassDB::bind_method(D_METHOD("black_bars_set_images", "left", "top", "right", "bottom"), &VisualServer::black_bars_set_images);
-
- ClassDB::bind_method(D_METHOD("free_rid", "rid"), &VisualServer::free); // shouldn't conflict with Object::free()
-
- ClassDB::bind_method(D_METHOD("request_frame_drawn_callback", "where", "method", "userdata"), &VisualServer::request_frame_drawn_callback);
- ClassDB::bind_method(D_METHOD("has_changed"), &VisualServer::has_changed);
- ClassDB::bind_method(D_METHOD("init"), &VisualServer::init);
- ClassDB::bind_method(D_METHOD("finish"), &VisualServer::finish);
- ClassDB::bind_method(D_METHOD("get_render_info", "info"), &VisualServer::get_render_info);
- ClassDB::bind_method(D_METHOD("get_video_adapter_name"), &VisualServer::get_video_adapter_name);
- ClassDB::bind_method(D_METHOD("get_video_adapter_vendor"), &VisualServer::get_video_adapter_vendor);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_z_index", "item", "z_index"), &RenderingServer::canvas_item_set_z_index);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_z_as_relative_to_parent", "item", "enabled"), &RenderingServer::canvas_item_set_z_as_relative_to_parent);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_copy_to_backbuffer", "item", "enabled", "rect"), &RenderingServer::canvas_item_set_copy_to_backbuffer);
+ ClassDB::bind_method(D_METHOD("canvas_item_clear", "item"), &RenderingServer::canvas_item_clear);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_draw_index", "item", "index"), &RenderingServer::canvas_item_set_draw_index);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_material", "item", "material"), &RenderingServer::canvas_item_set_material);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_use_parent_material", "item", "enabled"), &RenderingServer::canvas_item_set_use_parent_material);
+ ClassDB::bind_method(D_METHOD("canvas_light_create"), &RenderingServer::canvas_light_create);
+ ClassDB::bind_method(D_METHOD("canvas_light_attach_to_canvas", "light", "canvas"), &RenderingServer::canvas_light_attach_to_canvas);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_enabled", "light", "enabled"), &RenderingServer::canvas_light_set_enabled);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_scale", "light", "scale"), &RenderingServer::canvas_light_set_scale);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_transform", "light", "transform"), &RenderingServer::canvas_light_set_transform);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_texture", "light", "texture"), &RenderingServer::canvas_light_set_texture);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_texture_offset", "light", "offset"), &RenderingServer::canvas_light_set_texture_offset);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_color", "light", "color"), &RenderingServer::canvas_light_set_color);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_height", "light", "height"), &RenderingServer::canvas_light_set_height);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_energy", "light", "energy"), &RenderingServer::canvas_light_set_energy);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_z_range", "light", "min_z", "max_z"), &RenderingServer::canvas_light_set_z_range);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_layer_range", "light", "min_layer", "max_layer"), &RenderingServer::canvas_light_set_layer_range);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_item_cull_mask", "light", "mask"), &RenderingServer::canvas_light_set_item_cull_mask);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_item_shadow_cull_mask", "light", "mask"), &RenderingServer::canvas_light_set_item_shadow_cull_mask);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_mode", "light", "mode"), &RenderingServer::canvas_light_set_mode);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_enabled", "light", "enabled"), &RenderingServer::canvas_light_set_shadow_enabled);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_buffer_size", "light", "size"), &RenderingServer::canvas_light_set_shadow_buffer_size);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_filter", "light", "filter"), &RenderingServer::canvas_light_set_shadow_filter);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_color", "light", "color"), &RenderingServer::canvas_light_set_shadow_color);
+ ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_smooth", "light", "smooth"), &RenderingServer::canvas_light_set_shadow_smooth);
+
+ ClassDB::bind_method(D_METHOD("canvas_light_occluder_create"), &RenderingServer::canvas_light_occluder_create);
+ ClassDB::bind_method(D_METHOD("canvas_light_occluder_attach_to_canvas", "occluder", "canvas"), &RenderingServer::canvas_light_occluder_attach_to_canvas);
+ ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_enabled", "occluder", "enabled"), &RenderingServer::canvas_light_occluder_set_enabled);
+ ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_polygon", "occluder", "polygon"), &RenderingServer::canvas_light_occluder_set_polygon);
+ ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_transform", "occluder", "transform"), &RenderingServer::canvas_light_occluder_set_transform);
+ ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_light_mask", "occluder", "mask"), &RenderingServer::canvas_light_occluder_set_light_mask);
+
+ ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_create"), &RenderingServer::canvas_occluder_polygon_create);
+ ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_shape", "occluder_polygon", "shape", "closed"), &RenderingServer::canvas_occluder_polygon_set_shape);
+ ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_shape_as_lines", "occluder_polygon", "shape"), &RenderingServer::canvas_occluder_polygon_set_shape_as_lines);
+ ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_cull_mode", "occluder_polygon", "mode"), &RenderingServer::canvas_occluder_polygon_set_cull_mode);
+
+ ClassDB::bind_method(D_METHOD("black_bars_set_margins", "left", "top", "right", "bottom"), &RenderingServer::black_bars_set_margins);
+ ClassDB::bind_method(D_METHOD("black_bars_set_images", "left", "top", "right", "bottom"), &RenderingServer::black_bars_set_images);
+
+ ClassDB::bind_method(D_METHOD("free_rid", "rid"), &RenderingServer::free); // shouldn't conflict with Object::free()
+
+ ClassDB::bind_method(D_METHOD("request_frame_drawn_callback", "where", "method", "userdata"), &RenderingServer::request_frame_drawn_callback);
+ ClassDB::bind_method(D_METHOD("has_changed"), &RenderingServer::has_changed);
+ ClassDB::bind_method(D_METHOD("init"), &RenderingServer::init);
+ ClassDB::bind_method(D_METHOD("finish"), &RenderingServer::finish);
+ ClassDB::bind_method(D_METHOD("get_render_info", "info"), &RenderingServer::get_render_info);
+ ClassDB::bind_method(D_METHOD("get_video_adapter_name"), &RenderingServer::get_video_adapter_name);
+ ClassDB::bind_method(D_METHOD("get_video_adapter_vendor"), &RenderingServer::get_video_adapter_vendor);
#ifndef _3D_DISABLED
- ClassDB::bind_method(D_METHOD("make_sphere_mesh", "latitudes", "longitudes", "radius"), &VisualServer::make_sphere_mesh);
- ClassDB::bind_method(D_METHOD("get_test_cube"), &VisualServer::get_test_cube);
+ ClassDB::bind_method(D_METHOD("make_sphere_mesh", "latitudes", "longitudes", "radius"), &RenderingServer::make_sphere_mesh);
+ ClassDB::bind_method(D_METHOD("get_test_cube"), &RenderingServer::get_test_cube);
#endif
- ClassDB::bind_method(D_METHOD("get_test_texture"), &VisualServer::get_test_texture);
- ClassDB::bind_method(D_METHOD("get_white_texture"), &VisualServer::get_white_texture);
+ ClassDB::bind_method(D_METHOD("get_test_texture"), &RenderingServer::get_test_texture);
+ ClassDB::bind_method(D_METHOD("get_white_texture"), &RenderingServer::get_white_texture);
- ClassDB::bind_method(D_METHOD("set_boot_image", "image", "color", "scale", "use_filter"), &VisualServer::set_boot_image, DEFVAL(true));
- ClassDB::bind_method(D_METHOD("set_default_clear_color", "color"), &VisualServer::set_default_clear_color);
+ ClassDB::bind_method(D_METHOD("set_boot_image", "image", "color", "scale", "use_filter"), &RenderingServer::set_boot_image, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("set_default_clear_color", "color"), &RenderingServer::set_default_clear_color);
- ClassDB::bind_method(D_METHOD("has_feature", "feature"), &VisualServer::has_feature);
- ClassDB::bind_method(D_METHOD("has_os_feature", "feature"), &VisualServer::has_os_feature);
- ClassDB::bind_method(D_METHOD("set_debug_generate_wireframes", "generate"), &VisualServer::set_debug_generate_wireframes);
+ ClassDB::bind_method(D_METHOD("has_feature", "feature"), &RenderingServer::has_feature);
+ ClassDB::bind_method(D_METHOD("has_os_feature", "feature"), &RenderingServer::has_os_feature);
+ ClassDB::bind_method(D_METHOD("set_debug_generate_wireframes", "generate"), &RenderingServer::set_debug_generate_wireframes);
BIND_CONSTANT(NO_INDEX_ARRAY);
BIND_CONSTANT(ARRAY_WEIGHTS_SIZE);
@@ -2227,18 +2227,18 @@ void VisualServer::_bind_methods() {
ADD_SIGNAL(MethodInfo("frame_post_draw"));
}
-void VisualServer::_canvas_item_add_style_box(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector<float> &p_margins, const Color &p_modulate) {
+void RenderingServer::_canvas_item_add_style_box(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector<float> &p_margins, const Color &p_modulate) {
ERR_FAIL_COND(p_margins.size() != 4);
//canvas_item_add_style_box(p_item,p_rect,p_source,p_texture,Vector2(p_margins[0],p_margins[1]),Vector2(p_margins[2],p_margins[3]),true,p_modulate);
}
-void VisualServer::_camera_set_orthogonal(RID p_camera, float p_size, float p_z_near, float p_z_far) {
+void RenderingServer::_camera_set_orthogonal(RID p_camera, float p_size, float p_z_near, float p_z_far) {
camera_set_orthogonal(p_camera, p_size, p_z_near, p_z_far);
}
-void VisualServer::mesh_add_surface_from_mesh_data(RID p_mesh, const Geometry::MeshData &p_mesh_data) {
+void RenderingServer::mesh_add_surface_from_mesh_data(RID p_mesh, const Geometry::MeshData &p_mesh_data) {
Vector<Vector3> vertices;
Vector<Vector3> normals;
@@ -2260,23 +2260,23 @@ void VisualServer::mesh_add_surface_from_mesh_data(RID p_mesh, const Geometry::M
}
Array d;
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
d[ARRAY_VERTEX] = vertices;
d[ARRAY_NORMAL] = normals;
mesh_add_surface_from_arrays(p_mesh, PRIMITIVE_TRIANGLES, d);
}
-void VisualServer::mesh_add_surface_from_planes(RID p_mesh, const Vector<Plane> &p_planes) {
+void RenderingServer::mesh_add_surface_from_planes(RID p_mesh, const Vector<Plane> &p_planes) {
Geometry::MeshData mdata = Geometry::build_convex_mesh(p_planes);
mesh_add_surface_from_mesh_data(p_mesh, mdata);
}
-void VisualServer::immediate_vertex_2d(RID p_immediate, const Vector2 &p_vertex) {
+void RenderingServer::immediate_vertex_2d(RID p_immediate, const Vector2 &p_vertex) {
immediate_vertex(p_immediate, Vector3(p_vertex.x, p_vertex.y, 0));
}
-RID VisualServer::instance_create2(RID p_base, RID p_scenario) {
+RID RenderingServer::instance_create2(RID p_base, RID p_scenario) {
RID instance = instance_create();
instance_set_base(instance, p_base);
@@ -2284,7 +2284,7 @@ RID VisualServer::instance_create2(RID p_base, RID p_scenario) {
return instance;
}
-VisualServer::VisualServer() {
+RenderingServer::RenderingServer() {
//ERR_FAIL_COND(singleton);
singleton = this;
@@ -2357,7 +2357,7 @@ VisualServer::VisualServer() {
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/screen_space_roughness_limiter_curve", PropertyInfo(Variant::FLOAT, "rendering/quality/filters/screen_space_roughness_limiter_curve", PROPERTY_HINT_EXP_EASING, "0.01,8,0.01"));
}
-VisualServer::~VisualServer() {
+RenderingServer::~RenderingServer() {
singleton = NULL;
}
diff --git a/servers/visual_server.h b/servers/rendering_server.h
index 506800cc7d..92820aca21 100644
--- a/servers/visual_server.h
+++ b/servers/rendering_server.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visual_server.h */
+/* rendering_server.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef VISUAL_SERVER_H
-#define VISUAL_SERVER_H
+#ifndef RENDERING_SERVER_H
+#define RENDERING_SERVER_H
#include "core/image.h"
#include "core/math/geometry.h"
@@ -39,11 +39,11 @@
#include "core/variant.h"
#include "servers/display_server.h"
-class VisualServer : public Object {
+class RenderingServer : public Object {
- GDCLASS(VisualServer, Object);
+ GDCLASS(RenderingServer, Object);
- static VisualServer *singleton;
+ static RenderingServer *singleton;
int mm_policy;
@@ -60,12 +60,12 @@ protected:
Error _surface_set_data(Array p_arrays, uint32_t p_format, uint32_t *p_offsets, uint32_t p_stride, Vector<uint8_t> &r_vertex_array, int p_vertex_array_len, Vector<uint8_t> &r_index_array, int p_index_array_len, AABB &r_aabb, Vector<AABB> &r_bone_aabb);
- static VisualServer *(*create_func)();
+ static RenderingServer *(*create_func)();
static void _bind_methods();
public:
- static VisualServer *get_singleton();
- static VisualServer *create();
+ static RenderingServer *get_singleton();
+ static RenderingServer *create();
enum {
NO_INDEX_ARRAY = -1,
@@ -1103,55 +1103,55 @@ public:
virtual bool is_low_end() const = 0;
- VisualServer();
- virtual ~VisualServer();
+ RenderingServer();
+ virtual ~RenderingServer();
};
// make variant understand the enums
-VARIANT_ENUM_CAST(VisualServer::TextureLayeredType);
-VARIANT_ENUM_CAST(VisualServer::CubeMapLayer);
-VARIANT_ENUM_CAST(VisualServer::ShaderMode);
-VARIANT_ENUM_CAST(VisualServer::ArrayType);
-VARIANT_ENUM_CAST(VisualServer::ArrayFormat);
-VARIANT_ENUM_CAST(VisualServer::PrimitiveType);
-VARIANT_ENUM_CAST(VisualServer::BlendShapeMode);
-VARIANT_ENUM_CAST(VisualServer::MultimeshTransformFormat);
-VARIANT_ENUM_CAST(VisualServer::LightType);
-VARIANT_ENUM_CAST(VisualServer::LightParam);
-VARIANT_ENUM_CAST(VisualServer::LightOmniShadowMode);
-VARIANT_ENUM_CAST(VisualServer::LightDirectionalShadowMode);
-VARIANT_ENUM_CAST(VisualServer::LightDirectionalShadowDepthRangeMode);
-VARIANT_ENUM_CAST(VisualServer::ReflectionProbeUpdateMode);
-VARIANT_ENUM_CAST(VisualServer::ParticlesDrawOrder);
-VARIANT_ENUM_CAST(VisualServer::ViewportUpdateMode);
-VARIANT_ENUM_CAST(VisualServer::ViewportClearMode);
-VARIANT_ENUM_CAST(VisualServer::ViewportMSAA);
-VARIANT_ENUM_CAST(VisualServer::ViewportRenderInfo);
-VARIANT_ENUM_CAST(VisualServer::ViewportDebugDraw);
-VARIANT_ENUM_CAST(VisualServer::SkyMode);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentBG);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentAmbientSource);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentReflectionSource);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentGlowBlendMode);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentToneMapper);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentSSAOQuality);
-VARIANT_ENUM_CAST(VisualServer::EnvironmentSSAOBlur);
-VARIANT_ENUM_CAST(VisualServer::DOFBlurQuality);
-VARIANT_ENUM_CAST(VisualServer::DOFBokehShape);
-VARIANT_ENUM_CAST(VisualServer::ScenarioDebugMode);
-VARIANT_ENUM_CAST(VisualServer::InstanceType);
-VARIANT_ENUM_CAST(VisualServer::InstanceFlags);
-VARIANT_ENUM_CAST(VisualServer::ShadowCastingSetting);
-VARIANT_ENUM_CAST(VisualServer::NinePatchAxisMode);
-VARIANT_ENUM_CAST(VisualServer::CanvasItemTextureFilter);
-VARIANT_ENUM_CAST(VisualServer::CanvasItemTextureRepeat);
-VARIANT_ENUM_CAST(VisualServer::CanvasLightMode);
-VARIANT_ENUM_CAST(VisualServer::CanvasLightShadowFilter);
-VARIANT_ENUM_CAST(VisualServer::CanvasOccluderPolygonCullMode);
-VARIANT_ENUM_CAST(VisualServer::RenderInfo);
-VARIANT_ENUM_CAST(VisualServer::Features);
-
-//typedef VisualServer VS; // makes it easier to use
-#define VS VisualServer
+VARIANT_ENUM_CAST(RenderingServer::TextureLayeredType);
+VARIANT_ENUM_CAST(RenderingServer::CubeMapLayer);
+VARIANT_ENUM_CAST(RenderingServer::ShaderMode);
+VARIANT_ENUM_CAST(RenderingServer::ArrayType);
+VARIANT_ENUM_CAST(RenderingServer::ArrayFormat);
+VARIANT_ENUM_CAST(RenderingServer::PrimitiveType);
+VARIANT_ENUM_CAST(RenderingServer::BlendShapeMode);
+VARIANT_ENUM_CAST(RenderingServer::MultimeshTransformFormat);
+VARIANT_ENUM_CAST(RenderingServer::LightType);
+VARIANT_ENUM_CAST(RenderingServer::LightParam);
+VARIANT_ENUM_CAST(RenderingServer::LightOmniShadowMode);
+VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowMode);
+VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowDepthRangeMode);
+VARIANT_ENUM_CAST(RenderingServer::ReflectionProbeUpdateMode);
+VARIANT_ENUM_CAST(RenderingServer::ParticlesDrawOrder);
+VARIANT_ENUM_CAST(RenderingServer::ViewportUpdateMode);
+VARIANT_ENUM_CAST(RenderingServer::ViewportClearMode);
+VARIANT_ENUM_CAST(RenderingServer::ViewportMSAA);
+VARIANT_ENUM_CAST(RenderingServer::ViewportRenderInfo);
+VARIANT_ENUM_CAST(RenderingServer::ViewportDebugDraw);
+VARIANT_ENUM_CAST(RenderingServer::SkyMode);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentBG);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentAmbientSource);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentReflectionSource);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentGlowBlendMode);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentToneMapper);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentSSAOQuality);
+VARIANT_ENUM_CAST(RenderingServer::EnvironmentSSAOBlur);
+VARIANT_ENUM_CAST(RenderingServer::DOFBlurQuality);
+VARIANT_ENUM_CAST(RenderingServer::DOFBokehShape);
+VARIANT_ENUM_CAST(RenderingServer::ScenarioDebugMode);
+VARIANT_ENUM_CAST(RenderingServer::InstanceType);
+VARIANT_ENUM_CAST(RenderingServer::InstanceFlags);
+VARIANT_ENUM_CAST(RenderingServer::ShadowCastingSetting);
+VARIANT_ENUM_CAST(RenderingServer::NinePatchAxisMode);
+VARIANT_ENUM_CAST(RenderingServer::CanvasItemTextureFilter);
+VARIANT_ENUM_CAST(RenderingServer::CanvasItemTextureRepeat);
+VARIANT_ENUM_CAST(RenderingServer::CanvasLightMode);
+VARIANT_ENUM_CAST(RenderingServer::CanvasLightShadowFilter);
+VARIANT_ENUM_CAST(RenderingServer::CanvasOccluderPolygonCullMode);
+VARIANT_ENUM_CAST(RenderingServer::RenderInfo);
+VARIANT_ENUM_CAST(RenderingServer::Features);
+
+//typedef RenderingServer VS; // makes it easier to use
+#define RS RenderingServer
#endif
diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp
deleted file mode 100644
index 041ad799d0..0000000000
--- a/servers/visual/shader_types.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/*************************************************************************/
-/* shader_types.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "shader_types.h"
-
-const Map<StringName, ShaderLanguage::FunctionInfo> &ShaderTypes::get_functions(VS::ShaderMode p_mode) {
-
- return shader_modes[p_mode].functions;
-}
-
-const Vector<StringName> &ShaderTypes::get_modes(VS::ShaderMode p_mode) {
-
- return shader_modes[p_mode].modes;
-}
-
-const Set<String> &ShaderTypes::get_types() {
- return shader_types;
-}
-
-ShaderTypes *ShaderTypes::singleton = NULL;
-
-static ShaderLanguage::BuiltInInfo constt(ShaderLanguage::DataType p_type) {
-
- return ShaderLanguage::BuiltInInfo(p_type, true);
-}
-
-ShaderTypes::ShaderTypes() {
- singleton = this;
-
- /*************** SPATIAL ***********************/
-
- shader_modes[VS::SHADER_SPATIAL].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
-
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["VERTEX"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["NORMAL"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["TANGENT"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["BINORMAL"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["POSITION"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["UV"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["UV2"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["POINT_SIZE"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["INSTANCE_ID"] = constt(ShaderLanguage::TYPE_INT);
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["INSTANCE_CUSTOM"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["ROUGHNESS"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].can_discard = false;
-
- //builtins
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["WORLD_MATRIX"] = ShaderLanguage::TYPE_MAT4;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["WORLD_NORMAL_MATRIX"] = ShaderLanguage::TYPE_MAT3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["INV_CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["PROJECTION_MATRIX"] = ShaderLanguage::TYPE_MAT4;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["INV_PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["MODELVIEW_MATRIX"] = ShaderLanguage::TYPE_MAT4;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["MODELVIEW_NORMAL_MATRIX"] = ShaderLanguage::TYPE_MAT3;
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["VIEWPORT_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SPATIAL].functions["vertex"].built_ins["OUTPUT_IS_SRGB"] = constt(ShaderLanguage::TYPE_BOOL);
-
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["VERTEX"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["FRONT_FACING"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["NORMAL"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["TANGENT"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["BINORMAL"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["VIEW"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["NORMALMAP"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["NORMALMAP_DEPTH"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["UV2"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ALBEDO"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["METALLIC"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SPECULAR"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ROUGHNESS"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["RIM"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["RIM_TINT"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["CLEARCOAT"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["CLEARCOAT_GLOSS"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ANISOTROPY"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ANISOTROPY_FLOW"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SSS_STRENGTH"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["TRANSMISSION"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["AO"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["AO_LIGHT_AFFECT"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["EMISSION"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SCREEN_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["DEPTH_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["DEPTH"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SCREEN_UV"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["POINT_COORD"] = constt(ShaderLanguage::TYPE_VEC2);
-
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["OUTPUT_IS_SRGB"] = constt(ShaderLanguage::TYPE_BOOL);
-
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["WORLD_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["WORLD_NORMAL_MATRIX"] = constt(ShaderLanguage::TYPE_MAT3);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["INV_CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["INV_PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["VIEWPORT_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SPATIAL].functions["fragment"].can_discard = true;
-
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["WORLD_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["INV_CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["CAMERA_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["INV_PROJECTION_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["VIEWPORT_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
-
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["NORMAL"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["UV2"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["VIEW"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["LIGHT"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["LIGHT_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["ATTENUATION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["ALBEDO"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["TRANSMISSION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["ROUGHNESS"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["DIFFUSE_LIGHT"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["SPECULAR_LIGHT"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["OUTPUT_IS_SRGB"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SPATIAL].functions["light"].built_ins["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
-
- shader_modes[VS::SHADER_SPATIAL].functions["light"].can_discard = true;
-
- //order used puts first enum mode (default) first
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("blend_mix");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("blend_add");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("blend_sub");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("blend_mul");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("depth_draw_opaque");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("depth_draw_always");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("depth_draw_never");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("depth_prepass_alpha");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("depth_test_disabled");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("cull_back");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("cull_front");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("cull_disabled");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("unshaded");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("wireframe");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("diffuse_lambert");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("diffuse_lambert_wrap");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("diffuse_oren_nayar");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("diffuse_burley");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("diffuse_toon");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("specular_schlick_ggx");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("specular_blinn");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("specular_phong");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("specular_toon");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("specular_disabled");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("skip_vertex_transform");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("world_vertex_coords");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("ensure_correct_normals");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("shadows_disabled");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("ambient_light_disabled");
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("shadow_to_opacity");
-
- shader_modes[VS::SHADER_SPATIAL].modes.push_back("vertex_lighting");
-
- /************ CANVAS ITEM **************************/
-
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
-
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["VERTEX"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["UV"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["POINT_SIZE"] = ShaderLanguage::TYPE_FLOAT;
-
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["WORLD_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["CANVAS_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["SCREEN_MATRIX"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["INSTANCE_CUSTOM"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["AT_LIGHT_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].can_discard = false;
-
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["VERTEX"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SHADOW_VERTEX"] = ShaderLanguage::TYPE_VEC2;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["LIGHT_VERTEX"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMAL"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMALMAP"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMALMAP_DEPTH"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["NORMAL_TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SPECULAR_SHININESS_TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SPECULAR_SHININESS"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SCREEN_UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SCREEN_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["POINT_COORD"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["AT_LIGHT_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["SCREEN_TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].can_discard = true;
-
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["NORMAL"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["SPECULAR_SHININESS"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT_COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT_POSITION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT_VERTEX"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["LIGHT"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["SHADOW_MODULATE"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["SCREEN_UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["TEXTURE"] = constt(ShaderLanguage::TYPE_SAMPLER2D);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].built_ins["POINT_COORD"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"].can_discard = true;
-
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("skip_vertex_transform");
-
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("blend_mix");
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("blend_add");
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("blend_sub");
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("blend_mul");
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("blend_premul_alpha");
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("blend_disabled");
-
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("unshaded");
- shader_modes[VS::SHADER_CANVAS_ITEM].modes.push_back("light_only");
-
- /************ PARTICLES **************************/
-
- shader_modes[VS::SHADER_PARTICLES].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["VELOCITY"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["MASS"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["ACTIVE"] = ShaderLanguage::TYPE_BOOL;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["RESTART"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["CUSTOM"] = ShaderLanguage::TYPE_VEC4;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["TRANSFORM"] = ShaderLanguage::TYPE_MAT4;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["LIFETIME"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["DELTA"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["NUMBER"] = constt(ShaderLanguage::TYPE_UINT);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["INDEX"] = constt(ShaderLanguage::TYPE_INT);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["EMISSION_TRANSFORM"] = constt(ShaderLanguage::TYPE_MAT4);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].built_ins["RANDOM_SEED"] = constt(ShaderLanguage::TYPE_UINT);
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"].can_discard = false;
-
- shader_modes[VS::SHADER_PARTICLES].modes.push_back("disable_force");
- shader_modes[VS::SHADER_PARTICLES].modes.push_back("disable_velocity");
- shader_modes[VS::SHADER_PARTICLES].modes.push_back("keep_data");
-
- /************ SKY **************************/
-
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["POSITION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["RADIANCE"] = constt(ShaderLanguage::TYPE_SAMPLERCUBE);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["AT_HALF_RES_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["AT_QUARTER_RES_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["AT_CUBEMAP_PASS"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT0_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT0_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT0_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT0_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT1_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT1_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT1_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT1_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT2_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT2_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT2_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT2_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT3_ENABLED"] = constt(ShaderLanguage::TYPE_BOOL);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT3_DIRECTION"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT3_ENERGY"] = constt(ShaderLanguage::TYPE_FLOAT);
- shader_modes[VS::SHADER_SKY].functions["global"].built_ins["LIGHT3_COLOR"] = constt(ShaderLanguage::TYPE_VEC3);
-
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC3;
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["ALPHA"] = ShaderLanguage::TYPE_FLOAT;
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["EYEDIR"] = constt(ShaderLanguage::TYPE_VEC3);
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["SCREEN_UV"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["SKY_COORDS"] = constt(ShaderLanguage::TYPE_VEC2);
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["HALF_RES_COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
- shader_modes[VS::SHADER_SKY].functions["fragment"].built_ins["QUARTER_RES_COLOR"] = constt(ShaderLanguage::TYPE_VEC4);
-
- shader_modes[VS::SHADER_SKY].modes.push_back("use_half_res_pass");
- shader_modes[VS::SHADER_SKY].modes.push_back("use_quarter_res_pass");
-
- shader_types.insert("spatial");
- shader_types.insert("canvas_item");
- shader_types.insert("particles");
- shader_types.insert("sky");
-}