SL-1350 - keep control avatar rotation synced to corresponding root drawable

meow-7.2.2
Brad Payne (Vir Linden) 2018-09-27 19:34:41 +01:00
parent 963945b3ab
commit 4d4255c27b
3 changed files with 16 additions and 3 deletions

View File

@ -175,7 +175,16 @@ void LLControlAvatar::matchVolumeTransform()
// complexity info and such line up better. Should defer
// this until avatars also get fixed.
LLQuaternion obj_rot = mRootVolp->getRotation();
LLQuaternion obj_rot;
if (mRootVolp->mDrawable)
{
obj_rot = mRootVolp->mDrawable->getRotation();
}
else
{
obj_rot = mRootVolp->getRotation();
}
LLMatrix3 bind_mat;
LLQuaternion bind_rot;

View File

@ -52,7 +52,6 @@
#include "llviewerwindow.h"
#include "llvocache.h"
#include "llcontrolavatar.h"
#include "llcallstack.h"
#include "lldrawpoolavatar.h"
const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f;
@ -730,6 +729,10 @@ F32 LLDrawable::updateXform(BOOL undamped)
mXform.setRotation(target_rot);
mXform.setScale(LLVector3(1,1,1)); //no scale in drawable transforms (IT'S A RULE!)
mXform.updateMatrix();
if (isRoot() && mVObjp->isAnimatedObject() && mVObjp->getControlAvatar())
{
mVObjp->getControlAvatar()->matchVolumeTransform();
}
if (mSpatialBridge)
{

View File

@ -4168,7 +4168,8 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w
LLControlAvatar *cav = dynamic_cast<LLControlAvatar*>(this);
if (cav)
{
cav->matchVolumeTransform();
// SL-1350: Moved to LLDrawable::updateXform()
//cav->matchVolumeTransform();
}
else
{