summaryrefslogtreecommitdiffstats
path: root/src/core/Cam.cpp
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-06-28 13:57:05 +0200
committerwithmorten <morten.with@gmail.com>2021-06-28 13:57:05 +0200
commitd17d437de319ca4c388dc724cffea91702d3a699 (patch)
tree806104fa5fe0e994cd7f55f1b7b48dc64a998c44 /src/core/Cam.cpp
parentRedo ReadSaveBuf + common.h cleanup (diff)
downloadre3-d17d437de319ca4c388dc724cffea91702d3a699.tar
re3-d17d437de319ca4c388dc724cffea91702d3a699.tar.gz
re3-d17d437de319ca4c388dc724cffea91702d3a699.tar.bz2
re3-d17d437de319ca4c388dc724cffea91702d3a699.tar.lz
re3-d17d437de319ca4c388dc724cffea91702d3a699.tar.xz
re3-d17d437de319ca4c388dc724cffea91702d3a699.tar.zst
re3-d17d437de319ca4c388dc724cffea91702d3a699.zip
Diffstat (limited to 'src/core/Cam.cpp')
-rw-r--r--src/core/Cam.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index ad315029..cafbd340 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -1183,7 +1183,7 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
float ReqSpeed = DeltaBeta * SpeedMultiplier;
// this is also added
- ReqSpeed = clamp(ReqSpeed, -SpeedLimit, SpeedLimit);
+ ReqSpeed = Clamp(ReqSpeed, -SpeedLimit, SpeedLimit);
// Add or subtract absolute depending on sign, genius!
if(ReqSpeed - BetaSpeed > 0.0f)
@@ -1678,7 +1678,7 @@ CCam::WorkOutCamHeight(const CVector &TargetCoors, float TargetOrientation, floa
Test.z = TargetCoors.z + 0.2f + Length*Sin(CarAlpha+AlphaOffset) + m_fCloseInCarHeightOffset;
if(CWorld::ProcessVerticalLine(Test, CamTargetEntity->GetPosition().z, point, entity, true, false, false, false, false, false, nil)){
float sin = (point.point.z - TargetCoors.z - 0.2f - m_fCloseInCarHeightOffset)/Length;
- CarAlpha = Asin(clamp(sin, -1.0f, 1.0f)) - AlphaOffset;
+ CarAlpha = Asin(Clamp(sin, -1.0f, 1.0f)) - AlphaOffset;
if(CarAlpha < 0.0f)
AlphaOffset += CarAlpha;
}
@@ -1828,7 +1828,7 @@ CCam::Process_Cam_On_A_String(const CVector &CameraTarget, float TargetOrientati
if(DeltaBeta > PI) DeltaBeta -= TWOPI;
else if(DeltaBeta < -PI) DeltaBeta += TWOPI;
float dist = (TargetCoors - Source).Magnitude();
- dist = FIRETRUCK_TRACKING_MULT*dist*clamp(DeltaBeta, -0.8f, 0.8f);
+ dist = FIRETRUCK_TRACKING_MULT*dist*Clamp(DeltaBeta, -0.8f, 0.8f);
Source += dist*CrossProduct(Front, CVector(0.0f, 0.0f, 1.0f));
}
@@ -2801,7 +2801,7 @@ CCam::Process_1rstPersonPedOnPC(const CVector&, float TargetOrientation, float,
if(BetaOffset > PI) BetaOffset -= TWOPI;
else if(BetaOffset < PI) BetaOffset += TWOPI;
- BetaOffset = clamp(BetaOffset, -pedTarget->m_attachRotStep, pedTarget->m_attachRotStep);
+ BetaOffset = Clamp(BetaOffset, -pedTarget->m_attachRotStep, pedTarget->m_attachRotStep);
Beta = NewBeta + BetaOffset;
}
@@ -3271,7 +3271,7 @@ CCam::Process_BehindBoat(const CVector &CameraTarget, float TargetOrientation, f
// useless call
//CWaterLevel::GetWaterLevelNoWaves(TargetCoors.x, TargetCoors.y, TargetCoors.z, &Water);
Water = (WaterLevel + WATER_Z_ADDITION_MIN - WaterLevelBuffered - WATER_Z_ADDITION)/(BoatDimensions.z/2.0f + MaxHeightUp);
- TargetAlpha = Asin(clamp(Water, -1.0f, 1.0f));
+ TargetAlpha = Asin(Clamp(Water, -1.0f, 1.0f));
}
if(ResetStatics){
@@ -3457,7 +3457,7 @@ FindSplinePathPositionFloat(float *out, float *spline, uint32 time, uint32 &mark
}
}
float a = ((float)time - (float)MS(spline[marker-4])) / (float)MS(spline[marker] - spline[marker-4]);
- a = clamp(a, 0.0f, 1.0f);
+ a = Clamp(a, 0.0f, 1.0f);
float b = 1.0f - a;
*out = b*b*b * spline[marker-3] +
3.0f*a*b*b * spline[marker-1] +
@@ -3495,7 +3495,7 @@ FindSplinePathPositionVector(CVector *out, float *spline, uint32 time, uint32 &m
}
float a = ((float)time - (float)MS(spline[marker-10])) / (float)MS(spline[marker] - spline[marker-10]);
- a = clamp(a, 0.0f, 1.0f);
+ a = Clamp(a, 0.0f, 1.0f);
float b = 1.0f - a;
out->x =
b*b*b * spline[marker-9] +
@@ -4921,7 +4921,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
// 0.98f: CAR_FOV_FADE_MULT
FOV = Pow(0.98f, CTimer::GetTimeStep()) * (FOV - DefaultFOV) + DefaultFOV;
- FOV = clamp(FOV, DefaultFOV, DefaultFOV + 30.0f);
+ FOV = Clamp(FOV, DefaultFOV, DefaultFOV + 30.0f);
}
// WORKAROUND: I still don't know how looking behind works (m_bCamDirectlyInFront is unused in III, they seem to use m_bUseTransitionBeta)
@@ -5040,7 +5040,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
}
}
- float targetAlpha = Asin(clamp(Front.z, -1.0f, 1.0f)) - zoomModeAlphaOffset;
+ float targetAlpha = Asin(Clamp(Front.z, -1.0f, 1.0f)) - zoomModeAlphaOffset;
if (targetAlpha <= maxAlphaAllowed) {
if (targetAlpha < -CARCAM_SET[camSetArrPos][14])
targetAlpha = -CARCAM_SET[camSetArrPos][14];