mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-13 10:32:16 +02:00
VR fix for different avatar scales.
Previously, if the avatar scale wasn't 1, the body and viewpoint would given the wrong vertical position in some situations, eg: getting up from click-to-sit; changing the 'Allow my avatar to stand' setting.
The avatar scale was being taken into account where it shouldn't have in MyAvatar::deriveBodyFromHMDSensor.
The bug started in 8b839fe71b
("VR fixes for different user heights and avatar scales".
Repro:
1. Set 'Allow my avatar to stand: Always'
2. Reduce the avatar scale to the minumum.
3. Set 'Allow my avatar to stand: When I stand'
4. Previously, the viewpoint would suddenly be below the floor.
This commit is contained in:
parent
c9cf7eb75d
commit
dec9e9d338
1 changed files with 2 additions and 1 deletions
|
@ -4845,7 +4845,8 @@ glm::mat4 MyAvatar::deriveBodyFromHMDSensor(const bool forceFollowYPos) const {
|
|||
|
||||
if (!forceFollowYPos && !getHMDCrouchRecenterEnabled()) {
|
||||
// Set the body's vertical position as if it were standing in its T-pose.
|
||||
bodyPos.y = worldToSensorScale * rig.getUnscaledHipsHeight();
|
||||
const float userToRigScale = getUserEyeHeight() / getUnscaledEyeHeight();
|
||||
bodyPos.y = userToRigScale * rig.getUnscaledHipsHeight();
|
||||
}
|
||||
|
||||
glm::mat4 bodyMat = createMatFromQuatAndPos(bodyQuat, bodyPos);
|
||||
|
|
Loading…
Reference in a new issue