Converted frequently occuring setting lookups to LLCachedControl
Added LLObjectList::getAvatar(LLUUID) for type-safe and quicker lookup Added F32 overload to LLSD because using F64 needlessly is silly. (And its lack of F32 overload caused issues with LLCachedControl<F32>)
This commit is contained in:
@@ -199,13 +199,13 @@ LLVector3d LLAvatarTracker::getGlobalPos()
|
||||
if(!mTrackedAgentValid || !mTrackingData) return LLVector3d();
|
||||
LLVector3d global_pos;
|
||||
|
||||
LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID);
|
||||
if(object && !object->isDead())
|
||||
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
|
||||
if(avatarp && !avatarp->isDead())
|
||||
{
|
||||
global_pos = object->getPositionGlobal();
|
||||
global_pos = avatarp->getPositionGlobal();
|
||||
// HACK - for making the tracker point above the avatar's head
|
||||
// rather than its groin
|
||||
global_pos.mdV[VZ] += 0.7f * ((LLVOAvatar *)object)->mBodySize.mV[VZ];
|
||||
global_pos.mdV[VZ] += 0.7f * avatarp->mBodySize.mV[VZ];
|
||||
|
||||
mTrackingData->mGlobalPositionEstimate = global_pos;
|
||||
}
|
||||
@@ -225,10 +225,10 @@ void LLAvatarTracker::getDegreesAndDist(F32& rot,
|
||||
|
||||
LLVector3d global_pos;
|
||||
|
||||
LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID);
|
||||
if(object && !object->isDead())
|
||||
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
|
||||
if(avatarp && !avatarp->isDead())
|
||||
{
|
||||
global_pos = object->getPositionGlobal();
|
||||
global_pos = avatarp->getPositionGlobal();
|
||||
mTrackingData->mGlobalPositionEstimate = global_pos;
|
||||
}
|
||||
else
|
||||
@@ -761,8 +761,8 @@ void LLTrackingData::agentFound(const LLUUID& prey,
|
||||
|
||||
bool LLTrackingData::haveTrackingInfo()
|
||||
{
|
||||
LLViewerObject* object = gObjectList.findObject(mAvatarID);
|
||||
if(object && !object->isDead())
|
||||
LLVOAvatar* avatarp = gObjectList.findAvatar(mAvatarID);
|
||||
if(avatarp && !avatarp->isDead())
|
||||
{
|
||||
mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY);
|
||||
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
|
||||
|
||||
Reference in New Issue
Block a user