More server renames for consistency after #37361
This commit is contained in:
parent
bbbdabc771
commit
0c320a6bf3
|
@ -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,16 +81,16 @@ MainLoop *test_main(String p_test, const List<String> &p_args) {
|
|||
return TestMath::test();
|
||||
}
|
||||
|
||||
if (p_test == "physics") {
|
||||
|
||||
return TestPhysics::test();
|
||||
}
|
||||
|
||||
if (p_test == "physics_2d") {
|
||||
|
||||
return TestPhysics2D::test();
|
||||
}
|
||||
|
||||
if (p_test == "physics_3d") {
|
||||
|
||||
return TestPhysics3D::test();
|
||||
}
|
||||
|
||||
if (p_test == "render") {
|
||||
|
||||
return TestRender::test();
|
||||
|
|
|
@ -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
|
|
@ -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();
|
||||
}
|
|
@ -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())
|
||||
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_2d_server.cpp */
|
||||
/* navigation_server_2d.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_2d_server.h */
|
||||
/* navigation_server_2d.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_server.cpp */
|
||||
/* navigation_server_3d.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_server.h */
|
||||
/* navigation_server_3d.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* physics_2d_server_wrap_mt.cpp */
|
||||
/* physics_server_2d_wrap_mt.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* physics_2d_server_wrap_mt.h */
|
||||
/* physics_server_2d_wrap_mt.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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]; }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* area_sw.cpp */
|
||||
/* area_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* area_sw.h */
|
||||
/* area_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* area_pair_sw.cpp */
|
||||
/* area_pair_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* area_pair_sw.h */
|
||||
/* area_pair_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* body_sw.cpp */
|
||||
/* body_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* body_sw.h */
|
||||
/* body_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* body_pair_sw.cpp */
|
||||
/* body_pair_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* body_pair_sw.h */
|
||||
/* body_pair_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* broad_phase_basic.cpp */
|
||||
/* broad_phase_3d_basic.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* broad_phase_basic.h */
|
||||
/* broad_phase_3d_basic.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* broad_phase_sw.cpp */
|
||||
/* broad_phase_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* broad_phase_sw.h */
|
||||
/* broad_phase_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* collision_object_sw.cpp */
|
||||
/* collision_object_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* collision_object_sw.h */
|
||||
/* collision_object_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* collision_solver_sat.cpp */
|
||||
/* collision_solver_3d_sat.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* collision_solver_sat.h */
|
||||
/* collision_solver_3d_sat.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* collision_solver_sw.cpp */
|
||||
/* collision_solver_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* collision_solver_sw.h */
|
||||
/* collision_solver_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* constraint_sw.h */
|
||||
/* constraint_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* cone_twist_joint_sw.cpp */
|
||||
/* cone_twist_joint_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* cone_twist_joint_sw.h */
|
||||
/* cone_twist_joint_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* generic_6dof_joint_sw.cpp */
|
||||
/* generic_6dof_joint_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* generic_6dof_joint_sw.h */
|
||||
/* generic_6dof_joint_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* hinge_joint_sw.cpp */
|
||||
/* hinge_joint_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* hinge_joint_sw.h */
|
||||
/* hinge_joint_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* jacobian_entry_sw.h */
|
||||
/* jacobian_entry_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* pin_joint_sw.cpp */
|
||||
/* pin_joint_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* pin_joint_sw.h */
|
||||
/* pin_joint_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* slider_joint_sw.cpp */
|
||||
/* slider_joint_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* slider_joint_sw.h */
|
||||
/* slider_joint_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* joints_sw.h */
|
||||
/* joints_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* physics_server_sw.cpp */
|
||||
/* physics_server_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* physics_server_sw.h */
|
||||
/* physics_server_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* shape_sw.cpp */
|
||||
/* shape_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* shape_sw.h */
|
||||
/* shape_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* space_sw.cpp */
|
||||
/* space_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* space_sw.h */
|
||||
/* space_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* step_sw.cpp */
|
||||
/* step_3d_sw.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* step_sw.h */
|
||||
/* step_3d_sw.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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)();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* physics_server.cpp */
|
||||
/* physics_server_3d.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* physics_server.h */
|
||||
/* physics_server_3d.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue