mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
avoid unnecessary and expensive gets
This commit is contained in:
parent
8b978beb31
commit
f0871c6878
1 changed files with 5 additions and 2 deletions
|
@ -1643,10 +1643,13 @@ void MyAvatar::prepareForPhysicsSimulation() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::harvestResultsFromPhysicsSimulation(float deltaTime) {
|
void MyAvatar::harvestResultsFromPhysicsSimulation(float deltaTime) {
|
||||||
glm::vec3 position = getPosition();
|
glm::vec3 position;
|
||||||
glm::quat orientation = getOrientation();
|
glm::quat orientation;
|
||||||
if (_characterController.isEnabledAndReady()) {
|
if (_characterController.isEnabledAndReady()) {
|
||||||
_characterController.getPositionAndOrientation(position, orientation);
|
_characterController.getPositionAndOrientation(position, orientation);
|
||||||
|
} else {
|
||||||
|
position = getPosition();
|
||||||
|
orientation = getOrientation();
|
||||||
}
|
}
|
||||||
nextAttitude(position, orientation);
|
nextAttitude(position, orientation);
|
||||||
_bodySensorMatrix = _follow.postPhysicsUpdate(*this, _bodySensorMatrix);
|
_bodySensorMatrix = _follow.postPhysicsUpdate(*this, _bodySensorMatrix);
|
||||||
|
|
Loading…
Reference in a new issue