LLAgentCamera transition (1/2)
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "llrender.h"
|
||||
#include "llglheaders.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llcoord.h"
|
||||
#include "llcriticaldamp.h"
|
||||
@@ -174,7 +175,7 @@ void display_update_camera(bool tiling=false)
|
||||
|
||||
// Cut draw distance in half when customizing avatar,
|
||||
// but on the viewer only.
|
||||
F32 final_far = gAgent.mDrawDistance;
|
||||
F32 final_far = gAgentCamera.mDrawDistance;
|
||||
if(tiling) //Don't animate clouds and water if tiling!
|
||||
{
|
||||
LLViewerCamera::getInstance()->setFar(final_far);
|
||||
@@ -182,7 +183,7 @@ void display_update_camera(bool tiling=false)
|
||||
LLWorld::getInstance()->setLandFarClip(final_far);
|
||||
return;
|
||||
}
|
||||
if (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode())
|
||||
if (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode())
|
||||
{
|
||||
final_far *= 0.5f;
|
||||
}
|
||||
@@ -412,7 +413,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
gAgent.setTeleportMessage(
|
||||
LLAgent::sTeleportProgressMessages["arriving"]);
|
||||
gTextureList.mForceResetTextureStats = TRUE;
|
||||
if(!gSavedSettings.getBOOL("AscentDisableTeleportScreens"))gAgent.resetView(TRUE, TRUE);
|
||||
if(!gSavedSettings.getBOOL("AscentDisableTeleportScreens"))gAgentCamera.resetView(TRUE, TRUE);
|
||||
break;
|
||||
|
||||
case LLAgent::TELEPORT_ARRIVING:
|
||||
@@ -987,12 +988,12 @@ void render_hud_attachments()
|
||||
glh::matrix4f current_mod = glh_get_current_modelview();
|
||||
|
||||
// clamp target zoom level to reasonable values
|
||||
// gAgent.mHUDTargetZoom = llclamp(gAgent.mHUDTargetZoom, 0.1f, 1.f);
|
||||
// gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f);
|
||||
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.0.0c
|
||||
gAgent.mHUDTargetZoom = llclamp(gAgent.mHUDTargetZoom, (!gRlvAttachmentLocks.hasLockedHUD()) ? 0.1f : 0.85f, 1.f);
|
||||
gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, (!gRlvAttachmentLocks.hasLockedHUD()) ? 0.1f : 0.85f, 1.f);
|
||||
// [/RLVa:KB]
|
||||
// smoothly interpolate current zoom level
|
||||
gAgent.mHUDCurZoom = lerp(gAgent.mHUDCurZoom, gAgent.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f));
|
||||
gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f));
|
||||
|
||||
if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices())
|
||||
{
|
||||
@@ -1105,7 +1106,7 @@ bool get_hud_matrices(const LLRect& screen_region, glh::matrix4f &proj, glh::mat
|
||||
LLVOAvatar* my_avatarp = gAgent.getAvatarObject();
|
||||
if (my_avatarp && my_avatarp->hasHUDAttachment())
|
||||
{
|
||||
F32 zoom_level = gAgent.mHUDCurZoom;
|
||||
F32 zoom_level = gAgentCamera.mHUDCurZoom;
|
||||
LLBBox hud_bbox = my_avatarp->getHUDBBox();
|
||||
|
||||
// set up transform to keep HUD objects in front of camera
|
||||
@@ -1381,14 +1382,14 @@ void render_ui_2d()
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
// render outline for HUD
|
||||
if (gAgent.getAvatarObject() && gAgent.mHUDCurZoom < 0.98f)
|
||||
if (gAgent.getAvatarObject() && gAgentCamera.mHUDCurZoom < 0.98f)
|
||||
{
|
||||
gGL.pushMatrix();
|
||||
S32 half_width = (gViewerWindow->getWindowWidth() / 2);
|
||||
S32 half_height = (gViewerWindow->getWindowHeight() / 2);
|
||||
glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f);
|
||||
glTranslatef((F32)half_width, (F32)half_height, 0.f);
|
||||
F32 zoom = gAgent.mHUDCurZoom;
|
||||
F32 zoom = gAgentCamera.mHUDCurZoom;
|
||||
glScalef(zoom,zoom,1.f);
|
||||
gGL.color4fv(LLColor4::white.mV);
|
||||
gl_rect_2d(-half_width, half_height, half_width, -half_height, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user