avoid unnecessary and expensive gets

This commit is contained in:
Andrew Meadows 2017-07-21 21:06:15 -07:00
parent 8b978beb31
commit f0871c6878

View file

@ -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);