summaryrefslogtreecommitdiffstats
path: root/modules/bullet/space_bullet.h
diff options
context:
space:
mode:
authorAndreaCatania <info@andreacatania.com>2017-12-23 18:23:12 +0100
committerAndreaCatania <info@andreacatania.com>2017-12-23 18:23:12 +0100
commitf4b96cc0a97f1f9edd127920ff5995a75c2e6624 (patch)
tree967edcc3de0aa560ea4d02ad302be5b8d9f60fbd /modules/bullet/space_bullet.h
parent8d13753e9171e2f525d7778b24a911bf60346aa2 (diff)
downloadredot-engine-f4b96cc0a97f1f9edd127920ff5995a75c2e6624.tar.gz
Fixed kinematic movement stuck, Changed how shape scale works, Optimized
Diffstat (limited to 'modules/bullet/space_bullet.h')
-rw-r--r--modules/bullet/space_bullet.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h
index e5267c01a9..5bc922f43c 100644
--- a/modules/bullet/space_bullet.h
+++ b/modules/bullet/space_bullet.h
@@ -178,23 +178,24 @@ private:
struct RecoverResult {
bool hasPenetration;
- btVector3 pointNormalWorld;
+ btVector3 normal;
btVector3 pointWorld;
- btScalar penetration_distance; // Negative is penetration
+ btScalar penetration_distance; // Negative mean penetration
int other_compound_shape_index;
const btCollisionObject *other_collision_object;
int local_shape_most_recovered;
RecoverResult() :
- hasPenetration(false) {}
+ hasPenetration(false),
+ penetration_distance(1e20) {}
};
- bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);
+ bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btScalar p_recover_movement_scale, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);
/// This is an API that recover a kinematic object from penetration
/// This allow only Convex Convex test and it always use GJK algorithm, With this API we don't benefit of Bullet special accelerated functions
- bool RFP_convex_convex_test(const btConvexShape *p_shapeA, const btConvexShape *p_shapeB, btCollisionObject *p_objectB, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btVector3 &r_recover_position, RecoverResult *r_recover_result);
+ bool RFP_convex_convex_test(const btConvexShape *p_shapeA, const btConvexShape *p_shapeB, btCollisionObject *p_objectB, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_movement_scale, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);
/// This is an API that recover a kinematic object from penetration
/// Using this we leave Bullet to select the best algorithm, For example GJK in case we have Convex Convex, or a Bullet accelerated algorithm
- bool RFP_convex_world_test(const btConvexShape *p_shapeA, const btCollisionShape *p_shapeB, btCollisionObject *p_objectA, btCollisionObject *p_objectB, int p_shapeId_A, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btVector3 &r_recover_position, RecoverResult *r_recover_result);
+ bool RFP_convex_world_test(const btConvexShape *p_shapeA, const btCollisionShape *p_shapeB, btCollisionObject *p_objectA, btCollisionObject *p_objectB, int p_shapeId_A, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_movement_scale, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);
};
#endif