mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:28:03 +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());
|
_characterController.setAvatarPositionAndOrientation(getPosition(), getOrientation());
|
||||||
if (qApp->isHMDMode()) {
|
if (qApp->isHMDMode()) {
|
||||||
updateHMDFollowVelocity();
|
updateHMDFollowVelocity();
|
||||||
_characterController.setHMDVelocity(_hmdFollowVelocity);
|
} else if (_isFollowingHMD) {
|
||||||
} else {
|
|
||||||
_characterController.setHMDVelocity(Vectors::ZERO);
|
|
||||||
_isFollowingHMD = false;
|
_isFollowingHMD = false;
|
||||||
|
_hmdFollowVelocity = Vectors::ZERO;
|
||||||
}
|
}
|
||||||
|
_characterController.setHMDVelocity(_hmdFollowVelocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::harvestResultsFromPhysicsSimulation() {
|
void MyAvatar::harvestResultsFromPhysicsSimulation() {
|
||||||
|
@ -1339,6 +1339,7 @@ void MyAvatar::adjustSensorTransform(glm::vec3 hmdShift) {
|
||||||
// the "adjustment" is more or less complete so stop following
|
// the "adjustment" is more or less complete so stop following
|
||||||
_isFollowingHMD = false;
|
_isFollowingHMD = false;
|
||||||
_hmdFollowSpeed = 0.0f;
|
_hmdFollowSpeed = 0.0f;
|
||||||
|
_hmdFollowVelocity = Vectors::ZERO;
|
||||||
// and slam the body's transform anyway to eliminate any slight errors
|
// and slam the body's transform anyway to eliminate any slight errors
|
||||||
glm::vec3 finalBodyPosition = extractTranslation(worldBodyMatrix);
|
glm::vec3 finalBodyPosition = extractTranslation(worldBodyMatrix);
|
||||||
nextAttitude(finalBodyPosition, finalBodyRotation);
|
nextAttitude(finalBodyPosition, finalBodyRotation);
|
||||||
|
|
Loading…
Reference in a new issue