summaryrefslogtreecommitdiff
path: root/modules/bullet/godot_result_callbacks.cpp
diff options
context:
space:
mode:
authorAndrea Catania <info@andreacatania.com>2018-02-16 19:06:00 +0100
committerAndrea Catania <info@andreacatania.com>2018-02-20 12:43:47 +0100
commit6ed392f47a1970f7815f6f76b7bacfd0bb51b87c (patch)
treee380ae9cc66729978344ba74a62b9546439cbdf7 /modules/bullet/godot_result_callbacks.cpp
parentda612c324cec8c4f6bfcef9b35406ea215e699f6 (diff)
Improved kinematic body 2D and 3D, Now can move rigid body
Diffstat (limited to 'modules/bullet/godot_result_callbacks.cpp')
-rw-r--r--modules/bullet/godot_result_callbacks.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp
index 8d4ca6d6a7..7c051f8f17 100644
--- a/modules/bullet/godot_result_callbacks.cpp
+++ b/modules/bullet/godot_result_callbacks.cpp
@@ -98,11 +98,16 @@ bool GodotKinClosestConvexResultCallback::needsCollision(btBroadphaseProxy *prox
if (gObj == m_self_object) {
return false;
} else {
- if (m_ignore_areas && gObj->getType() == CollisionObjectBullet::TYPE_AREA) {
+
+ // A kinematic body can't be stopped by a rigid body since the mass of kinematic body is infinite
+ if (m_infinite_inertia && !btObj->isStaticOrKinematicObject())
+ return false;
+
+ if (gObj->getType() == CollisionObjectBullet::TYPE_AREA)
return false;
- } else if (m_self_object->has_collision_exception(gObj)) {
+
+ if (m_self_object->has_collision_exception(gObj))
return false;
- }
}
return true;
} else {