diff options
95 files changed, 252 insertions, 227 deletions
diff --git a/main/tests/test_main.cpp b/main/tests/test_main.cpp index beb955d045..a9a671e2f1 100644 --- a/main/tests/test_main.cpp +++ b/main/tests/test_main.cpp @@ -40,8 +40,8 @@ #include "test_math.h" #include "test_oa_hash_map.h" #include "test_ordered_hash_map.h" -#include "test_physics.h" #include "test_physics_2d.h" +#include "test_physics_3d.h" #include "test_render.h" #include "test_shader_lang.h" #include "test_string.h" @@ -51,8 +51,8 @@ const char **tests_get_names() { static const char *test_names[] = { "string", "math", - "physics", "physics_2d", + "physics_3d", "render", "oa_hash_map", "gui", @@ -81,14 +81,14 @@ MainLoop *test_main(String p_test, const List<String> &p_args) { return TestMath::test(); } - if (p_test == "physics") { + if (p_test == "physics_2d") { - return TestPhysics::test(); + return TestPhysics2D::test(); } - if (p_test == "physics_2d") { + if (p_test == "physics_3d") { - return TestPhysics2D::test(); + return TestPhysics3D::test(); } if (p_test == "render") { diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics_3d.cpp index 5e8940f453..2d208ee317 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics_3d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* test_physics.cpp */ +/* test_physics_3d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "test_physics.h" +#include "test_physics_3d.h" #include "core/map.h" #include "core/math/math_funcs.h" @@ -40,9 +40,9 @@ #include "servers/physics_server_3d.h" #include "servers/rendering_server.h" -class TestPhysicsMainLoop : public MainLoop { +class TestPhysics3DMainLoop : public MainLoop { - GDCLASS(TestPhysicsMainLoop, MainLoop); + GDCLASS(TestPhysics3DMainLoop, MainLoop); enum { LINK_COUNT = 20, @@ -81,7 +81,7 @@ class TestPhysicsMainLoop : public MainLoop { protected: static void _bind_methods() { - ClassDB::bind_method("body_changed_transform", &TestPhysicsMainLoop::body_changed_transform); + ClassDB::bind_method("body_changed_transform", &TestPhysics3DMainLoop::body_changed_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()) { @@ -426,14 +426,14 @@ public: return false; } - TestPhysicsMainLoop() { + TestPhysics3DMainLoop() { } }; -namespace TestPhysics { +namespace TestPhysics3D { MainLoop *test() { - return memnew(TestPhysicsMainLoop); + return memnew(TestPhysics3DMainLoop); } -} // namespace TestPhysics +} // namespace TestPhysics3D diff --git a/main/tests/test_physics.h b/main/tests/test_physics_3d.h index fbbc59bba9..d03f2c6573 100644 --- a/main/tests/test_physics.h +++ b/main/tests/test_physics_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* test_physics.h */ +/* test_physics_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,7 +33,7 @@ #include "core/os/main_loop.h" -namespace TestPhysics { +namespace TestPhysics3D { MainLoop *test(); } diff --git a/modules/arkit/arkit_interface.mm b/modules/arkit/arkit_interface.mm index 90d9d7b03a..031e1e115e 100644 --- a/modules/arkit/arkit_interface.mm +++ b/modules/arkit/arkit_interface.mm @@ -31,7 +31,7 @@ #include "core/input/input_filter.h" #include "core/os/os.h" #include "scene/resources/surface_tool.h" -#include "servers/visual/visual_server_globals.h" +#include "servers/rendering/rendering_server_globals.h" #import <ARKit/ARKit.h> #import <UIKit/UIKit.h> diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 42f341cef7..e5d0e0b12d 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -122,7 +122,7 @@ void AudioStreamPlaybackOGGVorbis::seek(float p_time) { AudioStreamPlaybackOGGVorbis::~AudioStreamPlaybackOGGVorbis() { if (ogg_alloc.alloc_buffer) { stb_vorbis_close(ogg_stream); - AudioServer::get_singleton()->audio_data_free(ogg_alloc.alloc_buffer); + memfree(ogg_alloc.alloc_buffer); } } @@ -134,7 +134,7 @@ Ref<AudioStreamPlayback> AudioStreamOGGVorbis::instance_playback() { ovs.instance(); ovs->vorbis_stream = Ref<AudioStreamOGGVorbis>(this); - ovs->ogg_alloc.alloc_buffer = (char *)AudioServer::get_singleton()->audio_data_alloc(decode_mem_size); + ovs->ogg_alloc.alloc_buffer = (char *)memalloc(decode_mem_size); ovs->ogg_alloc.alloc_buffer_length_in_bytes = decode_mem_size; ovs->frames_mixed = 0; ovs->active = false; @@ -143,7 +143,7 @@ Ref<AudioStreamPlayback> AudioStreamOGGVorbis::instance_playback() { ovs->ogg_stream = stb_vorbis_open_memory((const unsigned char *)data, data_len, &error, &ovs->ogg_alloc); if (!ovs->ogg_stream) { - AudioServer::get_singleton()->audio_data_free(ovs->ogg_alloc.alloc_buffer); + memfree(ovs->ogg_alloc.alloc_buffer); ovs->ogg_alloc.alloc_buffer = NULL; ERR_FAIL_COND_V(!ovs->ogg_stream, Ref<AudioStreamPlaybackOGGVorbis>()); } @@ -158,7 +158,7 @@ String AudioStreamOGGVorbis::get_stream_name() const { void AudioStreamOGGVorbis::clear_data() { if (data) { - AudioServer::get_singleton()->audio_data_free(data); + memfree(data); data = NULL; data_len = 0; } @@ -210,7 +210,8 @@ void AudioStreamOGGVorbis::set_data(const Vector<uint8_t> &p_data) { // free any existing data clear_data(); - data = AudioServer::get_singleton()->audio_data_alloc(src_data_len, src_datar); + data = memalloc(src_data_len); + copymem(data, src_datar, src_data_len); data_len = src_data_len; break; diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java b/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java index e745cdd0a5..e3683704e1 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java +++ b/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* 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 */ diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java b/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java index b6d949b7bf..e13a9c15d8 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java +++ b/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* 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 */ diff --git a/platform/iphone/vulkan_context_iphone.h b/platform/iphone/vulkan_context_iphone.h index 200057e14d..625e41f4b9 100644 --- a/platform/iphone/vulkan_context_iphone.h +++ b/platform/iphone/vulkan_context_iphone.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* vulkan_context_osx.h */ +/* vulkan_context_iphone.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/platform/iphone/vulkan_context_iphone.mm b/platform/iphone/vulkan_context_iphone.mm index f49b85c097..701ac0d9bb 100644 --- a/platform/iphone/vulkan_context_iphone.mm +++ b/platform/iphone/vulkan_context_iphone.mm @@ -1,5 +1,5 @@ /*************************************************************************/ -/* vulkan_context_osx.mm */ +/* vulkan_context_iphone.mm */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index 3bdd12ec9d..074fc3be0d 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -50,7 +50,7 @@ #endif #if defined(VULKAN_ENABLED) -#include "servers/visual/rasterizer_rd/rasterizer_rd.h" +#include "servers/rendering/rasterizer_rd/rasterizer_rd.h" #include <QuartzCore/CAMetalLayer.h> #endif diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 707337bc8d..836fa5946a 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -1,3 +1,33 @@ +/*************************************************************************/ +/* display_server_windows.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 "display_server_windows.h" #include "core/io/marshalls.h" #include "main/main.h" diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index b0386d551e..e2c2fd7253 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -1,3 +1,33 @@ +/*************************************************************************/ +/* display_server_windows.h */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + #ifndef DISPLAY_SERVER_WINDOWS_H #define DISPLAY_SERVER_WINDOWS_H diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 289860d9c6..942d2aac24 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -360,7 +360,7 @@ struct _RigidBody2DInOut { int local_shape; }; -bool RigidBody2D::_test_motion(const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref<Physics2DTestMotionResult> &p_result) { +bool RigidBody2D::_test_motion(const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref<PhysicsTestMotionResult2D> &p_result) { PhysicsServer2D::MotionResult *r = NULL; if (p_result.is_valid()) @@ -373,7 +373,7 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { #ifdef DEBUG_ENABLED state = Object::cast_to<PhysicsDirectBodyState2D>(p_state); #else - state = (Physics2DDirectBodyState *)p_state; //trust it + state = (PhysicsDirectBodyState2D *)p_state; //trust it #endif set_block_transform_notify(true); // don't want notify (would feedback loop) @@ -898,7 +898,7 @@ void RigidBody2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_colliding_bodies"), &RigidBody2D::get_colliding_bodies); - BIND_VMETHOD(MethodInfo("_integrate_forces", PropertyInfo(Variant::OBJECT, "state", PROPERTY_HINT_RESOURCE_TYPE, "Physics2DDirectBodyState"))); + BIND_VMETHOD(MethodInfo("_integrate_forces", PropertyInfo(Variant::OBJECT, "state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectBodyState2D"))); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Rigid,Static,Character,Kinematic"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 5bce5f6be3..0d92a820e3 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -185,7 +185,7 @@ private: void _body_inout(int p_status, ObjectID p_instance, int p_body_shape, int p_local_shape); void _direct_state_changed(Object *p_state); - bool _test_motion(const Vector2 &p_motion, bool p_infinite_inertia = true, float p_margin = 0.08, const Ref<Physics2DTestMotionResult> &p_result = Ref<Physics2DTestMotionResult>()); + bool _test_motion(const Vector2 &p_motion, bool p_infinite_inertia = true, float p_margin = 0.08, const Ref<PhysicsTestMotionResult2D> &p_result = Ref<PhysicsTestMotionResult2D>()); protected: void _notification(int p_what); diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 1f3e2b8373..680d6e8594 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -374,7 +374,7 @@ void RigidBody3D::_direct_state_changed(Object *p_state) { #ifdef DEBUG_ENABLED state = Object::cast_to<PhysicsDirectBodyState3D>(p_state); #else - state = (PhysicsDirectBodyState *)p_state; //trust it + state = (PhysicsDirectBodyState3D *)p_state; //trust it #endif set_ignore_transform_notification(true); @@ -1300,7 +1300,7 @@ void KinematicBody3D::_direct_state_changed(Object *p_state) { #ifdef DEBUG_ENABLED PhysicsDirectBodyState3D *state = Object::cast_to<PhysicsDirectBodyState3D>(p_state); #else - PhysicsDirectBodyState *state = (PhysicsDirectBodyState *)p_state; //trust it + PhysicsDirectBodyState3D *state = (PhysicsDirectBodyState3D *)p_state; //trust it #endif linear_velocity = state->get_linear_velocity(); @@ -2106,7 +2106,7 @@ void PhysicalBone3D::_direct_state_changed(Object *p_state) { #ifdef DEBUG_ENABLED state = Object::cast_to<PhysicsDirectBodyState3D>(p_state); #else - state = (PhysicsDirectBodyState *)p_state; //trust it + state = (PhysicsDirectBodyState3D *)p_state; //trust it #endif Transform global_transform(state->get_transform()); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 1094759ce7..774d943efe 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -789,7 +789,20 @@ void register_scene_types() { ClassDB::add_compatibility_class("Path", "Path3D"); ClassDB::add_compatibility_class("PathFollow", "PathFollow3D"); ClassDB::add_compatibility_class("PhysicalBone", "PhysicalBone3D"); + ClassDB::add_compatibility_class("Physics2DDirectBodyStateSW", "PhysicsDirectBodyState2DSW"); + ClassDB::add_compatibility_class("Physics2DDirectBodyState", "PhysicsDirectBodyState2D"); + ClassDB::add_compatibility_class("Physics2DDirectSpaceState", "PhysicsDirectSpaceState2D"); + ClassDB::add_compatibility_class("Physics2DServerSW", "PhysicsServer2DSW"); + ClassDB::add_compatibility_class("Physics2DServer", "PhysicsServer2D"); + ClassDB::add_compatibility_class("Physics2DShapeQueryParameters", "PhysicsShapeQueryParameters2D"); + ClassDB::add_compatibility_class("Physics2DShapeQueryResult", "PhysicsShapeQueryResult2D"); + ClassDB::add_compatibility_class("Physics2DTestMotionResult", "PhysicsTestMotionResult2D"); ClassDB::add_compatibility_class("PhysicsBody", "PhysicsBody3D"); + ClassDB::add_compatibility_class("PhysicsDirectBodyState", "PhysicsDirectBodyState3D"); + ClassDB::add_compatibility_class("PhysicsDirectSpaceState", "PhysicsDirectSpaceState3D"); + ClassDB::add_compatibility_class("PhysicsServer", "PhysicsServer3D"); + ClassDB::add_compatibility_class("PhysicsShapeQueryParameters", "PhysicsShapeQueryParameters3D"); + ClassDB::add_compatibility_class("PhysicsShapeQueryResult", "PhysicsShapeQueryResult3D"); ClassDB::add_compatibility_class("PinJoint", "PinJoint3D"); ClassDB::add_compatibility_class("PlaneShape", "WorldMarginShape3D"); ClassDB::add_compatibility_class("ProximityGroup", "ProximityGroup3D"); @@ -814,6 +827,7 @@ void register_scene_types() { ClassDB::add_compatibility_class("VehicleWheel", "VehicleWheel3D"); ClassDB::add_compatibility_class("VisibilityEnabler", "VisibilityEnabler3D"); ClassDB::add_compatibility_class("VisibilityNotifier", "VisibilityNotifier3D"); + ClassDB::add_compatibility_class("VisualServer", "RenderingServer"); ClassDB::add_compatibility_class("VisualShaderNodeScalarConstant", "VisualShaderNodeFloatConstant"); ClassDB::add_compatibility_class("VisualShaderNodeScalarFunc", "VisualShaderNodeFloatFunc"); ClassDB::add_compatibility_class("VisualShaderNodeScalarOp", "VisualShaderNodeFloatOp"); diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index a68b750b31..06b65e4b4a 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -481,7 +481,7 @@ void AudioStreamSample::set_data(const Vector<uint8_t> &p_data) { AudioServer::get_singleton()->lock(); if (data) { - AudioServer::get_singleton()->audio_data_free(data); + memfree(data); data = NULL; data_bytes = 0; } @@ -491,7 +491,7 @@ void AudioStreamSample::set_data(const Vector<uint8_t> &p_data) { const uint8_t *r = p_data.ptr(); int alloc_len = datalen + DATA_PAD * 2; - data = AudioServer::get_singleton()->audio_data_alloc(alloc_len); //alloc with some padding for interpolation + data = memalloc(alloc_len); //alloc with some padding for interpolation zeromem(data, alloc_len); uint8_t *dataptr = (uint8_t *)data; copymem(dataptr + DATA_PAD, r, datalen); @@ -660,7 +660,7 @@ AudioStreamSample::AudioStreamSample() { AudioStreamSample::~AudioStreamSample() { if (data) { - AudioServer::get_singleton()->audio_data_free(data); + memfree(data); data = NULL; data_bytes = 0; } diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index cf11da784d..37b88cccea 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -6,7 +6,7 @@ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */ +/* 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 */ diff --git a/scene/resources/sky_material.h b/scene/resources/sky_material.h index 2d0a62e0f6..515706b0c5 100644 --- a/scene/resources/sky_material.h +++ b/scene/resources/sky_material.h @@ -6,7 +6,7 @@ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */ +/* 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 */ diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index ef8067497f..742ef106d9 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -376,7 +376,7 @@ void World2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::_RID, "canvas", PROPERTY_HINT_NONE, "", 0), "", "get_canvas"); ADD_PROPERTY(PropertyInfo(Variant::_RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "Physics2DDirectSpaceState", 0), "", "get_direct_space_state"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState2D", 0), "", "get_direct_space_state"); } PhysicsDirectSpaceState2D *World2D::get_direct_space_state() { diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 0e68c8a543..02e6d0f2d4 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -1131,47 +1131,6 @@ double AudioServer::get_time_since_last_mix() const { AudioServer *AudioServer::singleton = NULL; -void *AudioServer::audio_data_alloc(uint32_t p_data_len, const uint8_t *p_from_data) { - - void *ad = memalloc(p_data_len); - ERR_FAIL_COND_V(!ad, NULL); - if (p_from_data) { - copymem(ad, p_from_data, p_data_len); - } - - { - MutexLock lock(audio_data_lock); - - audio_data[ad] = p_data_len; - audio_data_total_mem += p_data_len; - audio_data_max_mem = MAX(audio_data_total_mem, audio_data_max_mem); - } - - return ad; -} - -void AudioServer::audio_data_free(void *p_data) { - - MutexLock lock(audio_data_lock); - - if (!audio_data.has(p_data)) { - ERR_FAIL(); - } - - audio_data_total_mem -= audio_data[p_data]; - audio_data.erase(p_data); - memfree(p_data); -} - -size_t AudioServer::audio_data_get_total_memory_usage() const { - - return audio_data_total_mem; -} -size_t AudioServer::audio_data_get_max_memory_usage() const { - - return audio_data_max_mem; -} - void AudioServer::add_callback(AudioCallback p_callback, void *p_userdata) { lock(); CallbackItem ci; @@ -1400,8 +1359,6 @@ void AudioServer::_bind_methods() { AudioServer::AudioServer() { singleton = this; - audio_data_total_mem = 0; - audio_data_max_mem = 0; mix_frames = 0; channel_count = 0; to_mix = 0; diff --git a/servers/audio_server.h b/servers/audio_server.h index 8df0172750..a1a3dde719 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -232,14 +232,6 @@ private: static AudioServer *singleton; - // TODO create an audiodata pool to optimize memory - - Map<void *, uint32_t> audio_data; - size_t audio_data_total_mem; - size_t audio_data_max_mem; - - Mutex audio_data_lock; - void init_channels_and_buffers(); void _mix_step(); @@ -350,12 +342,6 @@ public: virtual double get_time_to_next_mix() const; virtual double get_time_since_last_mix() const; - void *audio_data_alloc(uint32_t p_data_len, const uint8_t *p_from_data = NULL); - void audio_data_free(void *p_data); - - size_t audio_data_get_total_memory_usage() const; - size_t audio_data_get_max_memory_usage() const; - void add_callback(AudioCallback p_callback, void *p_userdata); void remove_callback(AudioCallback p_callback, void *p_userdata); diff --git a/servers/navigation_server_2d.cpp b/servers/navigation_server_2d.cpp index b64ad0e5ab..fe9eaa5736 100644 --- a/servers/navigation_server_2d.cpp +++ b/servers/navigation_server_2d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* navigation_2d_server.cpp */ +/* navigation_server_2d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/navigation_server_2d.h b/servers/navigation_server_2d.h index 272d07667d..af914e5ba9 100644 --- a/servers/navigation_server_2d.h +++ b/servers/navigation_server_2d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* navigation_2d_server.h */ +/* navigation_server_2d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp index 3cfc47b1e5..3e7a8e816e 100644 --- a/servers/navigation_server_3d.cpp +++ b/servers/navigation_server_3d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* navigation_server.cpp */ +/* navigation_server_3d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/navigation_server_3d.h b/servers/navigation_server_3d.h index 2e9d078f73..c34bd2391b 100644 --- a/servers/navigation_server_3d.h +++ b/servers/navigation_server_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* navigation_server.h */ +/* navigation_server_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 79388ffe93..11cf1339bc 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -601,7 +601,7 @@ void Body2DSW::call_queries() { if (fi_callback) { - Physics2DDirectBodyStateSW *dbs = Physics2DDirectBodyStateSW::singleton; + PhysicsDirectBodyState2DSW *dbs = PhysicsDirectBodyState2DSW::singleton; dbs->body = this; Variant v = dbs; @@ -706,14 +706,14 @@ Body2DSW::~Body2DSW() { memdelete(fi_callback); } -Physics2DDirectBodyStateSW *Physics2DDirectBodyStateSW::singleton = NULL; +PhysicsDirectBodyState2DSW *PhysicsDirectBodyState2DSW::singleton = NULL; -PhysicsDirectSpaceState2D *Physics2DDirectBodyStateSW::get_space_state() { +PhysicsDirectSpaceState2D *PhysicsDirectBodyState2DSW::get_space_state() { return body->get_space()->get_direct_state(); } -Variant Physics2DDirectBodyStateSW::get_contact_collider_shape_metadata(int p_contact_idx) const { +Variant PhysicsDirectBodyState2DSW::get_contact_collider_shape_metadata(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx, body->contact_count, Variant()); diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h index 4a83cf9500..e463377c7b 100644 --- a/servers/physics_2d/body_2d_sw.h +++ b/servers/physics_2d/body_2d_sw.h @@ -132,7 +132,7 @@ class Body2DSW : public CollisionObject2DSW { _FORCE_INLINE_ void _compute_area_gravity_and_dampenings(const Area2DSW *p_area); - friend class Physics2DDirectBodyStateSW; // i give up, too many functions to expose + friend class PhysicsDirectBodyState2DSW; // 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()); @@ -341,12 +341,12 @@ 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 PhysicsDirectBodyState2D { +class PhysicsDirectBodyState2DSW : public PhysicsDirectBodyState2D { - GDCLASS(Physics2DDirectBodyStateSW, PhysicsDirectBodyState2D); + GDCLASS(PhysicsDirectBodyState2DSW, PhysicsDirectBodyState2D); public: - static Physics2DDirectBodyStateSW *singleton; + static PhysicsDirectBodyState2DSW *singleton; Body2DSW *body; real_t step; @@ -417,7 +417,7 @@ public: virtual PhysicsDirectSpaceState2D *get_space_state(); virtual real_t get_step() const { return step; } - Physics2DDirectBodyStateSW() { + PhysicsDirectBodyState2DSW() { singleton = this; body = NULL; } diff --git a/servers/physics_2d/physics_server_2d_sw.cpp b/servers/physics_2d/physics_server_2d_sw.cpp index cd1f14b69d..e2a482e960 100644 --- a/servers/physics_2d/physics_server_2d_sw.cpp +++ b/servers/physics_2d/physics_server_2d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_2d_server_sw.cpp */ +/* physics_server_2d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -29,6 +29,7 @@ /*************************************************************************/ #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" @@ -1321,7 +1322,7 @@ void PhysicsServer2DSW::init() { last_step = 0.001; iterations = 8; // 8? stepper = memnew(Step2DSW); - direct_state = memnew(Physics2DDirectBodyStateSW); + direct_state = memnew(PhysicsDirectBodyState2DSW); }; void PhysicsServer2DSW::step(real_t p_step) { @@ -1334,7 +1335,7 @@ void PhysicsServer2DSW::step(real_t p_step) { doing_sync = false; last_step = p_step; - Physics2DDirectBodyStateSW::singleton->step = p_step; + PhysicsDirectBodyState2DSW::singleton->step = p_step; island_count = 0; active_objects = 0; collision_pairs = 0; diff --git a/servers/physics_2d/physics_server_2d_sw.h b/servers/physics_2d/physics_server_2d_sw.h index 196b9a50b9..9dfa8bf474 100644 --- a/servers/physics_2d/physics_server_2d_sw.h +++ b/servers/physics_2d/physics_server_2d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_2d_server_sw.h */ +/* physics_server_2d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -42,8 +42,8 @@ class PhysicsServer2DSW : public PhysicsServer2D { GDCLASS(PhysicsServer2DSW, PhysicsServer2D); - friend class Physics2DDirectSpaceStateSW; - friend class Physics2DDirectBodyStateSW; + friend class PhysicsDirectSpaceState2DSW; + friend class PhysicsDirectBodyState2DSW; bool active; int iterations; bool doing_sync; @@ -60,7 +60,7 @@ class PhysicsServer2DSW : public PhysicsServer2D { Step2DSW *stepper; Set<const Space2DSW *> active_spaces; - Physics2DDirectBodyStateSW *direct_state; + PhysicsDirectBodyState2DSW *direct_state; mutable RID_PtrOwner<Shape2DSW> shape_owner; mutable RID_PtrOwner<Space2DSW> space_owner; diff --git a/servers/physics_2d/physics_server_2d_wrap_mt.cpp b/servers/physics_2d/physics_server_2d_wrap_mt.cpp index c0f49aa4d1..5f65e296fd 100644 --- a/servers/physics_2d/physics_server_2d_wrap_mt.cpp +++ b/servers/physics_2d/physics_server_2d_wrap_mt.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_2d_server_wrap_mt.cpp */ +/* physics_server_2d_wrap_mt.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_2d/physics_server_2d_wrap_mt.h b/servers/physics_2d/physics_server_2d_wrap_mt.h index 8196ede069..ffd46feebd 100644 --- a/servers/physics_2d/physics_server_2d_wrap_mt.h +++ b/servers/physics_2d/physics_server_2d_wrap_mt.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_2d_server_wrap_mt.h */ +/* physics_server_2d_wrap_mt.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 72f3e8d1b4..cba190995f 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -49,7 +49,7 @@ _FORCE_INLINE_ static bool _can_collide_with(CollisionObject2DSW *p_object, uint return true; } -int Physics2DDirectSpaceStateSW::_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, ObjectID p_canvas_instance_id) { +int PhysicsDirectSpaceState2DSW::_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, ObjectID p_canvas_instance_id) { if (p_result_max <= 0) return 0; @@ -103,17 +103,17 @@ int Physics2DDirectSpaceStateSW::_intersect_point_impl(const Vector2 &p_point, S return cc; } -int Physics2DDirectSpaceStateSW::intersect_point(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) { +int PhysicsDirectSpaceState2DSW::intersect_point(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) { return _intersect_point_impl(p_point, r_results, p_result_max, p_exclude, p_collision_mask, p_collide_with_bodies, p_collide_with_areas, p_pick_point); } -int Physics2DDirectSpaceStateSW::intersect_point_on_canvas(const Vector2 &p_point, ObjectID p_canvas_instance_id, 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) { +int PhysicsDirectSpaceState2DSW::intersect_point_on_canvas(const Vector2 &p_point, ObjectID p_canvas_instance_id, 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) { return _intersect_point_impl(p_point, r_results, p_result_max, p_exclude, p_collision_mask, p_collide_with_bodies, p_collide_with_areas, p_pick_point, true, p_canvas_instance_id); } -bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vector2 &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 PhysicsDirectSpaceState2DSW::intersect_ray(const Vector2 &p_from, const Vector2 &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) { ERR_FAIL_COND_V(space->locked, false); @@ -193,7 +193,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vec return true; } -int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transform2D &p_xform, const Vector2 &p_motion, 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 PhysicsDirectSpaceState2DSW::intersect_shape(const RID &p_shape, const Transform2D &p_xform, const Vector2 &p_motion, 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; @@ -238,7 +238,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Trans return cc; } -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) { +bool PhysicsDirectSpaceState2DSW::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 = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape); ERR_FAIL_COND_V(!shape, false); @@ -308,7 +308,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor return true; } -bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, real_t p_margin, Vector2 *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 PhysicsDirectSpaceState2DSW::collide_shape(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, real_t p_margin, Vector2 *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; @@ -402,7 +402,7 @@ static void _rest_cbk_result(const Vector2 &p_point_A, const Vector2 &p_point_B, rd->best_local_shape = rd->local_shape; } -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) { +bool PhysicsDirectSpaceState2DSW::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 = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape); ERR_FAIL_COND_V(!shape, 0); @@ -462,7 +462,7 @@ bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D &p_sh return true; } -Physics2DDirectSpaceStateSW::Physics2DDirectSpaceStateSW() { +PhysicsDirectSpaceState2DSW::PhysicsDirectSpaceState2DSW() { space = NULL; } @@ -802,7 +802,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co //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 - Vector2 motion = lv * Physics2DDirectBodyStateSW::singleton->step; + Vector2 motion = lv * PhysicsDirectBodyState2DSW::singleton->step; float motion_len = motion.length(); motion.normalize(); cbk.valid_depth += motion_len * MAX(motion.dot(-cbk.valid_dir), 0.0); @@ -1323,7 +1323,7 @@ bool Space2DSW::is_locked() const { return locked; } -Physics2DDirectSpaceStateSW *Space2DSW::get_direct_state() { +PhysicsDirectSpaceState2DSW *Space2DSW::get_direct_state() { return direct_access; } @@ -1353,7 +1353,7 @@ Space2DSW::Space2DSW() { broadphase->set_unpair_callback(_broadphase_unpair, this); area = NULL; - direct_access = memnew(Physics2DDirectSpaceStateSW); + direct_access = memnew(PhysicsDirectSpaceState2DSW); direct_access->space = this; for (int i = 0; i < ELAPSED_TIME_MAX; i++) diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h index f4971635b9..c6b324c928 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 PhysicsDirectSpaceState2D { +class PhysicsDirectSpaceState2DSW : public PhysicsDirectSpaceState2D { - GDCLASS(Physics2DDirectSpaceStateSW, PhysicsDirectSpaceState2D); + GDCLASS(PhysicsDirectSpaceState2DSW, 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()); @@ -58,7 +58,7 @@ public: virtual bool collide_shape(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, real_t p_margin, Vector2 *r_results, int p_result_max, int &r_result_count, 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 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 = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false); - Physics2DDirectSpaceStateSW(); + PhysicsDirectSpaceState2DSW(); }; class Space2DSW { @@ -83,7 +83,7 @@ private: uint64_t elapsed_time[ELAPSED_TIME_MAX]; - Physics2DDirectSpaceStateSW *direct_access; + PhysicsDirectSpaceState2DSW *direct_access; RID self; BroadPhase2DSW *broadphase; @@ -129,7 +129,7 @@ private: Vector<Vector2> contact_debug; int contact_debug_count; - friend class Physics2DDirectSpaceStateSW; + friend class PhysicsDirectSpaceState2DSW; public: _FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; } @@ -197,7 +197,7 @@ public: _FORCE_INLINE_ Vector<Vector2> get_debug_contacts() { return contact_debug; } _FORCE_INLINE_ int get_debug_contact_count() { return contact_debug_count; } - Physics2DDirectSpaceStateSW *get_direct_state(); + PhysicsDirectSpaceState2DSW *get_direct_state(); 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]; } diff --git a/servers/physics_3d/area_3d_sw.cpp b/servers/physics_3d/area_3d_sw.cpp index 99d4d2ec1b..911a664a10 100644 --- a/servers/physics_3d/area_3d_sw.cpp +++ b/servers/physics_3d/area_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* area_sw.cpp */ +/* area_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/area_3d_sw.h b/servers/physics_3d/area_3d_sw.h index bc57790206..05e74e63dc 100644 --- a/servers/physics_3d/area_3d_sw.h +++ b/servers/physics_3d/area_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* area_sw.h */ +/* area_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/area_pair_3d_sw.cpp b/servers/physics_3d/area_pair_3d_sw.cpp index 3300e9dede..e92a3a0dd1 100644 --- a/servers/physics_3d/area_pair_3d_sw.cpp +++ b/servers/physics_3d/area_pair_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* area_pair_sw.cpp */ +/* area_pair_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/area_pair_3d_sw.h b/servers/physics_3d/area_pair_3d_sw.h index 6f7e1ee3b5..3490f41c26 100644 --- a/servers/physics_3d/area_pair_3d_sw.h +++ b/servers/physics_3d/area_pair_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* area_pair_sw.h */ +/* area_pair_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/body_3d_sw.cpp b/servers/physics_3d/body_3d_sw.cpp index dcdc373dc9..6a00e4f471 100644 --- a/servers/physics_3d/body_3d_sw.cpp +++ b/servers/physics_3d/body_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* body_sw.cpp */ +/* body_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/body_3d_sw.h b/servers/physics_3d/body_3d_sw.h index 7020805af0..368dd59b06 100644 --- a/servers/physics_3d/body_3d_sw.h +++ b/servers/physics_3d/body_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* body_sw.h */ +/* body_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/body_pair_3d_sw.cpp b/servers/physics_3d/body_pair_3d_sw.cpp index 9c3c847afe..245fb3449c 100644 --- a/servers/physics_3d/body_pair_3d_sw.cpp +++ b/servers/physics_3d/body_pair_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* body_pair_sw.cpp */ +/* body_pair_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/body_pair_3d_sw.h b/servers/physics_3d/body_pair_3d_sw.h index 61c219657c..7f4afb9dca 100644 --- a/servers/physics_3d/body_pair_3d_sw.h +++ b/servers/physics_3d/body_pair_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* body_pair_sw.h */ +/* body_pair_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/broad_phase_3d_basic.cpp b/servers/physics_3d/broad_phase_3d_basic.cpp index bc0af98e4a..bea87a45ca 100644 --- a/servers/physics_3d/broad_phase_3d_basic.cpp +++ b/servers/physics_3d/broad_phase_3d_basic.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* broad_phase_basic.cpp */ +/* broad_phase_3d_basic.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/broad_phase_3d_basic.h b/servers/physics_3d/broad_phase_3d_basic.h index 00263dad0a..9b20b7619a 100644 --- a/servers/physics_3d/broad_phase_3d_basic.h +++ b/servers/physics_3d/broad_phase_3d_basic.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* broad_phase_basic.h */ +/* broad_phase_3d_basic.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/broad_phase_3d_sw.cpp b/servers/physics_3d/broad_phase_3d_sw.cpp index b15b08ddfe..5e367a7736 100644 --- a/servers/physics_3d/broad_phase_3d_sw.cpp +++ b/servers/physics_3d/broad_phase_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* broad_phase_sw.cpp */ +/* broad_phase_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/broad_phase_3d_sw.h b/servers/physics_3d/broad_phase_3d_sw.h index dd6984cbca..47d09a8b1d 100644 --- a/servers/physics_3d/broad_phase_3d_sw.h +++ b/servers/physics_3d/broad_phase_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* broad_phase_sw.h */ +/* broad_phase_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/collision_object_3d_sw.cpp b/servers/physics_3d/collision_object_3d_sw.cpp index 34e1c0f736..ba13d70e4f 100644 --- a/servers/physics_3d/collision_object_3d_sw.cpp +++ b/servers/physics_3d/collision_object_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_object_sw.cpp */ +/* collision_object_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/collision_object_3d_sw.h b/servers/physics_3d/collision_object_3d_sw.h index 582d447189..c5773d0c61 100644 --- a/servers/physics_3d/collision_object_3d_sw.h +++ b/servers/physics_3d/collision_object_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_object_sw.h */ +/* collision_object_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/collision_solver_3d_sat.cpp b/servers/physics_3d/collision_solver_3d_sat.cpp index ae205ceb48..0a7a9caf91 100644 --- a/servers/physics_3d/collision_solver_3d_sat.cpp +++ b/servers/physics_3d/collision_solver_3d_sat.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_solver_sat.cpp */ +/* collision_solver_3d_sat.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/collision_solver_3d_sat.h b/servers/physics_3d/collision_solver_3d_sat.h index ed564395ab..c8ffd8e660 100644 --- a/servers/physics_3d/collision_solver_3d_sat.h +++ b/servers/physics_3d/collision_solver_3d_sat.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_solver_sat.h */ +/* collision_solver_3d_sat.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/collision_solver_3d_sw.cpp b/servers/physics_3d/collision_solver_3d_sw.cpp index 34ea836cd0..26de49c96f 100644 --- a/servers/physics_3d/collision_solver_3d_sw.cpp +++ b/servers/physics_3d/collision_solver_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_solver_sw.cpp */ +/* collision_solver_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/collision_solver_3d_sw.h b/servers/physics_3d/collision_solver_3d_sw.h index 5f60d94e7f..ec76a4217e 100644 --- a/servers/physics_3d/collision_solver_3d_sw.h +++ b/servers/physics_3d/collision_solver_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_solver_sw.h */ +/* collision_solver_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/constraint_3d_sw.h b/servers/physics_3d/constraint_3d_sw.h index 23bc5d3b32..b9d3ac4f12 100644 --- a/servers/physics_3d/constraint_3d_sw.h +++ b/servers/physics_3d/constraint_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* constraint_sw.h */ +/* constraint_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp b/servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp index 782e8322fe..a072c1f3a0 100644 --- a/servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp +++ b/servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* cone_twist_joint_sw.cpp */ +/* cone_twist_joint_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/cone_twist_joint_3d_sw.h b/servers/physics_3d/joints/cone_twist_joint_3d_sw.h index 5521419e89..c713d8cf17 100644 --- a/servers/physics_3d/joints/cone_twist_joint_3d_sw.h +++ b/servers/physics_3d/joints/cone_twist_joint_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* cone_twist_joint_sw.h */ +/* cone_twist_joint_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp index d28fafdb00..1f433ec6a5 100644 --- a/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp +++ b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* generic_6dof_joint_sw.cpp */ +/* generic_6dof_joint_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/generic_6dof_joint_3d_sw.h b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.h index ba6e6ffb01..f7aa607901 100644 --- a/servers/physics_3d/joints/generic_6dof_joint_3d_sw.h +++ b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* generic_6dof_joint_sw.h */ +/* generic_6dof_joint_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/hinge_joint_3d_sw.cpp b/servers/physics_3d/joints/hinge_joint_3d_sw.cpp index 57605aac7b..e76d366422 100644 --- a/servers/physics_3d/joints/hinge_joint_3d_sw.cpp +++ b/servers/physics_3d/joints/hinge_joint_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* hinge_joint_sw.cpp */ +/* hinge_joint_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/hinge_joint_3d_sw.h b/servers/physics_3d/joints/hinge_joint_3d_sw.h index 8da32885bc..eebead20b8 100644 --- a/servers/physics_3d/joints/hinge_joint_3d_sw.h +++ b/servers/physics_3d/joints/hinge_joint_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* hinge_joint_sw.h */ +/* hinge_joint_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/jacobian_entry_3d_sw.h b/servers/physics_3d/joints/jacobian_entry_3d_sw.h index e298d40d8d..7e605ab173 100644 --- a/servers/physics_3d/joints/jacobian_entry_3d_sw.h +++ b/servers/physics_3d/joints/jacobian_entry_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* jacobian_entry_sw.h */ +/* jacobian_entry_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/pin_joint_3d_sw.cpp b/servers/physics_3d/joints/pin_joint_3d_sw.cpp index 67f2d78d54..95c01bc463 100644 --- a/servers/physics_3d/joints/pin_joint_3d_sw.cpp +++ b/servers/physics_3d/joints/pin_joint_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* pin_joint_sw.cpp */ +/* pin_joint_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/pin_joint_3d_sw.h b/servers/physics_3d/joints/pin_joint_3d_sw.h index 25876327a3..8e81ccf5e0 100644 --- a/servers/physics_3d/joints/pin_joint_3d_sw.h +++ b/servers/physics_3d/joints/pin_joint_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* pin_joint_sw.h */ +/* pin_joint_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/slider_joint_3d_sw.cpp b/servers/physics_3d/joints/slider_joint_3d_sw.cpp index 01336e2d7c..066c30e0f3 100644 --- a/servers/physics_3d/joints/slider_joint_3d_sw.cpp +++ b/servers/physics_3d/joints/slider_joint_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* slider_joint_sw.cpp */ +/* slider_joint_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints/slider_joint_3d_sw.h b/servers/physics_3d/joints/slider_joint_3d_sw.h index a70ba2597d..18287db9c2 100644 --- a/servers/physics_3d/joints/slider_joint_3d_sw.h +++ b/servers/physics_3d/joints/slider_joint_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* slider_joint_sw.h */ +/* slider_joint_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/joints_3d_sw.h b/servers/physics_3d/joints_3d_sw.h index 097aeb22b9..435ee2301d 100644 --- a/servers/physics_3d/joints_3d_sw.h +++ b/servers/physics_3d/joints_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* joints_sw.h */ +/* joints_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/physics_server_3d_sw.cpp b/servers/physics_3d/physics_server_3d_sw.cpp index 27fcedc45f..da84630088 100644 --- a/servers/physics_3d/physics_server_3d_sw.cpp +++ b/servers/physics_3d/physics_server_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_server_sw.cpp */ +/* physics_server_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/physics_server_3d_sw.h b/servers/physics_3d/physics_server_3d_sw.h index 7f0cd0ba9f..67123084c1 100644 --- a/servers/physics_3d/physics_server_3d_sw.h +++ b/servers/physics_3d/physics_server_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_server_sw.h */ +/* physics_server_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/shape_3d_sw.cpp b/servers/physics_3d/shape_3d_sw.cpp index 53b162636e..52253d615a 100644 --- a/servers/physics_3d/shape_3d_sw.cpp +++ b/servers/physics_3d/shape_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* shape_sw.cpp */ +/* shape_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/shape_3d_sw.h b/servers/physics_3d/shape_3d_sw.h index f10bd0771b..dd29ec849b 100644 --- a/servers/physics_3d/shape_3d_sw.h +++ b/servers/physics_3d/shape_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* shape_sw.h */ +/* shape_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/space_3d_sw.cpp b/servers/physics_3d/space_3d_sw.cpp index e7b2c7bfd7..9bd507e178 100644 --- a/servers/physics_3d/space_3d_sw.cpp +++ b/servers/physics_3d/space_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* space_sw.cpp */ +/* space_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/space_3d_sw.h b/servers/physics_3d/space_3d_sw.h index c32af5c5d4..fb4fb6aa1f 100644 --- a/servers/physics_3d/space_3d_sw.h +++ b/servers/physics_3d/space_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* space_sw.h */ +/* space_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/step_3d_sw.cpp b/servers/physics_3d/step_3d_sw.cpp index ef9015a61c..dda88b45c6 100644 --- a/servers/physics_3d/step_3d_sw.cpp +++ b/servers/physics_3d/step_3d_sw.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* step_sw.cpp */ +/* step_3d_sw.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_3d/step_3d_sw.h b/servers/physics_3d/step_3d_sw.h index dcd67fa122..c735688a9e 100644 --- a/servers/physics_3d/step_3d_sw.h +++ b/servers/physics_3d/step_3d_sw.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* step_sw.h */ +/* step_3d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index d80a51ca36..11fa2acc1a 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_2d_server.cpp */ +/* physics_server_2d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -458,56 +458,56 @@ void PhysicsShapeQueryResult2D::_bind_methods() { /////////////////////////////// -Vector2 Physics2DTestMotionResult::get_motion() const { +Vector2 PhysicsTestMotionResult2D::get_motion() const { return result.motion; } -Vector2 Physics2DTestMotionResult::get_motion_remainder() const { +Vector2 PhysicsTestMotionResult2D::get_motion_remainder() const { return result.remainder; } -Vector2 Physics2DTestMotionResult::get_collision_point() const { +Vector2 PhysicsTestMotionResult2D::get_collision_point() const { return result.collision_point; } -Vector2 Physics2DTestMotionResult::get_collision_normal() const { +Vector2 PhysicsTestMotionResult2D::get_collision_normal() const { return result.collision_normal; } -Vector2 Physics2DTestMotionResult::get_collider_velocity() const { +Vector2 PhysicsTestMotionResult2D::get_collider_velocity() const { return result.collider_velocity; } -ObjectID Physics2DTestMotionResult::get_collider_id() const { +ObjectID PhysicsTestMotionResult2D::get_collider_id() const { return result.collider_id; } -RID Physics2DTestMotionResult::get_collider_rid() const { +RID PhysicsTestMotionResult2D::get_collider_rid() const { return result.collider; } -Object *Physics2DTestMotionResult::get_collider() const { +Object *PhysicsTestMotionResult2D::get_collider() const { return ObjectDB::get_instance(result.collider_id); } -int Physics2DTestMotionResult::get_collider_shape() const { +int PhysicsTestMotionResult2D::get_collider_shape() const { return result.collider_shape; } -void Physics2DTestMotionResult::_bind_methods() { +void PhysicsTestMotionResult2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_motion"), &Physics2DTestMotionResult::get_motion); - ClassDB::bind_method(D_METHOD("get_motion_remainder"), &Physics2DTestMotionResult::get_motion_remainder); - ClassDB::bind_method(D_METHOD("get_collision_point"), &Physics2DTestMotionResult::get_collision_point); - ClassDB::bind_method(D_METHOD("get_collision_normal"), &Physics2DTestMotionResult::get_collision_normal); - ClassDB::bind_method(D_METHOD("get_collider_velocity"), &Physics2DTestMotionResult::get_collider_velocity); - ClassDB::bind_method(D_METHOD("get_collider_id"), &Physics2DTestMotionResult::get_collider_id); - ClassDB::bind_method(D_METHOD("get_collider_rid"), &Physics2DTestMotionResult::get_collider_rid); - ClassDB::bind_method(D_METHOD("get_collider"), &Physics2DTestMotionResult::get_collider); - ClassDB::bind_method(D_METHOD("get_collider_shape"), &Physics2DTestMotionResult::get_collider_shape); + ClassDB::bind_method(D_METHOD("get_motion"), &PhysicsTestMotionResult2D::get_motion); + ClassDB::bind_method(D_METHOD("get_motion_remainder"), &PhysicsTestMotionResult2D::get_motion_remainder); + ClassDB::bind_method(D_METHOD("get_collision_point"), &PhysicsTestMotionResult2D::get_collision_point); + ClassDB::bind_method(D_METHOD("get_collision_normal"), &PhysicsTestMotionResult2D::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collider_velocity"), &PhysicsTestMotionResult2D::get_collider_velocity); + ClassDB::bind_method(D_METHOD("get_collider_id"), &PhysicsTestMotionResult2D::get_collider_id); + ClassDB::bind_method(D_METHOD("get_collider_rid"), &PhysicsTestMotionResult2D::get_collider_rid); + ClassDB::bind_method(D_METHOD("get_collider"), &PhysicsTestMotionResult2D::get_collider); + ClassDB::bind_method(D_METHOD("get_collider_shape"), &PhysicsTestMotionResult2D::get_collider_shape); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "motion"), "", "get_motion"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "motion_remainder"), "", "get_motion_remainder"); @@ -520,7 +520,7 @@ void Physics2DTestMotionResult::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_shape"), "", "get_collider_shape"); } -Physics2DTestMotionResult::Physics2DTestMotionResult() { +PhysicsTestMotionResult2D::PhysicsTestMotionResult2D() { colliding = false; @@ -529,7 +529,7 @@ Physics2DTestMotionResult::Physics2DTestMotionResult() { /////////////////////////////////////// -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) { +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<PhysicsTestMotionResult2D> &p_result) { MotionResult *r = NULL; if (p_result.is_valid()) diff --git a/servers/physics_server_2d.h b/servers/physics_server_2d.h index 9fa3a7b71a..632371565c 100644 --- a/servers/physics_server_2d.h +++ b/servers/physics_server_2d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_2d_server.h */ +/* physics_server_2d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -227,7 +227,7 @@ public: PhysicsShapeQueryResult2D(); }; -class Physics2DTestMotionResult; +class PhysicsTestMotionResult2D; class PhysicsServer2D : public Object { @@ -235,7 +235,7 @@ class PhysicsServer2D : public Object { 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>()); + 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<PhysicsTestMotionResult2D> &p_result = Ref<PhysicsTestMotionResult2D>()); protected: static void _bind_methods(); @@ -606,9 +606,9 @@ public: ~PhysicsServer2D(); }; -class Physics2DTestMotionResult : public Reference { +class PhysicsTestMotionResult2D : public Reference { - GDCLASS(Physics2DTestMotionResult, Reference); + GDCLASS(PhysicsTestMotionResult2D, Reference); PhysicsServer2D::MotionResult result; bool colliding; @@ -632,7 +632,7 @@ public: Object *get_collider() const; int get_collider_shape() const; - Physics2DTestMotionResult(); + PhysicsTestMotionResult2D(); }; typedef PhysicsServer2D *(*CreatePhysicsServer2DCallback)(); diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index ddc96d2722..0ee471231b 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_server.cpp */ +/* physics_server_3d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index 9bb7bfe3f4..ddef8a9b20 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physics_server.h */ +/* physics_server_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index fa2a5f23dd..c53ffcc7b5 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -70,7 +70,7 @@ ShaderTypes *shader_types = NULL; -PhysicsServer3D *_createGodotPhysicsCallback() { +PhysicsServer3D *_createGodotPhysics3DCallback() { return memnew(PhysicsServer3DSW); } @@ -162,7 +162,7 @@ void register_server_types() { ClassDB::register_virtual_class<PhysicsDirectBodyState2D>(); ClassDB::register_virtual_class<PhysicsDirectSpaceState2D>(); ClassDB::register_virtual_class<PhysicsShapeQueryResult2D>(); - ClassDB::register_class<Physics2DTestMotionResult>(); + ClassDB::register_class<PhysicsTestMotionResult2D>(); ClassDB::register_class<PhysicsShapeQueryParameters2D>(); ClassDB::register_class<PhysicsShapeQueryParameters3D>(); @@ -181,7 +181,7 @@ void register_server_types() { 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")); - PhysicsServer3DManager::register_server("GodotPhysics", &_createGodotPhysicsCallback); + PhysicsServer3DManager::register_server("GodotPhysics", &_createGodotPhysics3DCallback); PhysicsServer3DManager::set_default_server("GodotPhysics"); } diff --git a/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp index cc94815152..9ccc1f172e 100644 --- a/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp +++ b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp @@ -29,9 +29,11 @@ /*************************************************************************/ #include "rasterizer_effects_rd.h" + #include "core/os/os.h" #include "core/project_settings.h" -#include "cubemap_coeffs.h" + +#include "thirdparty/misc/cubemap_coeffs.h" static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_basis, float *p_array) { p_array[0] = p_basis.elements[0][0]; diff --git a/servers/rendering/rendering_server_canvas.cpp b/servers/rendering/rendering_server_canvas.cpp index 7b28c586b9..261bd4c275 100644 --- a/servers/rendering/rendering_server_canvas.cpp +++ b/servers/rendering/rendering_server_canvas.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_canvas.cpp */ +/* rendering_server_canvas.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_canvas.h b/servers/rendering/rendering_server_canvas.h index 579bcd36e7..c79b74f287 100644 --- a/servers/rendering/rendering_server_canvas.h +++ b/servers/rendering/rendering_server_canvas.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_canvas.h */ +/* rendering_server_canvas.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_globals.cpp b/servers/rendering/rendering_server_globals.cpp index 60183956e0..251cf64184 100644 --- a/servers/rendering/rendering_server_globals.cpp +++ b/servers/rendering/rendering_server_globals.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_globals.cpp */ +/* rendering_server_globals.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_globals.h b/servers/rendering/rendering_server_globals.h index 79abc55fea..b33f328b69 100644 --- a/servers/rendering/rendering_server_globals.h +++ b/servers/rendering/rendering_server_globals.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_globals.h */ +/* rendering_server_globals.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_raster.cpp b/servers/rendering/rendering_server_raster.cpp index 9b769b46fc..7cc06527e4 100644 --- a/servers/rendering/rendering_server_raster.cpp +++ b/servers/rendering/rendering_server_raster.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_raster.cpp */ +/* rendering_server_raster.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_raster.h b/servers/rendering/rendering_server_raster.h index 24fbe4577a..d69968868e 100644 --- a/servers/rendering/rendering_server_raster.h +++ b/servers/rendering/rendering_server_raster.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_raster.h */ +/* rendering_server_raster.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_scene.cpp b/servers/rendering/rendering_server_scene.cpp index 0530846e95..04e4b8dace 100644 --- a/servers/rendering/rendering_server_scene.cpp +++ b/servers/rendering/rendering_server_scene.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_scene.cpp */ +/* rendering_server_scene.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_scene.h b/servers/rendering/rendering_server_scene.h index 6012a75660..9e09136216 100644 --- a/servers/rendering/rendering_server_scene.h +++ b/servers/rendering/rendering_server_scene.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_scene.h */ +/* rendering_server_scene.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_viewport.cpp b/servers/rendering/rendering_server_viewport.cpp index 24b2379d97..f80b914760 100644 --- a/servers/rendering/rendering_server_viewport.cpp +++ b/servers/rendering/rendering_server_viewport.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_viewport.cpp */ +/* rendering_server_viewport.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_viewport.h b/servers/rendering/rendering_server_viewport.h index 4ae7a7f536..f574c58d96 100644 --- a/servers/rendering/rendering_server_viewport.h +++ b/servers/rendering/rendering_server_viewport.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_viewport.h */ +/* rendering_server_viewport.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_wrap_mt.cpp b/servers/rendering/rendering_server_wrap_mt.cpp index d1bb7b67c6..5d6d523901 100644 --- a/servers/rendering/rendering_server_wrap_mt.cpp +++ b/servers/rendering/rendering_server_wrap_mt.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_wrap_mt.cpp */ +/* rendering_server_wrap_mt.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering/rendering_server_wrap_mt.h b/servers/rendering/rendering_server_wrap_mt.h index 4d449ea913..ee4065094b 100644 --- a/servers/rendering/rendering_server_wrap_mt.h +++ b/servers/rendering/rendering_server_wrap_mt.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server_wrap_mt.h */ +/* rendering_server_wrap_mt.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 0c5b9a258f..084b8f7952 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server.cpp */ +/* rendering_server.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 92820aca21..76f16bd7f6 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rendering_server.h */ +/* rendering_server.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/thirdparty/README.md b/thirdparty/README.md index b52b68fe47..3d41c9d166 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -360,6 +360,10 @@ Collection of single-file libraries used in Godot components. * Upstream: https://sourceforge.net/projects/polyclipping * Version: 6.4.2 + Godot changes (added optional exceptions handling) * License: BSL-1.0 +- `cubemap_coeffs.h` + * Upstream: https://research.activision.com/publications/archives/fast-filtering-of-reflection-probes + File coeffs_const_8.txt + * License: MIT - `fastlz.{c,h}` * Upstream: https://github.com/ariya/FastLZ * Version: git (f121734, 2007) diff --git a/servers/rendering/rasterizer_rd/cubemap_coeffs.h b/thirdparty/misc/cubemap_coeffs.h index 1db03ce7c4..1db03ce7c4 100644 --- a/servers/rendering/rasterizer_rd/cubemap_coeffs.h +++ b/thirdparty/misc/cubemap_coeffs.h |