mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:49:33 +02:00
unjack AvatarData locks
This commit is contained in:
parent
1cab14064d
commit
e2a104c38a
1 changed files with 2 additions and 1 deletions
|
@ -298,6 +298,7 @@ void PhysicsEngine::stepSimulation() {
|
||||||
_clock.reset();
|
_clock.reset();
|
||||||
float timeStep = btMin(dt, MAX_TIMESTEP);
|
float timeStep = btMin(dt, MAX_TIMESTEP);
|
||||||
|
|
||||||
|
_avatarData->lockForRead();
|
||||||
if (_avatarData->isPhysicsEnabled()) {
|
if (_avatarData->isPhysicsEnabled()) {
|
||||||
// update character controller
|
// update character controller
|
||||||
glm::quat rotation = _avatarData->getOrientation();
|
glm::quat rotation = _avatarData->getOrientation();
|
||||||
|
@ -307,6 +308,7 @@ void PhysicsEngine::stepSimulation() {
|
||||||
btVector3 walkVelocity = glmToBullet(_avatarData->getVelocity());
|
btVector3 walkVelocity = glmToBullet(_avatarData->getVelocity());
|
||||||
_characterController->setVelocityForTimeInterval(walkVelocity, timeStep);
|
_characterController->setVelocityForTimeInterval(walkVelocity, timeStep);
|
||||||
}
|
}
|
||||||
|
_avatarData->unlock();
|
||||||
|
|
||||||
// This is step (2).
|
// This is step (2).
|
||||||
int numSubsteps = _dynamicsWorld->stepSimulation(timeStep, MAX_NUM_SUBSTEPS, PHYSICS_ENGINE_FIXED_SUBSTEP);
|
int numSubsteps = _dynamicsWorld->stepSimulation(timeStep, MAX_NUM_SUBSTEPS, PHYSICS_ENGINE_FIXED_SUBSTEP);
|
||||||
|
@ -342,7 +344,6 @@ void PhysicsEngine::stepSimulation() {
|
||||||
}
|
}
|
||||||
|
|
||||||
unlock();
|
unlock();
|
||||||
_avatarData->unlock();
|
|
||||||
_entityTree->unlock();
|
_entityTree->unlock();
|
||||||
|
|
||||||
computeCollisionEvents();
|
computeCollisionEvents();
|
||||||
|
|
Loading…
Reference in a new issue