|
@@ -35,6 +35,7 @@
|
|
|
void PhysicsBody3D::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("move_and_collide", "motion", "test_only", "safe_margin", "recovery_as_collision", "max_collisions"), &PhysicsBody3D::_move, DEFVAL(false), DEFVAL(0.001), DEFVAL(false), DEFVAL(1));
|
|
|
ClassDB::bind_method(D_METHOD("test_move", "from", "motion", "collision", "safe_margin", "recovery_as_collision", "max_collisions"), &PhysicsBody3D::test_move, DEFVAL(Variant()), DEFVAL(0.001), DEFVAL(false), DEFVAL(1));
|
|
|
+ ClassDB::bind_method(D_METHOD("get_gravity"), &PhysicsBody3D::get_gravity);
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("set_axis_lock", "axis", "lock"), &PhysicsBody3D::set_axis_lock);
|
|
|
ClassDB::bind_method(D_METHOD("get_axis_lock", "axis"), &PhysicsBody3D::get_axis_lock);
|
|
@@ -186,6 +187,10 @@ bool PhysicsBody3D::test_move(const Transform3D &p_from, const Vector3 &p_motion
|
|
|
return PhysicsServer3D::get_singleton()->body_test_motion(get_rid(), parameters, r);
|
|
|
}
|
|
|
|
|
|
+Vector3 PhysicsBody3D::get_gravity() const {
|
|
|
+ return PhysicsServer3D::get_singleton()->body_get_direct_state(get_rid())->get_total_gravity();
|
|
|
+}
|
|
|
+
|
|
|
void PhysicsBody3D::set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool p_lock) {
|
|
|
if (p_lock) {
|
|
|
locked_axis |= p_axis;
|