LLAgentCamera transition (1/2)
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
#include "llmd5.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llconsole.h"
|
||||
#include "llvieweraudio.h"
|
||||
@@ -3738,7 +3739,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
|
||||
gAgent.updateCamera();
|
||||
|
||||
// likewise make sure the camera is behind the avatar
|
||||
gAgent.resetView(TRUE);
|
||||
gAgentCamera.resetView(TRUE);
|
||||
LLVector3 shift_vector = regionp->getPosRegionFromGlobal(gAgent.getRegion()->getOriginGlobal());
|
||||
gAgent.setRegion(regionp);
|
||||
gObjectList.shiftObjects(shift_vector);
|
||||
@@ -3746,7 +3747,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
|
||||
if (gAgent.getAvatarObject())
|
||||
{
|
||||
gAgent.getAvatarObject()->clearChatText();
|
||||
gAgent.slamLookAt(look_at);
|
||||
gAgentCamera.slamLookAt(look_at);
|
||||
}
|
||||
gAgent.setPositionAgent(pos);
|
||||
gAssetStorage->setUpstream(sim);
|
||||
@@ -3882,9 +3883,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
|
||||
look_at = LLViewerCamera::getInstance()->getAtAxis();
|
||||
}
|
||||
// Force the camera back onto the agent, don't animate.
|
||||
gAgent.setFocusOnAvatar(TRUE, FALSE);
|
||||
gAgent.slamLookAt(look_at);
|
||||
gAgent.updateCamera();
|
||||
gAgentCamera.setFocusOnAvatar(TRUE, FALSE);
|
||||
gAgentCamera.slamLookAt(look_at);
|
||||
gAgentCamera.updateCamera();
|
||||
|
||||
gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL );
|
||||
|
||||
@@ -3945,7 +3946,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
|
||||
global_agent_pos[1] += y;
|
||||
look_at = (LLVector3)beacon_pos - global_agent_pos;
|
||||
look_at.normVec();
|
||||
gAgent.slamLookAt(look_at);
|
||||
gAgentCamera.slamLookAt(look_at);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4100,7 +4101,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
|
||||
LLQuaternion body_rotation = gAgent.getFrameAgent().getQuaternion();
|
||||
LLQuaternion head_rotation = gAgent.getHeadRotation();
|
||||
|
||||
camera_pos_agent = gAgent.getCameraPositionAgent();
|
||||
camera_pos_agent = gAgentCamera.getCameraPositionAgent();
|
||||
|
||||
render_state = gAgent.getRenderState();
|
||||
|
||||
@@ -4227,7 +4228,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
|
||||
msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis());
|
||||
msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis());
|
||||
msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis());
|
||||
msg->addF32Fast(_PREHASH_Far, gAgent.mDrawDistance);
|
||||
msg->addF32Fast(_PREHASH_Far, gAgentCamera.mDrawDistance);
|
||||
|
||||
msg->addU32Fast(_PREHASH_ControlFlags, control_flags);
|
||||
|
||||
@@ -4886,7 +4887,7 @@ void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data)
|
||||
LLVector4 cameraCollidePlane;
|
||||
mesgsys->getVector4Fast(_PREHASH_CameraCollidePlane, _PREHASH_Plane, cameraCollidePlane);
|
||||
|
||||
gAgent.setCameraCollidePlane(cameraCollidePlane);
|
||||
gAgentCamera.setCameraCollidePlane(cameraCollidePlane);
|
||||
}
|
||||
|
||||
void near_sit_object(BOOL success, void *data)
|
||||
@@ -4923,10 +4924,10 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
|
||||
|
||||
if (avatar && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
|
||||
{
|
||||
gAgent.setSitCamera(sitObjectID, camera_eye, camera_at);
|
||||
gAgentCamera.setSitCamera(sitObjectID, camera_eye, camera_at);
|
||||
}
|
||||
|
||||
gAgent.mForceMouselook = force_mouselook;
|
||||
gAgentCamera.setForceMouselook(force_mouselook);
|
||||
|
||||
LLViewerObject* object = gObjectList.findObject(sitObjectID);
|
||||
if (object)
|
||||
@@ -5922,9 +5923,9 @@ void container_inventory_arrived(LLViewerObject* object,
|
||||
void* data)
|
||||
{
|
||||
LL_DEBUGS("Messaging") << "container_inventory_arrived()" << LL_ENDL;
|
||||
if( gAgent.cameraMouselook() )
|
||||
if( gAgentCamera.cameraMouselook() )
|
||||
{
|
||||
gAgent.changeCameraToDefault();
|
||||
gAgentCamera.changeCameraToDefault();
|
||||
}
|
||||
|
||||
LLInventoryView* view = LLInventoryView::getActiveInventory();
|
||||
@@ -6153,11 +6154,11 @@ void process_teleport_local(LLMessageSystem *msg,void**)
|
||||
}
|
||||
|
||||
gAgent.setPositionAgent(pos);
|
||||
gAgent.slamLookAt(look_at);
|
||||
gAgentCamera.slamLookAt(look_at);
|
||||
|
||||
if ( !(gAgent.getTeleportKeepsLookAt() && LLViewerJoystick::getInstance()->getOverrideCamera()) && gSavedSettings.getBOOL("OptionRotateCamAfterLocalTP"))
|
||||
{
|
||||
gAgent.resetView(TRUE, TRUE);
|
||||
gAgentCamera.resetView(TRUE, TRUE);
|
||||
}
|
||||
|
||||
// send camera update to new region
|
||||
|
||||
Reference in New Issue
Block a user