summaryrefslogtreecommitdiff
path: root/modules/bullet/rigid_body_bullet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bullet/rigid_body_bullet.cpp')
-rw-r--r--modules/bullet/rigid_body_bullet.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index ce39d4f0df..0d2cd1f5a0 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -114,6 +114,16 @@ Transform3D BulletPhysicsDirectBodyState3D::get_transform() const {
return body->get_transform();
}
+Vector3 BulletPhysicsDirectBodyState3D::get_velocity_at_local_position(const Vector3 &p_position) const {
+ btVector3 local_position;
+ G_TO_B(p_position, local_position);
+
+ Vector3 velocity;
+ B_TO_G(body->btBody->getVelocityInLocalPoint(local_position), velocity);
+
+ return velocity;
+}
+
void BulletPhysicsDirectBodyState3D::add_central_force(const Vector3 &p_force) {
body->apply_central_force(p_force);
}