mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 12:33:37 +02:00
set _hmdFollowVelocity to zero when done following
This commit is contained in:
parent
439bdbc0e4
commit
9de5721a48
1 changed files with 4 additions and 3 deletions
|
@ -1299,11 +1299,11 @@ void MyAvatar::prepareForPhysicsSimulation() {
|
|||
_characterController.setAvatarPositionAndOrientation(getPosition(), getOrientation());
|
||||
if (qApp->isHMDMode()) {
|
||||
updateHMDFollowVelocity();
|
||||
_characterController.setHMDVelocity(_hmdFollowVelocity);
|
||||
} else {
|
||||
_characterController.setHMDVelocity(Vectors::ZERO);
|
||||
} else if (_isFollowingHMD) {
|
||||
_isFollowingHMD = false;
|
||||
_hmdFollowVelocity = Vectors::ZERO;
|
||||
}
|
||||
_characterController.setHMDVelocity(_hmdFollowVelocity);
|
||||
}
|
||||
|
||||
void MyAvatar::harvestResultsFromPhysicsSimulation() {
|
||||
|
@ -1339,6 +1339,7 @@ void MyAvatar::adjustSensorTransform(glm::vec3 hmdShift) {
|
|||
// the "adjustment" is more or less complete so stop following
|
||||
_isFollowingHMD = false;
|
||||
_hmdFollowSpeed = 0.0f;
|
||||
_hmdFollowVelocity = Vectors::ZERO;
|
||||
// and slam the body's transform anyway to eliminate any slight errors
|
||||
glm::vec3 finalBodyPosition = extractTranslation(worldBodyMatrix);
|
||||
nextAttitude(finalBodyPosition, finalBodyRotation);
|
||||
|
|
Loading…
Reference in a new issue