1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #12756 from Stratos695/master

Allowing double-axis lock in RigidBody & KinematicBody (Fixes #12500)
This commit is contained in:
Rémi Verschelde
2017-12-09 13:01:41 +01:00
committed by GitHub
12 changed files with 155 additions and 109 deletions

View File

@@ -723,15 +723,15 @@ void BulletPhysicsServer::body_set_axis_velocity(RID p_body, const Vector3 &p_ax
body->set_linear_velocity(v);
}
void BulletPhysicsServer::body_set_axis_lock(RID p_body, PhysicsServer::BodyAxisLock p_lock) {
void BulletPhysicsServer::body_set_axis_lock(RID p_body, int axis, bool p_lock) {
RigidBodyBullet *body = rigid_body_owner.get(p_body);
ERR_FAIL_COND(!body);
body->set_axis_lock(p_lock);
body->set_axis_lock(axis, p_lock);
}
PhysicsServer::BodyAxisLock BulletPhysicsServer::body_get_axis_lock(RID p_body) const {
bool BulletPhysicsServer::body_get_axis_lock(RID p_body) const {
const RigidBodyBullet *body = rigid_body_owner.get(p_body);
ERR_FAIL_COND_V(!body, BODY_AXIS_LOCK_DISABLED);
ERR_FAIL_COND_V(!body, 0);
return body->get_axis_lock();
}