mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
Merge pull request #13617 from amantley/rotateRecenter
Reduce Frequent Flipping of Avatar Facing Direction By Resetting _headControllerFacingMovingAverage
This commit is contained in:
commit
d498d6bb3d
2 changed files with 3 additions and 0 deletions
|
@ -3551,6 +3551,7 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat
|
||||||
qApp->getCamera().getMode() != CAMERA_MODE_MIRROR) {
|
qApp->getCamera().getMode() != CAMERA_MODE_MIRROR) {
|
||||||
if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
|
if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
|
||||||
activate(Rotation);
|
activate(Rotation);
|
||||||
|
myAvatar.setHeadControllerFacingMovingAverage(myAvatar._headControllerFacing);
|
||||||
}
|
}
|
||||||
if (myAvatar.getCenterOfGravityModelEnabled()) {
|
if (myAvatar.getCenterOfGravityModelEnabled()) {
|
||||||
if (!isActive(Horizontal) && (shouldActivateHorizontalCG(myAvatar) || hasDriveInput)) {
|
if (!isActive(Horizontal) && (shouldActivateHorizontalCG(myAvatar) || hasDriveInput)) {
|
||||||
|
@ -3568,6 +3569,7 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat
|
||||||
} else {
|
} else {
|
||||||
if (!isActive(Rotation) && getForceActivateRotation()) {
|
if (!isActive(Rotation) && getForceActivateRotation()) {
|
||||||
activate(Rotation);
|
activate(Rotation);
|
||||||
|
myAvatar.setHeadControllerFacingMovingAverage(myAvatar._headControllerFacing);
|
||||||
setForceActivateRotation(false);
|
setForceActivateRotation(false);
|
||||||
}
|
}
|
||||||
if (!isActive(Horizontal) && getForceActivateHorizontal()) {
|
if (!isActive(Horizontal) && getForceActivateHorizontal()) {
|
||||||
|
|
|
@ -883,6 +883,7 @@ public:
|
||||||
virtual void rebuildCollisionShape() override;
|
virtual void rebuildCollisionShape() override;
|
||||||
|
|
||||||
const glm::vec2& getHeadControllerFacingMovingAverage() const { return _headControllerFacingMovingAverage; }
|
const glm::vec2& getHeadControllerFacingMovingAverage() const { return _headControllerFacingMovingAverage; }
|
||||||
|
void setHeadControllerFacingMovingAverage(glm::vec2 currentHeadControllerFacing) { _headControllerFacingMovingAverage = currentHeadControllerFacing; }
|
||||||
float getCurrentStandingHeight() const { return _currentStandingHeight; }
|
float getCurrentStandingHeight() const { return _currentStandingHeight; }
|
||||||
void setCurrentStandingHeight(float newMode) { _currentStandingHeight = newMode; }
|
void setCurrentStandingHeight(float newMode) { _currentStandingHeight = newMode; }
|
||||||
const glm::quat getAverageHeadRotation() const { return _averageHeadRotation; }
|
const glm::quat getAverageHeadRotation() const { return _averageHeadRotation; }
|
||||||
|
|
Loading…
Reference in a new issue