diff options
author | Camille Mohr-Daurat <pouleyKetchoup@gmail.com> | 2021-11-08 18:44:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 18:44:51 -0700 |
commit | c6062cd93e2a7caaf2aa988863cc5535934c5d7c (patch) | |
tree | 29a382eee91ede7360e4f29da82f5f45f2f7d0f2 /servers/physics_server_2d.cpp | |
parent | 59686536622473e14b253268354ecfbae63d0d58 (diff) | |
parent | fc8c766ef93454e43a5a31fd7fb0a0b07946e32b (diff) | |
download | redot-engine-c6062cd93e2a7caaf2aa988863cc5535934c5d7c.tar.gz |
Merge pull request #54134 from nekomatata/body-center-of-mass-local
Expose local center of mass in physics servers
Diffstat (limited to 'servers/physics_server_2d.cpp')
-rw-r--r-- | servers/physics_server_2d.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index 466558c9db..fa89ccec65 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -78,6 +78,7 @@ void PhysicsDirectBodyState2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_total_angular_damp"), &PhysicsDirectBodyState2D::get_total_angular_damp); ClassDB::bind_method(D_METHOD("get_center_of_mass"), &PhysicsDirectBodyState2D::get_center_of_mass); + ClassDB::bind_method(D_METHOD("get_center_of_mass_local"), &PhysicsDirectBodyState2D::get_center_of_mass_local); ClassDB::bind_method(D_METHOD("get_inverse_mass"), &PhysicsDirectBodyState2D::get_inverse_mass); ClassDB::bind_method(D_METHOD("get_inverse_inertia"), &PhysicsDirectBodyState2D::get_inverse_inertia); @@ -124,6 +125,7 @@ void PhysicsDirectBodyState2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_linear_damp"), "", "get_total_linear_damp"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "total_gravity"), "", "get_total_gravity"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "center_of_mass"), "", "get_center_of_mass"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "center_of_mass_local"), "", "get_center_of_mass_local"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "linear_velocity"), "set_linear_velocity", "get_linear_velocity"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sleeping"), "set_sleep_state", "is_sleeping"); |