mirror of
https://github.com/godotengine/godot.git
synced 2024-11-15 00:23:27 +00:00
Add null check in godot result callback
This commit is contained in:
parent
9af72f09c5
commit
23a61c7342
@ -164,9 +164,11 @@ bool GodotClosestConvexResultCallback::needsCollision(btBroadphaseProxy *proxy0)
|
||||
}
|
||||
|
||||
btScalar GodotClosestConvexResultCallback::addSingleResult(btCollisionWorld::LocalConvexResult &convexResult, bool normalInWorldSpace) {
|
||||
btScalar res = btCollisionWorld::ClosestConvexResultCallback::addSingleResult(convexResult, normalInWorldSpace);
|
||||
m_shapeId = convexResult.m_localShapeInfo->m_triangleIndex; // "m_triangleIndex" Is a odd name but contains the compound shape ID
|
||||
return res;
|
||||
if (convexResult.m_localShapeInfo)
|
||||
m_shapeId = convexResult.m_localShapeInfo->m_triangleIndex; // "m_triangleIndex" Is a odd name but contains the compound shape ID
|
||||
else
|
||||
m_shapeId = 0;
|
||||
return btCollisionWorld::ClosestConvexResultCallback::addSingleResult(convexResult, normalInWorldSpace);
|
||||
}
|
||||
|
||||
bool GodotAllContactResultCallback::needsCollision(btBroadphaseProxy *proxy0) const {
|
||||
|
Loading…
Reference in New Issue
Block a user