PATH-842: Another tweak to get the llSetTargetOmega functionality working in the viewer.

Todd Stinson 2012-08-14 19:10:46 -07:00
parent 8bd159af88
commit e5ab1c9441
2 changed files with 11 additions and 3 deletions

View File

@ -2116,7 +2116,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
{
if (new_angv != old_angv)
{
resetRot();
resetRotTime();
}
// Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega)
@ -5572,9 +5572,14 @@ void LLViewerObject::applyAngularVelocity(F32 dt)
}
}
void LLViewerObject::resetRot()
void LLViewerObject::resetRotTime()
{
mRotTime = 0.0f;
}
void LLViewerObject::resetRot()
{
resetRotTime();
// Reset the accumulated angular velocity rotation
mAngularVelocityRot.loadIdentity();

View File

@ -212,6 +212,9 @@ public:
virtual BOOL updateLOD();
virtual BOOL setDrawableParent(LLDrawable* parentp);
F32 getRotTime() { return mRotTime; }
private:
void resetRotTime();
public:
void resetRot();
void applyAngularVelocity(F32 dt);
@ -224,7 +227,7 @@ public:
LLViewerRegion* getRegion() const { return mRegionp; }
BOOL isSelected() const { return mUserSelected; }
virtual void setSelected(BOOL sel) { mUserSelected = sel; mRotTime = 0.f;}
virtual void setSelected(BOOL sel) { mUserSelected = sel; resetRot();}
const LLUUID &getID() const { return mID; }
U32 getLocalID() const { return mLocalID; }