mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 18:02:23 +02:00
Fix blue screen after player step returns NaN values
This commit is contained in:
parent
ce0ffe4292
commit
ced4e1e0e0
1 changed files with 7 additions and 3 deletions
|
@ -277,10 +277,14 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar
|
|||
btVector3 shapeLocalOffset = glmToBullet(_shapeLocalOffset);
|
||||
btVector3 swingDisplacement = rotateVector(endRot, -shapeLocalOffset) - rotateVector(startRot, -shapeLocalOffset);
|
||||
|
||||
_followLinearDisplacement = linearDisplacement + swingDisplacement + _followLinearDisplacement;
|
||||
_followAngularDisplacement = angularDisplacement * _followAngularDisplacement;
|
||||
if (!isNaN(bulletToGLM(endPos)) && !isNaN(bulletToGLM(endRot))) {
|
||||
_followLinearDisplacement = linearDisplacement + swingDisplacement + _followLinearDisplacement;
|
||||
_followAngularDisplacement = angularDisplacement * _followAngularDisplacement;
|
||||
|
||||
_rigidBody->setWorldTransform(btTransform(endRot, endPos));
|
||||
_rigidBody->setWorldTransform(btTransform(endRot, endPos));
|
||||
} else {
|
||||
qCWarning(physics) << "CharacterController::playerStep produced NaN.";
|
||||
}
|
||||
}
|
||||
_followTime += dt;
|
||||
|
||||
|
|
Loading…
Reference in a new issue