Sync up most of the realistic mouselook code with alchemy.

This should fix the inverted mouselook when sitting problem
Think the bug was in llvoavatar, but keeping in sync is always good for the future overall.
This commit is contained in:
Inusaito Sayori
2014-07-22 07:07:38 -04:00
parent 511811de3b
commit 4ca6a5c52c
3 changed files with 7 additions and 20 deletions

View File

@@ -1493,14 +1493,14 @@ void LLAgentCamera::updateCamera()
if (realistic_ml)
{
LLQuaternion agent_rot(gAgent.getFrameAgent().getQuaternion());
if (static_cast<LLViewerObject*>(gAgentAvatarp->getRoot())->flagCameraDecoupled())
if (LLViewerObject* parent = static_cast<LLViewerObject*>(gAgentAvatarp->getParent()))
if (LLViewerObject* parent = static_cast<LLViewerObject*>(gAgentAvatarp->getParent()))
if (static_cast<LLViewerObject*>(gAgentAvatarp->getRoot())->flagCameraDecoupled())
agent_rot *= parent->getRenderRotation();
LLViewerCamera::getInstance()->updateCameraLocation(head_pos, mCameraUpVector, gAgentAvatarp->mHeadp->getWorldPosition() + LLVector3(1.0, 0.0, 0.0) * agent_rot);
}
else
{
const LLVector3 diff = (mCameraPositionAgent - head_pos) * ~gAgentAvatarp->mRoot->getWorldRotation();
const LLVector3 diff((mCameraPositionAgent - head_pos) * ~gAgentAvatarp->mRoot->getWorldRotation());
gAgentAvatarp->mPelvisp->setPosition(gAgentAvatarp->mPelvisp->getPosition() + diff);
}