diff options
Diffstat (limited to 'servers/physics_server_2d.h')
-rw-r--r-- | servers/physics_server_2d.h | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/servers/physics_server_2d.h b/servers/physics_server_2d.h index 632371565c..549a78aa1f 100644 --- a/servers/physics_server_2d.h +++ b/servers/physics_server_2d.h @@ -38,7 +38,6 @@ class PhysicsDirectSpaceState2D; class PhysicsDirectBodyState2D : public Object { - GDCLASS(PhysicsDirectBodyState2D, Object); protected: @@ -97,7 +96,6 @@ class PhysicsShapeQueryResult2D; //used for script class PhysicsShapeQueryParameters2D : public Reference { - GDCLASS(PhysicsShapeQueryParameters2D, Reference); friend class PhysicsDirectSpaceState2D; RID shape; @@ -143,7 +141,6 @@ public: }; class PhysicsDirectSpaceState2D : public Object { - GDCLASS(PhysicsDirectSpaceState2D, Object); Dictionary _intersect_ray(const Vector2 &p_from, const Vector2 &p_to, const Vector<RID> &p_exclude = Vector<RID>(), uint32_t p_layers = 0, bool p_collide_with_bodies = true, bool p_collide_with_areas = false); @@ -160,7 +157,6 @@ protected: public: struct RayResult { - Vector2 position; Vector2 normal; RID rid; @@ -173,7 +169,6 @@ public: virtual bool intersect_ray(const Vector2 &p_from, const Vector2 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false) = 0; struct ShapeResult { - RID rid; ObjectID collider_id; Object *collider; @@ -191,7 +186,6 @@ public: virtual bool collide_shape(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, float p_margin, Vector2 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false) = 0; struct ShapeRestInfo { - Vector2 point; Vector2 normal; RID rid; @@ -207,7 +201,6 @@ public: }; class PhysicsShapeQueryResult2D : public Reference { - GDCLASS(PhysicsShapeQueryResult2D, Reference); Vector<PhysicsDirectSpaceState2D::ShapeResult> result; @@ -230,7 +223,6 @@ public: class PhysicsTestMotionResult2D; class PhysicsServer2D : public Object { - GDCLASS(PhysicsServer2D, Object); static PhysicsServer2D *singleton; @@ -493,7 +485,6 @@ public: virtual PhysicsDirectBodyState2D *body_get_direct_state(RID p_body) = 0; struct MotionResult { - Vector2 motion; Vector2 remainder; @@ -513,10 +504,9 @@ public: } }; - virtual bool body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, float p_margin = 0.001, MotionResult *r_result = NULL, bool p_exclude_raycast_shapes = true) = 0; + virtual bool body_test_motion(RID p_body, const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia, float p_margin = 0.001, MotionResult *r_result = nullptr, bool p_exclude_raycast_shapes = true) = 0; struct SeparationResult { - float collision_depth; Vector2 collision_point; Vector2 collision_normal; @@ -562,13 +552,13 @@ public: virtual void pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) = 0; virtual real_t pin_joint_get_param(RID p_joint, PinJointParam p_param) const = 0; - enum DampedStringParam { - DAMPED_STRING_REST_LENGTH, - DAMPED_STRING_STIFFNESS, - DAMPED_STRING_DAMPING + enum DampedSpringParam { + DAMPED_SPRING_REST_LENGTH, + DAMPED_SPRING_STIFFNESS, + DAMPED_SPRING_DAMPING }; - virtual void damped_string_joint_set_param(RID p_joint, DampedStringParam p_param, real_t p_value) = 0; - virtual real_t damped_string_joint_get_param(RID p_joint, DampedStringParam p_param) const = 0; + virtual void damped_spring_joint_set_param(RID p_joint, DampedSpringParam p_param, real_t p_value) = 0; + virtual real_t damped_spring_joint_get_param(RID p_joint, DampedSpringParam p_param) const = 0; virtual JointType joint_get_type(RID p_joint) const = 0; @@ -607,7 +597,6 @@ public: }; class PhysicsTestMotionResult2D : public Reference { - GDCLASS(PhysicsTestMotionResult2D, Reference); PhysicsServer2D::MotionResult result; @@ -640,11 +629,9 @@ typedef PhysicsServer2D *(*CreatePhysicsServer2DCallback)(); class PhysicsServer2DManager { struct ClassInfo { String name; - CreatePhysicsServer2DCallback create_callback; + CreatePhysicsServer2DCallback create_callback = nullptr; - ClassInfo() : - name(""), - create_callback(NULL) {} + ClassInfo() {} ClassInfo(String p_name, CreatePhysicsServer2DCallback p_create_callback) : name(p_name), @@ -691,7 +678,7 @@ VARIANT_ENUM_CAST(PhysicsServer2D::BodyState); VARIANT_ENUM_CAST(PhysicsServer2D::CCDMode); VARIANT_ENUM_CAST(PhysicsServer2D::JointParam); VARIANT_ENUM_CAST(PhysicsServer2D::JointType); -VARIANT_ENUM_CAST(PhysicsServer2D::DampedStringParam); +VARIANT_ENUM_CAST(PhysicsServer2D::DampedSpringParam); //VARIANT_ENUM_CAST( PhysicsServer2D::ObjectType ); VARIANT_ENUM_CAST(PhysicsServer2D::AreaBodyStatus); VARIANT_ENUM_CAST(PhysicsServer2D::ProcessInfo); |