mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-08 02:29:49 +02:00
fix crash on startup
This commit is contained in:
parent
98e7d6d0eb
commit
b31acc421a
1 changed files with 5 additions and 4 deletions
|
@ -524,7 +524,7 @@ void CharacterController::computeNewVelocity(btScalar dt, glm::vec3& velocity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterController::preSimulation() {
|
void CharacterController::preSimulation() {
|
||||||
if (_enabled && _dynamicsWorld) {
|
if (_enabled && _dynamicsWorld && _rigidBody) {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
|
|
||||||
// slam body to where it is supposed to be
|
// slam body to where it is supposed to be
|
||||||
|
@ -632,9 +632,10 @@ void CharacterController::preSimulation() {
|
||||||
|
|
||||||
void CharacterController::postSimulation() {
|
void CharacterController::postSimulation() {
|
||||||
// postSimulation() exists for symmetry and just in case we need to do something here later
|
// postSimulation() exists for symmetry and just in case we need to do something here later
|
||||||
|
if (_enabled && _dynamicsWorld && _rigidBody) {
|
||||||
btVector3 velocity = _rigidBody->getLinearVelocity();
|
btVector3 velocity = _rigidBody->getLinearVelocity();
|
||||||
_velocityChange = velocity - _preSimulationVelocity;
|
_velocityChange = velocity - _preSimulationVelocity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue