mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 13:20:07 +00:00
add check to avoid crash, if link is out of bounds.
This commit is contained in:
parent
e82a4ecc6d
commit
a2cdadb9b4
@ -11022,7 +11022,10 @@ bool PhysicsServerCommandProcessor::processApplyExternalForceCommand(const struc
|
||||
|
||||
btVector3 forceWorld = isLinkFrame ? forceLocal : sb->getWorldTransform().getBasis() * forceLocal;
|
||||
btVector3 relPosWorld = isLinkFrame ? positionLocal : sb->getWorldTransform().getBasis() * positionLocal;
|
||||
sb->addForce(forceWorld, link);
|
||||
if (link >= 0 && link < sb->m_nodes.size())
|
||||
{
|
||||
sb->addForce(forceWorld, link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user