Speed up of particular inefficient part related to motions.
For these standard motions, the viewer likes to very frequently flood-call startMotion/stopMotion sometimes, which at the very least needs a LLUUID lookup in a std::map. In particular, this is done for two of them for every avatar in the sim every frame. This code makes it possible to test if that makes sense by merely doing a bit test. Conflicts: indra/llcharacter/llkeyframemotion.h
This commit is contained in:
@@ -138,8 +138,8 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
|
||||
// LLWalkAdjustMotion()
|
||||
// Class Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) :
|
||||
LLMotion(id),
|
||||
LLWalkAdjustMotion::LLWalkAdjustMotion(LLUUID const& id, LLMotionController& controller) :
|
||||
AIMaskedMotion(id, controller, ANIM_AGENT_WALK_ADJUST),
|
||||
mLastTime(0.f),
|
||||
mAnimSpeed(0.f),
|
||||
mAdjustedSpeed(0.f),
|
||||
@@ -193,7 +193,7 @@ BOOL LLWalkAdjustMotion::onActivate()
|
||||
F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
|
||||
mAnkleOffset = llmax(leftAnkleOffset, rightAnkleOffset);
|
||||
|
||||
return TRUE;
|
||||
return AIMaskedMotion::onActivate();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -325,13 +325,14 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
||||
void LLWalkAdjustMotion::onDeactivate()
|
||||
{
|
||||
mCharacter->removeAnimationData("Walk Speed");
|
||||
AIMaskedMotion::onDeactivate();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFlyAdjustMotion::LLFlyAdjustMotion()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLFlyAdjustMotion::LLFlyAdjustMotion(const LLUUID &id)
|
||||
: LLMotion(id),
|
||||
LLFlyAdjustMotion::LLFlyAdjustMotion(LLUUID const& id, LLMotionController& controller)
|
||||
: AIMaskedMotion(id, controller, ANIM_AGENT_FLY_ADJUST),
|
||||
mRoll(0.f)
|
||||
{
|
||||
mName = "fly_adjust";
|
||||
@@ -368,7 +369,7 @@ BOOL LLFlyAdjustMotion::onActivate()
|
||||
mPelvisState->setPosition(LLVector3::zero);
|
||||
mPelvisState->setRotation(LLQuaternion::DEFAULT);
|
||||
mRoll = 0.f;
|
||||
return TRUE;
|
||||
return AIMaskedMotion::onActivate();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user