diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-03-26 12:32:20 +0100 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-04-27 18:24:33 +0200 |
commit | 9353a2bbd161f99de5e6de6365b288bf19f910b6 (patch) | |
tree | 433d26be12c05ecd2e8858bd5caac2f814499d2d /modules/bullet/space_bullet.h | |
parent | f61587b158bd0eae6ea5b9d07e90983ff4988772 (diff) | |
download | redot-engine-9353a2bbd161f99de5e6de6365b288bf19f910b6.tar.gz |
Better damping implementation for Bullet rigid bodies
Apply old method for linear & angular damping in Bullet, in order to
make it easier to tweak and consistent with Godot Physics.
Diffstat (limited to 'modules/bullet/space_bullet.h')
-rw-r--r-- | modules/bullet/space_bullet.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index f9a8c063fd..3d4a2aeceb 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -108,6 +108,9 @@ class SpaceBullet : public RIDBullet { Vector3 gravityDirection; real_t gravityMagnitude; + real_t linear_damp; + real_t angular_damp; + Vector<AreaBullet *> areas; Vector<Vector3> contactDebug; @@ -177,6 +180,9 @@ public: void update_gravity(); + real_t get_linear_damp() const { return linear_damp; } + real_t get_angular_damp() const { return angular_damp; } + bool test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, PhysicsServer3D::MotionResult *r_result, bool p_exclude_raycast_shapes); int test_ray_separation(RigidBodyBullet *p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, PhysicsServer3D::SeparationResult *r_results, int p_result_max, float p_margin); |