mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 22:23:04 +00:00
Fixed intersect_shape crash, closes #13697
This commit is contained in:
parent
8d13753e91
commit
512c60f1d8
@ -142,6 +142,9 @@ bool GodotAllContactResultCallback::needsCollision(btBroadphaseProxy *proxy0) co
|
||||
|
||||
btScalar GodotAllContactResultCallback::addSingleResult(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1) {
|
||||
|
||||
if (m_count >= m_resultMax)
|
||||
return cp.getDistance();
|
||||
|
||||
if (cp.getDistance() <= 0) {
|
||||
|
||||
PhysicsDirectSpaceState::ShapeResult &result = m_results[m_count];
|
||||
@ -165,7 +168,7 @@ btScalar GodotAllContactResultCallback::addSingleResult(btManifoldPoint &cp, con
|
||||
++m_count;
|
||||
}
|
||||
|
||||
return m_count < m_resultMax;
|
||||
return cp.getDistance();
|
||||
}
|
||||
|
||||
bool GodotContactPairContactResultCallback::needsCollision(btBroadphaseProxy *proxy0) const {
|
||||
|
Loading…
Reference in New Issue
Block a user