summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-05-10 01:48:56 +0200
committerSergeanur <s.anureev@yandex.ua>2021-05-10 01:48:56 +0200
commit8f54093de1616d3a92ec39ad4e77e84d11d838cb (patch)
tree3ca9f2943e845953e38a1ea258766cb247cf8217 /src/core
parentMerge remote-tracking branch 'origin/miami' into lcs (diff)
parentfix (diff)
downloadre3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar
re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.gz
re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.bz2
re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.lz
re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.xz
re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.tar.zst
re3-8f54093de1616d3a92ec39ad4e77e84d11d838cb.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp4
-rw-r--r--src/core/FileLoader.cpp2
-rw-r--r--src/core/Placeable.h6
-rw-r--r--src/core/World.cpp4
4 files changed, 9 insertions, 7 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index adb3e571..373ede7d 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -214,7 +214,7 @@ CCamera::Init(void)
m_iModeToGoTo = CCam::MODE_FOLLOWPED;
m_bJust_Switched = false;
m_bUseTransitionBeta = false;
- m_matrix.SetScale(1.0f);
+ GetMatrix().SetScale(1.0f);
m_bTargetJustBeenOnTrain = false;
m_bInitialNoNodeStaticsSet = false;
m_uiLongestTimeInMill = 5000;
@@ -4019,7 +4019,7 @@ CCamera::SetRwCamera(RwCamera *cam)
void
CCamera::CalculateDerivedValues(void)
{
- m_cameraMatrix = Invert(m_matrix);
+ m_cameraMatrix = Invert(GetMatrix());
float hfov = DEGTORAD(CDraw::GetScaledFOV()/2.0f);
float c = Cos(hfov);
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index e5d13b2f..d57bdd92 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -1279,7 +1279,7 @@ CFileLoader::LoadObjectInstance(const char *line)
if(!CStreaming::IsObjectInCdImage(id))
debug("Not in cdimage %s\n", mi->GetModelName());
- angle = -RADTODEG(2.0f * acosf(angle));
+ angle = -RADTODEG(2.0f * Acos(angle));
xform = RwMatrixCreate();
RwMatrixRotate(xform, &axis, angle, rwCOMBINEREPLACE);
RwMatrixTranslate(xform, &trans, rwCOMBINEPOSTCONCAT);
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
index b0f9a15a..9c8c292a 100644
--- a/src/core/Placeable.h
+++ b/src/core/Placeable.h
@@ -2,12 +2,13 @@
class CPlaceable
{
+protected:
+ CMatrix m_matrix;
+
public:
// disable allocation
static void *operator new(size_t);
- CMatrix m_matrix;
-
CPlaceable(void);
const CVector &GetPosition(void) { return m_matrix.GetPosition(); }
void SetPosition(float x, float y, float z) {
@@ -20,6 +21,7 @@ public:
CVector &GetForward(void) { return m_matrix.GetForward(); }
CVector &GetUp(void) { return m_matrix.GetUp(); }
CMatrix &GetMatrix(void) { return m_matrix; }
+ void SetMatrix(CMatrix &newMatrix) { m_matrix = newMatrix; }
void SetTransform(RwMatrix *m) { m_matrix = CMatrix(m, false); }
void SetHeading(float angle);
void SetOrientation(float x, float y, float z){
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 1bf3611b..9ea999dc 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1486,7 +1486,7 @@ CWorld::CallOffChaseForAreaSectorListVehicles(CPtrList &list, float x1, float y1
CColModel *pColModel = pVehicle->GetColModel();
bool bInsideSphere = false;
for(int32 i = 0; i < pColModel->numSpheres; i++) {
- CVector pos = pVehicle->m_matrix * pColModel->spheres[i].center;
+ CVector pos = pVehicle->GetMatrix() * pColModel->spheres[i].center;
float fRadius = pColModel->spheres[i].radius;
if(pos.x + fRadius > x1 && pos.x - fRadius < x2 && pos.y + fRadius > y1 &&
pos.y - fRadius < y2)
@@ -1801,7 +1801,7 @@ CWorld::RepositionOneObject(CEntity *pEntity)
position.z = FindGroundZFor3DCoord(position.x, position.y,
position.z + OBJECT_REPOSITION_OFFSET_Z, nil) -
fBoundingBoxMinZ;
- pEntity->m_matrix.UpdateRW();
+ pEntity->GetMatrix().UpdateRW();
pEntity->UpdateRwFrame();
} else if(modelId == MI_BUOY) {
float fWaterLevel = 0.0f;