summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-06-21 15:01:59 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2023-06-21 15:08:10 +0200
commit6f8b812ecd73bf25d44445e1b791f9e1b01f429f (patch)
tree35f1df831283c54fc23be929be3f7d60aabcf61a /indra/newview
parent5c420babdcceafbe8ecfd786f37ece5d0581714d (diff)
SL-19692 Z Offset is applied twice in Mouselook
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagentcamera.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 2cf86cb001..d2fe570069 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1764,13 +1764,24 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
LL_WARNS() << "Null avatar drawable!" << LL_ENDL;
return LLVector3d::zero;
}
+
head_offset.clearVec();
+ F32 fixup;
+ if (gAgentAvatarp->hasPelvisFixup(fixup))
+ {
+ head_offset[VZ] -= fixup;
+ }
+ if (gAgentAvatarp->isSitting())
+ {
+ head_offset.mdV[VZ] += 0.1;
+ }
+
if (gAgentAvatarp->isSitting() && gAgentAvatarp->getParent())
{
gAgentAvatarp->updateHeadOffset();
- head_offset.mdV[VX] = gAgentAvatarp->mHeadOffset.mV[VX];
- head_offset.mdV[VY] = gAgentAvatarp->mHeadOffset.mV[VY];
- head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ] + 0.1f;
+ head_offset.mdV[VX] += gAgentAvatarp->mHeadOffset.mV[VX];
+ head_offset.mdV[VY] += gAgentAvatarp->mHeadOffset.mV[VY];
+ head_offset.mdV[VZ] += gAgentAvatarp->mHeadOffset.mV[VZ];
const LLMatrix4& mat = ((LLViewerObject*) gAgentAvatarp->getParent())->getRenderMatrix();
camera_position_global = gAgent.getPosGlobalFromAgent
((gAgentAvatarp->getPosition()+
@@ -1778,11 +1789,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
}
else
{
- head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ];
- if (gAgentAvatarp->isSitting())
- {
- head_offset.mdV[VZ] += 0.1;
- }
+ head_offset.mdV[VZ] += gAgentAvatarp->mHeadOffset.mV[VZ];
camera_position_global = gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition());//frame_center_global;
head_offset = head_offset * gAgentAvatarp->getRenderRotation();
camera_position_global = camera_position_global + head_offset;