diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-09 16:08:58 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 16:08:58 -0300 |
commit | 50a9bd4e23e62579e2249de3c27624d6c56df1d0 (patch) | |
tree | a0595c5872054a9d4fe50bc5446cea5518b5f8b0 /modules/bullet/space_bullet.h | |
parent | 881defa209435816f52b08edfd876159592e830a (diff) | |
parent | 10f879bf883ed364a9b0eafe40aba03c59b6fbfb (diff) |
Merge pull request #12713 from AndreaCatania/master
Rewritten kinematic system
Diffstat (limited to 'modules/bullet/space_bullet.h')
-rw-r--r-- | modules/bullet/space_bullet.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index b36896650b..d9206f8046 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -59,6 +59,7 @@ class CollisionObjectBullet; class RigidBodyBullet; class SpaceBullet; class SoftBodyBullet; +class btGjkEpaPenetrationDepthSolver; class BulletPhysicsDirectSpaceState : public PhysicsDirectSpaceState { GDCLASS(BulletPhysicsDirectSpaceState, PhysicsDirectSpaceState) @@ -93,6 +94,9 @@ private: GodotFilterCallback *godotFilterCallback; btSoftBodyWorldInfo *soft_body_world_info; + btGjkEpaPenetrationDepthSolver *gjk_epa_pen_solver; + btVoronoiSimplexSolver *gjk_simplex_solver; + BulletPhysicsDirectSpaceState *direct_access; Vector3 gravityDirection; real_t gravityMagnitude; @@ -164,7 +168,7 @@ public: void update_gravity(); - bool test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, real_t p_margin, PhysicsServer::MotionResult *r_result); + bool test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, PhysicsServer::MotionResult *r_result); private: void create_empty_world(bool p_create_soft_world); @@ -172,6 +176,19 @@ private: void check_ghost_overlaps(); void check_body_collision(); - bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btScalar p_maxPenetrationDepth, btScalar p_depenetration_speed, btVector3 &out_recover_position); + struct RecoverResult { + bool hasPenetration; + btVector3 pointNormalWorld; + btVector3 pointWorld; + btScalar penetration_distance; // Negative is penetration + int other_compound_shape_index; + const btCollisionObject *other_collision_object; + int local_shape_most_recovered; + + RecoverResult() + : hasPenetration(false) {} + }; + + bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &out_recover_position, RecoverResult *recover_result = NULL); }; #endif |