Merge branch 'walk-follows-camera' of https://github.com/AndrewMeadows/hifi into AndrewMeadows-walk-follows-camera

This commit is contained in:
howard-stearns 2016-06-07 10:36:16 -07:00
commit 8894c731da

View file

@ -1214,7 +1214,10 @@ void MyAvatar::updateMotors() {
if (_characterController.getState() == CharacterController::State::Hover) {
motorRotation = getHead()->getCameraOrientation();
} else {
motorRotation = getOrientation();
// non-hovering = walking: follow camera twist about vertical but not lift
// so we decompose camera's rotation and store the twist part in motorRotation
glm::quat liftRotation;
swingTwistDecomposition(getHead()->getCameraOrientation(), _worldUpDirection, liftRotation, motorRotation);
}
const float DEFAULT_MOTOR_TIMESCALE = 0.2f;
const float INVALID_MOTOR_TIMESCALE = 1.0e6f;