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:
@@ -611,8 +611,9 @@ void LLHUDEffectLookAt::update()
|
||||
{
|
||||
if (calcTargetPosition())
|
||||
{
|
||||
LLMotion* head_motion = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->findMotion(ANIM_AGENT_HEAD_ROT);
|
||||
if (!head_motion || head_motion->isStopped())
|
||||
//LLMotion* head_motion = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->findMotion(ANIM_AGENT_HEAD_ROT);
|
||||
//if (!head_motion || head_motion->isStopped())
|
||||
// singu: startMotion does basically the same as the above two lines... it starts it, unless it was already started.
|
||||
{
|
||||
((LLVOAvatar*)(LLViewerObject*)mSourceObject)->startMotion(ANIM_AGENT_HEAD_ROT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user