mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 20:34:20 +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();
|
||||
float timeStep = btMin(dt, MAX_TIMESTEP);
|
||||
|
||||
_avatarData->lockForRead();
|
||||
if (_avatarData->isPhysicsEnabled()) {
|
||||
// update character controller
|
||||
glm::quat rotation = _avatarData->getOrientation();
|
||||
|
@ -307,6 +308,7 @@ void PhysicsEngine::stepSimulation() {
|
|||
btVector3 walkVelocity = glmToBullet(_avatarData->getVelocity());
|
||||
_characterController->setVelocityForTimeInterval(walkVelocity, timeStep);
|
||||
}
|
||||
_avatarData->unlock();
|
||||
|
||||
// This is step (2).
|
||||
int numSubsteps = _dynamicsWorld->stepSimulation(timeStep, MAX_NUM_SUBSTEPS, PHYSICS_ENGINE_FIXED_SUBSTEP);
|
||||
|
@ -342,7 +344,6 @@ void PhysicsEngine::stepSimulation() {
|
|||
}
|
||||
|
||||
unlock();
|
||||
_avatarData->unlock();
|
||||
_entityTree->unlock();
|
||||
|
||||
computeCollisionEvents();
|
||||
|
|
Loading…
Reference in a new issue