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:
unknown
2010-10-07 21:36:13 -05:00
parent 49e4959bf5
commit fe9a3d2ba2
41 changed files with 365 additions and 209 deletions

View File

@@ -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);