LLAgentCamera transition (1/2)

This commit is contained in:
Shyotl
2011-06-07 21:35:10 -05:00
parent 278cfbdb67
commit a07e399801
89 changed files with 616 additions and 572 deletions

View File

@@ -44,6 +44,7 @@
#include "llfloateravatarlist.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llavatarnamecache.h"
#include "llcallingcard.h"
#include "llcolorscheme.h"
@@ -104,7 +105,7 @@ LLNetMap::LLNetMap(const std::string& name) :
mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal();
mObjectImageCenterGlobal = gAgentCamera.getCameraPositionGlobal();
// Register event listeners for popup menu
(new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel");
@@ -251,7 +252,7 @@ void LLNetMap::draw()
LLViewerRegion* regionp = *iter;
// Find x and y position relative to camera's center.
LLVector3 origin_agent = regionp->getOriginAgent();
LLVector3 rel_region_pos = origin_agent - gAgent.getCameraPositionAgent();
LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent();
F32 relative_x = (rel_region_pos.mV[0] / region_width) * mScale;
F32 relative_y = (rel_region_pos.mV[1] / region_width) * mScale;
@@ -308,7 +309,7 @@ void LLNetMap::draw()
mUpdateNow = FALSE;
// Locate the centre of the object layer, accounting for panning
LLVector3 new_center = globalPosToView(gAgent.getCameraPositionGlobal(), rotate_map);
LLVector3 new_center = globalPosToView(gAgentCamera.getCameraPositionGlobal(), rotate_map);
new_center.mV[0] -= mCurPanX;
new_center.mV[1] -= mCurPanY;
new_center.mV[2] = 0.f;
@@ -327,7 +328,7 @@ void LLNetMap::draw()
}
LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal);
map_center_agent -= gAgent.getCameraPositionAgent();
map_center_agent -= gAgentCamera.getCameraPositionAgent();
map_center_agent.mV[VX] *= mScale/region_width;
map_center_agent.mV[VY] *= mScale/region_width;
@@ -535,7 +536,7 @@ void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent)
LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated)
{
LLVector3d relative_pos_global = global_pos - gAgent.getCameraPositionGlobal();
LLVector3d relative_pos_global = global_pos - gAgentCamera.getCameraPositionGlobal();
LLVector3 pos_local;
pos_local.setVec(relative_pos_global); // convert to floats from doubles
@@ -601,7 +602,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated )
LLVector3d pos_global;
pos_global.setVec( pos_local );
pos_global += gAgent.getCameraPositionGlobal();
pos_global += gAgentCamera.getCameraPositionGlobal();
return pos_global;
}