mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +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) {
|
||||
glm::vec3 position = getPosition();
|
||||
glm::quat orientation = getOrientation();
|
||||
glm::vec3 position;
|
||||
glm::quat orientation;
|
||||
if (_characterController.isEnabledAndReady()) {
|
||||
_characterController.getPositionAndOrientation(position, orientation);
|
||||
} else {
|
||||
position = getPosition();
|
||||
orientation = getOrientation();
|
||||
}
|
||||
nextAttitude(position, orientation);
|
||||
_bodySensorMatrix = _follow.postPhysicsUpdate(*this, _bodySensorMatrix);
|
||||
|
|
Loading…
Reference in a new issue