diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-30 13:15:36 +0100 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-30 13:15:36 +0100 |
| commit | 61774546f0b260c18c5308143a9c3d02a5e5245e (patch) | |
| tree | 4566b4f91c2e02956143647067ae642570bb907a /indra/newview/llviewerobject.cpp | |
| parent | ccd5b9e2f3f1139814a63d9db03c3671c249930c (diff) | |
| parent | e1517318c58d6796b5566d5cf96c02474fd7376e (diff) | |
HUGE merge from viewer-trunk. Many conflicts resolved.
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
| -rw-r--r-- | indra/newview/llviewerobject.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index fdc63d5b76..6820ad42cd 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -60,6 +60,7 @@ #include "llaudiosourcevo.h" #include "llagent.h" +#include "llagentcamera.h" #include "llbbox.h" #include "llbox.h" #include "llcylinder.h" @@ -133,7 +134,15 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco { if (id == gAgentID) { - res = new LLVOAvatarSelf(id, pcode, regionp); + if (!gAgentAvatarp) + { + gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp); + } + else + { + gAgentAvatarp->updateRegion(regionp); + } + res = gAgentAvatarp; } else { @@ -222,7 +231,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mClickAction(0), mAttachmentItemID(LLUUID::null) { - if(!is_global) + if (!is_global) { llassert(mRegionp); } @@ -234,7 +243,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mPositionRegion = LLVector3(0.f, 0.f, 0.f); - if(!is_global) + if (!is_global && mRegionp) { mPositionAgent = mRegionp->getOriginAgent(); } @@ -376,11 +385,10 @@ void LLViewerObject::markDead() if (flagAnimSource()) { - LLVOAvatar* avatarp = gAgent.getAvatarObject(); - if (avatarp && !avatarp->isDead()) + if (isAgentAvatarValid()) { // stop motions associated with this object - avatarp->stopMotionFromSource(mID); + gAgentAvatarp->stopMotionFromSource(mID); } } @@ -2757,7 +2765,7 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) return; } - LLVector3 viewer_pos_agent = agent.getCameraPositionAgent(); + LLVector3 viewer_pos_agent = gAgentCamera.getCameraPositionAgent(); LLVector3 pos_agent = getRenderPosition(); F32 dx = viewer_pos_agent.mV[VX] - pos_agent.mV[VX]; @@ -4919,7 +4927,6 @@ void LLViewerObject::setIncludeInSearch(bool include_in_search) void LLViewerObject::setRegion(LLViewerRegion *regionp) { - llassert(regionp); mLatestRecvPacketID = 0; mRegionp = regionp; |
