summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-10 17:34:11 +0200
committeraap <aap@papnet.eu>2019-07-10 17:34:11 +0200
commit90e093cd47fb2af10617b1d404fc65ca813782ec (patch)
treef77fde407d8458529f688d3cb14c2ff003573fb0 /src/core
parentadded wrappers around math functions (diff)
downloadre3-90e093cd47fb2af10617b1d404fc65ca813782ec.tar
re3-90e093cd47fb2af10617b1d404fc65ca813782ec.tar.gz
re3-90e093cd47fb2af10617b1d404fc65ca813782ec.tar.bz2
re3-90e093cd47fb2af10617b1d404fc65ca813782ec.tar.lz
re3-90e093cd47fb2af10617b1d404fc65ca813782ec.tar.xz
re3-90e093cd47fb2af10617b1d404fc65ca813782ec.tar.zst
re3-90e093cd47fb2af10617b1d404fc65ca813782ec.zip
Diffstat (limited to '')
-rw-r--r--src/core/Camera.cpp14
-rw-r--r--src/core/Collision.cpp2
-rw-r--r--src/core/General.h4
-rw-r--r--src/core/Radar.cpp4
-rw-r--r--src/core/main.cpp2
5 files changed, 13 insertions, 13 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 4e988c15..c06ee48b 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -355,8 +355,8 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
// TODO: what's transition beta?
if(TheCamera.m_bUseTransitionBeta && ResetStatics){
CVector VecDistance;
- IdealSource.x = TargetCoors.x + GroundDist*cos(m_fTransitionBeta);
- IdealSource.y = TargetCoors.y + GroundDist*sin(m_fTransitionBeta);
+ IdealSource.x = TargetCoors.x + GroundDist*Cos(m_fTransitionBeta);
+ IdealSource.y = TargetCoors.y + GroundDist*Sin(m_fTransitionBeta);
Beta = CGeneral::GetATanOfXY(IdealSource.x - TargetCoors.x, IdealSource.y - TargetCoors.y);
}else
Beta = CGeneral::GetATanOfXY(Source.x - TargetCoors.x, Source.y - TargetCoors.y);
@@ -799,7 +799,7 @@ CCam::WorkOutCamHeightWeeCar(CVector &TargetCoors, float TargetOrientation)
if(CCullZones::CamNoRain() || CCullZones::PlayerNoRain())
AlphaTarget = DEGTORAD(14.0f);
WellBufferMe(AlphaTarget, &Alpha, &AlphaSpeed, 0.1f, 0.05f, true);
- Source.z = TargetCoors.z + CA_MAX_DISTANCE*sin(Alpha);
+ Source.z = TargetCoors.z + CA_MAX_DISTANCE*Sin(Alpha);
if(FindPlayerVehicle()){
m_fUnknownZOffSet = 0.0f;
@@ -945,7 +945,7 @@ CCam::WorkOutCamHeight(const CVector &TargetCoors, float TargetOrientation, floa
CWorld::FindRoofZFor3DCoord(TargetCoors.x - SideX, TargetCoors.y - SideY, CarBottom, &FoundRoofSide2);
// Now find out at what height we'd like to place the camera
- float CamGround = CWorld::FindGroundZFor3DCoord(Source.x, Source.y, TargetCoors.z + Length*sin(Alpha + ModeAlpha) + m_fCloseInCarHeightOffset, &FoundCamGround);
+ float CamGround = CWorld::FindGroundZFor3DCoord(Source.x, Source.y, TargetCoors.z + Length*Sin(Alpha + ModeAlpha) + m_fCloseInCarHeightOffset, &FoundCamGround);
float CamTargetZ = 0.0f;
if(FoundCamGround){
// This is the normal case
@@ -992,7 +992,7 @@ CCam::WorkOutCamHeight(const CVector &TargetCoors, float TargetOrientation, floa
}
// Now do things if CamClear...but what is that anyway?
- float CamZ = TargetCoors.z + Length*sin(Alpha + DeltaAlpha + ModeAlpha) + m_fCloseInCarHeightOffset;
+ float CamZ = TargetCoors.z + Length*Sin(Alpha + DeltaAlpha + ModeAlpha) + m_fCloseInCarHeightOffset;
bool FoundGround, FoundRoof;
float CamGround2 = CWorld::FindGroundZFor3DCoord(Source.x, Source.y, CamZ, &FoundGround);
if(FoundGround){
@@ -1138,8 +1138,8 @@ CCam::FixCamIfObscured(CVector &TargetCoors, float TargetHeight, float TargetOri
Obscured1 = CWorld::ProcessLineOfSight(EntityPos, TempSource, colPoint, ent, true, false, false, true, false, true, true);
}else if(m_bFixingBeta){
float d = (TempSource - Target).Magnitude();
- TempSource.x = Target.x - d*cos(TargetOrientation);
- TempSource.y = Target.y - d*sin(TargetOrientation);
+ TempSource.x = Target.x - d*Cos(TargetOrientation);
+ TempSource.y = Target.y - d*Sin(TargetOrientation);
// same check again
Obscured2 = CWorld::ProcessLineOfSight(Target, TempSource, colPoint, ent, true, false, false, true, false, true, true);
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 6241b79a..1ed08867 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -627,7 +627,7 @@ CCollision::ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoin
dist = sph.center - p;
float lensq = dist.MagnitudeSqr();
if(lensq < mindistsq){
- point.normal = dist * (1.0f/sqrt(lensq));
+ point.normal = dist * (1.0f/Sqrt(lensq));
point.point = sph.center - point.normal;
point.surfaceA = sph.surface;
point.pieceA = sph.piece;
diff --git a/src/core/General.h b/src/core/General.h
index a08b622b..64613478 100644
--- a/src/core/General.h
+++ b/src/core/General.h
@@ -70,12 +70,12 @@ public:
if (y > 0.0f)
return PI - Atan2(x / y, 1.0f);
else
- return -atan2(x / y, 1.0f);
+ return -Atan2(x / y, 1.0f);
} else {
if (y > 0.0f)
return -(PI + Atan2(x / y, 1.0f));
else
- return -atan2(x / y, 1.0f);
+ return -Atan2(x / y, 1.0f);
}
}
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index b634e4f5..ea7a7ffa 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -868,7 +868,7 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D
{
float s, c;
- s = -sin(TheCamera.GetForward().Heading());
+ s = -Sin(TheCamera.GetForward().Heading());
c = Cos(TheCamera.GetForward().Heading());
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED) {
@@ -885,7 +885,7 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D
else
forward = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetPosition() - TheCamera.Cams[TheCamera.ActiveCam].SourceBeforeLookBehind;
- s = -sin(forward.Heading());
+ s = -Sin(forward.Heading());
c = Cos(forward.Heading());
}
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 9ac271f9..ffde80bb 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -48,7 +48,7 @@
#include "RpAnimBlend.h"
#include "Frontend.h"
-#define DEFAULT_VIEWWINDOW (tan(DEGTORAD(CDraw::GetFOV() * 0.5f)))
+#define DEFAULT_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetFOV() * 0.5f)))
GlobalScene &Scene = *(GlobalScene*)0x726768;