From 10f879bf883ed364a9b0eafe40aba03c59b6fbfb Mon Sep 17 00:00:00 2001 From: AndreaCatania Date: Tue, 7 Nov 2017 15:22:09 +0100 Subject: Rewritten kinematic system --- modules/bullet/godot_result_callbacks.cpp | 47 ------------------------------- 1 file changed, 47 deletions(-) (limited to 'modules/bullet/godot_result_callbacks.cpp') diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp index 409d12f080..bc60c9cb6b 100644 --- a/modules/bullet/godot_result_callbacks.cpp +++ b/modules/bullet/godot_result_callbacks.cpp @@ -242,50 +242,3 @@ btScalar GodotRestInfoContactResultCallback::addSingleResult(btManifoldPoint &cp return cp.getDistance(); } - -bool GodotRecoverAndClosestContactResultCallback::needsCollision(btBroadphaseProxy *proxy0) const { - const bool needs = GodotFilterCallback::test_collision_filters(m_collisionFilterGroup, m_collisionFilterMask, proxy0->m_collisionFilterGroup, proxy0->m_collisionFilterMask); - if (needs) { - btCollisionObject *btObj = static_cast(proxy0->m_clientObject); - CollisionObjectBullet *gObj = static_cast(btObj->getUserPointer()); - if (gObj == m_self_object) { - return false; - } else { - if (m_ignore_areas && gObj->getType() == CollisionObjectBullet::TYPE_AREA) { - return false; - } else if (m_self_object->has_collision_exception(gObj)) { - return false; - } - } - return true; - } else { - return false; - } -} - -btScalar GodotRecoverAndClosestContactResultCallback::addSingleResult(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1) { - - if (cp.getDistance() < -MAX_PENETRATION_DEPTH) { - if (m_most_penetrated_distance > cp.getDistance()) { - m_most_penetrated_distance = cp.getDistance(); - - // take other object - btScalar sign(1); - if (m_self_object == colObj0Wrap->getCollisionObject()->getUserPointer()) { - m_pointCollisionObject = colObj1Wrap->getCollisionObject(); - m_other_compound_shape_index = cp.m_index1; - } else { - m_pointCollisionObject = colObj0Wrap->getCollisionObject(); - sign = -1; - m_other_compound_shape_index = cp.m_index0; - } - - m_pointNormalWorld = cp.m_normalWorldOnB * sign; - m_pointWorld = cp.getPositionWorldOnB(); - m_penetration_distance = cp.getDistance(); - - m_recover_penetration -= cp.m_normalWorldOnB * sign * (cp.getDistance() + MAX_PENETRATION_DEPTH); - } - } - return 1; -} -- cgit v1.2.3