summaryrefslogtreecommitdiff
path: root/indra/newview/llviewercamera.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-06-13 14:59:28 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-06-13 14:59:28 -0700
commit5e60392c273f0c9c5efa765a05414c618381780a (patch)
treed1eedbb1dfa86e66532a6d8746b7a81e5a444d3a /indra/newview/llviewercamera.cpp
parent0f3c3563b0861e8ea82b201aab8343d99f993bbc (diff)
parent100ebbab2437de7f5d124a0d7b8279a7a7b57656 (diff)
Merge branch 'develop' of github.com:secondlife/viewer into roxie/webrtc-voice
Diffstat (limited to 'indra/newview/llviewercamera.cpp')
-rw-r--r--indra/newview/llviewercamera.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index 437f1239bf..a070711727 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -196,7 +196,7 @@ void LLViewerCamera::calcProjection(const F32 far_distance) const
// height.
//static
-void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zflip, BOOL no_hacks)
+void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, bool ortho, bool zflip, bool no_hacks)
{
GLint* viewport = (GLint*) gGLViewport;
F64 model[16];
@@ -292,17 +292,17 @@ void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zfli
camera.calcAgentFrustumPlanes(frust);
}
-void LLViewerCamera::setPerspective(BOOL for_selection,
+void LLViewerCamera::setPerspective(bool for_selection,
S32 x, S32 y_from_bot, S32 width, S32 height,
- BOOL limit_select_distance,
+ bool limit_select_distance,
F32 z_near, F32 z_far)
{
F32 fov_y, aspect;
fov_y = RAD_TO_DEG * getView();
- BOOL z_default_far = FALSE;
+ bool z_default_far = false;
if (z_far <= 0)
{
- z_default_far = TRUE;
+ z_default_far = true;
z_far = getFar();
}
if (z_near <= 0)
@@ -442,11 +442,11 @@ void LLViewerCamera::projectScreenToPosAgent(const S32 screen_x, const S32 scree
}
// Uses the last GL matrices set in set_perspective to project a point from
-// the agent's region space to screen coordinates. Returns TRUE if point in within
+// the agent's region space to screen coordinates. Returns true if point in within
// the current window.
-BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const BOOL clamp) const
+bool LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const bool clamp) const
{
- BOOL in_front = TRUE;
+ bool in_front = true;
GLdouble x, y, z; // object's window coords, GL-style
LLVector3 dir_to_point = pos_agent - getOrigin();
@@ -456,11 +456,11 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
{
if (clamp)
{
- return FALSE;
+ return false;
}
else
{
- in_front = FALSE;
+ in_front = false;
}
}
@@ -495,19 +495,19 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
S32 int_x = lltrunc(x);
S32 int_y = lltrunc(y);
- BOOL valid = TRUE;
+ bool valid = true;
if (clamp)
{
if (int_x < world_rect.mLeft)
{
out_point.mX = world_rect.mLeft;
- valid = FALSE;
+ valid = false;
}
else if (int_x > world_rect.mRight)
{
out_point.mX = world_rect.mRight;
- valid = FALSE;
+ valid = false;
}
else
{
@@ -517,12 +517,12 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
if (int_y < world_rect.mBottom)
{
out_point.mY = world_rect.mBottom;
- valid = FALSE;
+ valid = false;
}
else if (int_y > world_rect.mTop)
{
out_point.mY = world_rect.mTop;
- valid = FALSE;
+ valid = false;
}
else
{
@@ -537,19 +537,19 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
if (int_x < world_rect.mLeft)
{
- valid = FALSE;
+ valid = false;
}
else if (int_x > world_rect.mRight)
{
- valid = FALSE;
+ valid = false;
}
if (int_y < world_rect.mBottom)
{
- valid = FALSE;
+ valid = false;
}
else if (int_y > world_rect.mTop)
{
- valid = FALSE;
+ valid = false;
}
return in_front && valid;
@@ -557,23 +557,23 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
}
else
{
- return FALSE;
+ return false;
}
}
// Uses the last GL matrices set in set_perspective to project a point from
// the agent's region space to the nearest edge in screen coordinates.
-// Returns TRUE if projection succeeds.
-BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent,
+// Returns true if projection succeeds.
+bool LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent,
LLCoordGL &out_point) const
{
LLVector3 dir_to_point = pos_agent - getOrigin();
dir_to_point /= dir_to_point.magVec();
- BOOL in_front = TRUE;
+ bool in_front = true;
if (dir_to_point * getAtAxis() < 0.f)
{
- in_front = FALSE;
+ in_front = false;
}
LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw();
@@ -614,7 +614,7 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent,
if (x == center_x && y == center_y)
{
// can't project to edge from exact center
- return FALSE;
+ return false;
}
// find the line from center to local
@@ -711,9 +711,9 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent,
out_point.mX = int_x + world_rect.mLeft;
out_point.mY = int_y + world_rect.mBottom;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -738,7 +738,7 @@ LLVector3 LLViewerCamera::roundToPixel(const LLVector3 &pos_agent)
F32 dist = (pos_agent - getOrigin()).magVec();
// Convert to screen space and back, preserving the depth.
LLCoordGL screen_point;
- if (!projectPosAgentToScreen(pos_agent, screen_point, FALSE))
+ if (!projectPosAgentToScreen(pos_agent, screen_point, false))
{
// Off the screen, just return the original position.
return pos_agent;
@@ -760,14 +760,14 @@ LLVector3 LLViewerCamera::roundToPixel(const LLVector3 &pos_agent)
return pos_agent_rounded;
}
-BOOL LLViewerCamera::cameraUnderWater() const
+bool LLViewerCamera::cameraUnderWater() const
{
LLViewerRegion* regionp = LLWorld::instance().getRegionFromPosAgent(getOrigin());
if (gPipeline.mHeroProbeManager.isMirrorPass())
{
// TODO: figure out how to handle this case
- return FALSE;
+ return false;
}
if (!regionp)
@@ -777,26 +777,26 @@ BOOL LLViewerCamera::cameraUnderWater() const
if(!regionp)
{
- return FALSE ;
+ return false ;
}
return getOrigin().mV[VZ] < regionp->getWaterHeight();
}
-BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
+bool LLViewerCamera::areVertsVisible(LLViewerObject* volumep, bool all_verts)
{
S32 i, num_faces;
LLDrawable* drawablep = volumep->mDrawable;
if (!drawablep)
{
- return FALSE;
+ return false;
}
LLVolume* volume = volumep->getVolume();
if (!volume)
{
- return FALSE;
+ return false;
}
LLVOVolume* vo_volume = (LLVOVolume*) volumep;
@@ -816,7 +816,7 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
{
const LLVolumeFace& face = volume->getVolumeFace(i);
- for (U32 v = 0; v < face.mNumVertices; v++)
+ for (S32 v = 0; v < face.mNumVertices; v++)
{
const LLVector4a& src_vec = face.mPositions[v];
LLVector4a vec;
@@ -828,7 +828,7 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
render_mata.affineTransform(t, vec);
}
- BOOL in_frustum = pointInFrustum(LLVector3(vec.getF32ptr())) > 0;
+ bool in_frustum = pointInFrustum(LLVector3(vec.getF32ptr())) > 0;
if (( !in_frustum && all_verts) ||
(in_frustum && !all_verts))
@@ -840,7 +840,7 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
return all_verts;
}
-extern BOOL gCubeSnapshot;
+extern bool gCubeSnapshot;
// changes local camera and broadcasts change
/* virtual */ void LLViewerCamera::setView(F32 vertical_fov_rads)
@@ -885,14 +885,14 @@ void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads)
mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f);
}
-BOOL LLViewerCamera::isDefaultFOVChanged()
+bool LLViewerCamera::isDefaultFOVChanged()
{
if(mPrevCameraFOVDefault != mCameraFOVDefault)
{
mPrevCameraFOVDefault = mCameraFOVDefault;
return !gSavedSettings.getBOOL("IgnoreFOVZoomForLODs");
}
- return FALSE;
+ return false;
}
// static