diff options
| author | AndreaCatania | 2017-12-10 17:21:14 +0100 |
|---|---|---|
| committer | AndreaCatania | 2017-12-10 17:21:14 +0100 |
| commit | 5dee44bbc13605348b65bc74878a5a8be2b50cbd (patch) | |
| tree | 18015df53d04b296c58702d5375c5c43cf0eab27 /servers/physics_server.h | |
| parent | a5b3c9cae010c98ec692bc08463cde25f8f9ac67 (diff) | |
| download | godot-5dee44bbc13605348b65bc74878a5a8be2b50cbd.tar.gz godot-5dee44bbc13605348b65bc74878a5a8be2b50cbd.tar.zst godot-5dee44bbc13605348b65bc74878a5a8be2b50cbd.zip | |
Implemented physics linear and angular lock
Diffstat (limited to '')
| -rw-r--r-- | servers/physics_server.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/servers/physics_server.h b/servers/physics_server.h index 66c3a0afc..341d02eb8 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -421,8 +421,17 @@ public: virtual void body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) = 0; virtual void body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) = 0; - virtual void body_set_axis_lock(RID p_body, int axis, bool lock) = 0; - virtual bool body_get_axis_lock(RID p_body) const = 0; + enum BodyAxis { + BODY_AXIS_LINEAR_X = 1 << 0, + BODY_AXIS_LINEAR_Y = 1 << 1, + BODY_AXIS_LINEAR_Z = 1 << 2, + BODY_AXIS_ANGULAR_X = 1 << 3, + BODY_AXIS_ANGULAR_Y = 1 << 4, + BODY_AXIS_ANGULAR_Z = 1 << 5 + }; + + virtual void body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) = 0; + virtual bool body_is_axis_locked(RID p_body, BodyAxis p_axis) const = 0; //fix virtual void body_add_collision_exception(RID p_body, RID p_body_b) = 0; @@ -685,6 +694,7 @@ VARIANT_ENUM_CAST(PhysicsServer::AreaSpaceOverrideMode); VARIANT_ENUM_CAST(PhysicsServer::BodyMode); VARIANT_ENUM_CAST(PhysicsServer::BodyParameter); VARIANT_ENUM_CAST(PhysicsServer::BodyState); +VARIANT_ENUM_CAST(PhysicsServer::BodyAxis); VARIANT_ENUM_CAST(PhysicsServer::PinJointParam); VARIANT_ENUM_CAST(PhysicsServer::JointType); VARIANT_ENUM_CAST(PhysicsServer::HingeJointParam); |
