summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-05-02 14:28:19 +0200
committerSergeanur <s.anureev@yandex.ua>2020-05-02 14:28:19 +0200
commit52390062b39a3398379934e59a15faa01613e586 (patch)
treeba7c8c16921d09a9ec1e2d33323ab142048a3290
parentSetPosition, part 1 (diff)
downloadre3-52390062b39a3398379934e59a15faa01613e586.tar
re3-52390062b39a3398379934e59a15faa01613e586.tar.gz
re3-52390062b39a3398379934e59a15faa01613e586.tar.bz2
re3-52390062b39a3398379934e59a15faa01613e586.tar.lz
re3-52390062b39a3398379934e59a15faa01613e586.tar.xz
re3-52390062b39a3398379934e59a15faa01613e586.tar.zst
re3-52390062b39a3398379934e59a15faa01613e586.zip
-rw-r--r--src/control/Garages.cpp36
-rw-r--r--src/control/Pickups.cpp8
-rw-r--r--src/core/Cam.cpp4
-rw-r--r--src/core/Pad.cpp2
-rw-r--r--src/core/Radar.cpp4
-rw-r--r--src/core/ZoneCull.cpp2
-rw-r--r--src/core/re3.cpp6
-rw-r--r--src/objects/ParticleObject.cpp4
-rw-r--r--src/render/Glass.cpp2
-rw-r--r--src/vehicles/Automobile.cpp2
-rw-r--r--src/vehicles/Boat.cpp6
-rw-r--r--src/vehicles/CarGen.cpp4
-rw-r--r--src/vehicles/Cranes.cpp4
-rw-r--r--src/vehicles/Heli.cpp14
14 files changed, 49 insertions, 49 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 97cb8303..75d5d3ba 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1448,14 +1448,14 @@ void CGarage::UpdateDoorsHeight()
{
RefreshDoorPointers(false);
if (m_pDoor1) {
- m_pDoor1->GetPosition().z = m_fDoorPos + m_fDoor1Z;
+ m_pDoor1->GetMatrix().GetPosition().z = m_fDoorPos + m_fDoor1Z;
if (m_bRotatedDoor)
BuildRotatedDoorMatrix(m_pDoor1, m_fDoorPos / m_fDoorHeight);
m_pDoor1->GetMatrix().UpdateRW();
m_pDoor1->UpdateRwFrame();
}
if (m_pDoor2) {
- m_pDoor2->GetPosition().z = m_fDoorPos + m_fDoor2Z;
+ m_pDoor2->GetMatrix().GetPosition().z = m_fDoorPos + m_fDoor2Z;
if (m_bRotatedDoor)
BuildRotatedDoorMatrix(m_pDoor2, m_fDoorPos / m_fDoorHeight);
m_pDoor2->GetMatrix().UpdateRW();
@@ -1482,18 +1482,18 @@ void CGarage::UpdateCrusherAngle()
void CGarage::UpdateCrusherShake(float X, float Y)
{
RefreshDoorPointers(false);
- m_pDoor1->GetPosition().x += X;
- m_pDoor1->GetPosition().y += Y;
+ m_pDoor1->GetMatrix().GetPosition().x += X;
+ m_pDoor1->GetMatrix().GetPosition().y += Y;
m_pDoor1->GetMatrix().UpdateRW();
m_pDoor1->UpdateRwFrame();
- m_pDoor1->GetPosition().x -= X;
- m_pDoor1->GetPosition().y -= Y;
- m_pDoor2->GetPosition().x += X;
- m_pDoor2->GetPosition().y += Y;
+ m_pDoor1->GetMatrix().GetPosition().x -= X;
+ m_pDoor1->GetMatrix().GetPosition().y -= Y;
+ m_pDoor2->GetMatrix().GetPosition().x += X;
+ m_pDoor2->GetMatrix().GetPosition().y += Y;
m_pDoor2->GetMatrix().UpdateRW();
m_pDoor2->UpdateRwFrame();
- m_pDoor2->GetPosition().x -= X;
- m_pDoor2->GetPosition().y -= Y;
+ m_pDoor2->GetMatrix().GetPosition().x -= X;
+ m_pDoor2->GetMatrix().GetPosition().y -= Y;
}
// This is dumb but there is no way to avoid goto. What was there originally even?
@@ -1854,7 +1854,7 @@ CVehicle* CStoredCar::RestoreCar()
#else
CVehicle* pVehicle = new CAutomobile(m_nModelIndex, RANDOM_VEHICLE);
#endif
- pVehicle->GetPosition() = m_vecPos;
+ pVehicle->SetPosition(m_vecPos);
pVehicle->SetStatus(STATUS_ABANDONED);
pVehicle->GetForward() = m_vecAngle;
pVehicle->GetRight() = CVector(m_vecAngle.y, -m_vecAngle.x, 0.0f);
@@ -2089,15 +2089,15 @@ void CGarage::CenterCarInGarage(CVehicle* pVehicle)
float offsetZ = pos.z - pos.z;
float distance = CVector(offsetX, offsetY, offsetZ).Magnitude();
if (distance < RESPRAY_CENTERING_COEFFICIENT) {
- pVehicle->GetPosition().x = GetGarageCenterX();
- pVehicle->GetPosition().y = GetGarageCenterY();
+ pVehicle->GetMatrix().GetPosition().x = GetGarageCenterX();
+ pVehicle->GetMatrix().GetPosition().y = GetGarageCenterY();
}
else {
- pVehicle->GetPosition().x += offsetX * RESPRAY_CENTERING_COEFFICIENT / distance;
- pVehicle->GetPosition().y += offsetY * RESPRAY_CENTERING_COEFFICIENT / distance;
+ pVehicle->GetMatrix().GetPosition().x += offsetX * RESPRAY_CENTERING_COEFFICIENT / distance;
+ pVehicle->GetMatrix().GetPosition().y += offsetY * RESPRAY_CENTERING_COEFFICIENT / distance;
}
if (!IsEntityEntirelyInside3D(pVehicle, 0.1f))
- pVehicle->GetPosition() = pos;
+ pVehicle->SetPosition(pos);
}
void CGarages::CloseHideOutGaragesBeforeSave()
@@ -2205,7 +2205,7 @@ void CGarages::SetAllDoorsBackToOriginalHeight()
default:
aGarages[i].RefreshDoorPointers(true);
if (aGarages[i].m_pDoor1) {
- aGarages[i].m_pDoor1->GetPosition().z = aGarages[i].m_fDoor1Z;
+ aGarages[i].m_pDoor1->GetMatrix().GetPosition().z = aGarages[i].m_fDoor1Z;
if (aGarages[i].m_pDoor1->IsObject())
((CObject*)aGarages[i].m_pDoor1)->m_objectMatrix.GetPosition().z = aGarages[i].m_fDoor1Z;
if (aGarages[i].m_bRotatedDoor)
@@ -2214,7 +2214,7 @@ void CGarages::SetAllDoorsBackToOriginalHeight()
aGarages[i].m_pDoor1->UpdateRwFrame();
}
if (aGarages[i].m_pDoor2) {
- aGarages[i].m_pDoor2->GetPosition().z = aGarages[i].m_fDoor2Z;
+ aGarages[i].m_pDoor2->GetMatrix().GetPosition().z = aGarages[i].m_fDoor2Z;
if (aGarages[i].m_pDoor2->IsObject())
((CObject*)aGarages[i].m_pDoor2)->m_objectMatrix.GetPosition().z = aGarages[i].m_fDoor2Z;
if (aGarages[i].m_bRotatedDoor)
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 08ce9418..bc1bbf1c 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -288,7 +288,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
case PICKUP_NAUTICAL_MINE_INACTIVE:
{
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false))
- m_pObject->GetPosition().z = waterLevel + 0.6f;
+ m_pObject->GetMatrix().GetPosition().z = waterLevel + 0.6f;
m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame();
@@ -310,7 +310,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
}
case PICKUP_NAUTICAL_MINE_ARMED:
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false))
- m_pObject->GetPosition().z = waterLevel + 0.6f;
+ m_pObject->GetMatrix().GetPosition().z = waterLevel + 0.6f;
m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame();
@@ -337,7 +337,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
}
case PICKUP_FLOATINGPACKAGE:
m_pObject->m_vecMoveSpeed.z -= 0.01f * CTimer::GetTimeStep();
- m_pObject->GetPosition() += m_pObject->GetMoveSpeed() * CTimer::GetTimeStep();
+ m_pObject->GetMatrix().GetPosition() += m_pObject->GetMoveSpeed() * CTimer::GetTimeStep();
m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame();
@@ -346,7 +346,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
break;
case PICKUP_FLOATINGPACKAGE_FLOATING:
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, 0))
- m_pObject->GetPosition().z = waterLevel;
+ m_pObject->GetMatrix().GetPosition().z = waterLevel;
m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame();
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 43d817b7..b760ae28 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -3794,7 +3794,7 @@ CCam::Process_Debug(const CVector&, float, float, float)
if(FindPlayerVehicle())
FindPlayerVehicle()->Teleport(Source);
else
- CWorld::Players[CWorld::PlayerInFocus].m_pPed->GetPosition() = Source;
+ CWorld::Players[CWorld::PlayerInFocus].m_pPed->SetPosition(Source);
}
// stay inside sectors
@@ -3941,7 +3941,7 @@ CCam::Process_Editor(const CVector&, float, float, float)
if(FindPlayerVehicle())
FindPlayerVehicle()->Teleport(Source);
else
- CWorld::Players[CWorld::PlayerInFocus].m_pPed->GetPosition() = Source;
+ CWorld::Players[CWorld::PlayerInFocus].m_pPed->SetPosition(Source);
}
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 7dbadd74..f4b81cb4 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -104,7 +104,7 @@ void TankCheat()
if (tank != nil) {
CVector pos = ThePaths.m_pathNodes[node].pos;
pos.z += 4.0f;
- tank->GetPosition() = pos;
+ tank->SetPosition(pos);
tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f));
tank->SetStatus(STATUS_ABANDONED);
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 3d1429bd..b4c22068 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -524,7 +524,7 @@ void CRadar::DrawBlips()
} else {
#ifdef TRIANGULAR_BLIPS
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
- CVector &blipPos = blipEntity->GetPosition();
+ const CVector &blipPos = blipEntity->GetPosition();
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
if (blipPos.z - pos.z <= 2.0f) {
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
@@ -630,7 +630,7 @@ void CRadar::DrawBlips()
#ifdef TRIANGULAR_BLIPS
{
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
- CVector &blipPos = blipEntity->GetPosition();
+ const CVector &blipPos = blipEntity->GetPosition();
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
if (blipPos.z - pos.z <= 2.0f) {
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp
index 7a221f39..5ce18a4d 100644
--- a/src/core/ZoneCull.cpp
+++ b/src/core/ZoneCull.cpp
@@ -522,7 +522,7 @@ CCullZone::CalcDistToCullZoneSquared(float x, float y)
bool
CCullZone::IsEntityCloseEnoughToZone(CEntity *entity, bool checkLevel)
{
- CVector &pos = entity->GetPosition();
+ const CVector &pos = entity->GetPosition();
CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(entity->GetModelIndex());
float distToZone = CalcDistToCullZone(pos.x, pos.y);
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 5ef3c036..e6409523 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -116,11 +116,11 @@ SpawnCar(int id)
DebugMenuEntrySetAddress(carCol2, &v->m_currentColour2);
if(CModelInfo::IsBoatModel(id))
- v->GetPosition() = TheCamera.GetPosition() + TheCamera.GetForward()*15.0f;
+ v->SetPosition(TheCamera.GetPosition() + TheCamera.GetForward()*15.0f);
else
- v->GetPosition() = ThePaths.m_pathNodes[node].pos;
+ v->SetPosition(ThePaths.m_pathNodes[node].pos);
- v->GetPosition().z += 4.0f;
+ v->GetMatrix().GetPosition().z += 4.0f;
v->SetOrientation(0.0f, 0.0f, 3.49f);
v->SetStatus(STATUS_ABANDONED);
v->m_nDoorLock = CARLOCK_UNLOCKED;
diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp
index 1ea10e92..3dd80546 100644
--- a/src/objects/ParticleObject.cpp
+++ b/src/objects/ParticleObject.cpp
@@ -137,7 +137,7 @@ CParticleObject::AddObject(uint16 type, CVector const &pos, CVector const &targe
pobj->m_nState = POBJECTSTATE_UPDATE_CLOSE;
pobj->m_Type = (eParticleObjectType)type;
- pobj->GetPosition() = pos;
+ pobj->SetPosition(pos);
pobj->m_vecTarget = target;
pobj->m_nNumEffectCycles = 1;
@@ -1174,7 +1174,7 @@ CParticleObject::LoadParticle(uint8 *buffer, uint32 length)
dst->m_nState = POBJECTSTATE_UPDATE_CLOSE;
dst->m_Type = src->m_Type;
dst->m_ParticleType = src->m_ParticleType;
- dst->GetPosition() = src->GetPosition();
+ dst->SetPosition(src->GetPosition());
dst->m_vecTarget = src->m_vecTarget;
dst->m_nFrameCounter = src->m_nFrameCounter;
dst->m_bRemove = src->m_bRemove;
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index 9a4dbcfe..6f17013c 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -647,7 +647,7 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
}
object->bGlassBroken = true;
- object->GetPosition().z = -100.0f;
+ object->GetMatrix().GetPosition().z = -100.0f;
}
void
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 4593966f..e38c93ae 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1213,7 +1213,7 @@ CAutomobile::Teleport(CVector pos)
{
CWorld::Remove(this);
- GetPosition() = pos;
+ SetPosition(pos);
SetOrientation(0.0f, 0.0f, 0.0f);
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 615511bd..5e75dc21 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -513,7 +513,7 @@ CBoat::ProcessControl(void)
// is this some inlined CPlaceable method?
CVector pos = GetPosition();
GetMatrix().RotateZ(m_fOrientation - GetForward().Heading());
- GetPosition() = pos;
+ GetMatrix().GetPosition() = pos;
}
}
@@ -673,7 +673,7 @@ CBoat::BlowUpCar(CEntity *culprit)
dist.Normalise();
if(GetUp().z > 0.0f)
dist += GetUp();
- obj->GetPosition() += GetUp();
+ obj->GetMatrix().GetPosition() += GetUp();
CWorld::Add(obj);
@@ -764,7 +764,7 @@ void
CBoat::Teleport(CVector v)
{
CWorld::Remove(this);
- GetPosition() = v;
+ SetPosition(v);
SetOrientation(0.0f, 0.0f, 0.0f);
SetMoveSpeed(0.0f, 0.0f, 0.0f);
SetTurnSpeed(0.0f, 0.0f, 0.0f);
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp
index c04e8c35..72b6c30c 100644
--- a/src/vehicles/CarGen.cpp
+++ b/src/vehicles/CarGen.cpp
@@ -59,7 +59,7 @@ void CCarGenerator::DoInternalProcessing()
if (pos.z <= -100.0f)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
pos.z += pBoat->GetDistanceFromCentreOfMassToBaseOfModel();
- pBoat->GetPosition() = pos;
+ pBoat->SetPosition(pos);
pBoat->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
pBoat->SetStatus(STATUS_ABANDONED);
pBoat->m_nDoorLock = CARLOCK_UNLOCKED;
@@ -93,7 +93,7 @@ void CCarGenerator::DoInternalProcessing()
pCar->bIsStatic = false;
pCar->bEngineOn = false;
pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel();
- pCar->GetPosition() = pos;
+ pCar->SetPosition(pos);
pCar->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
pCar->SetStatus(STATUS_ABANDONED);
pCar->bLightsOn = false;
diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp
index 725c9e87..1cace3e1 100644
--- a/src/vehicles/Cranes.cpp
+++ b/src/vehicles/Cranes.cpp
@@ -340,7 +340,7 @@ void CCrane::Update(void)
case GOING_TOWARDS_TARGET_ONLY_HEIGHT:
case ROTATING_TARGET:
if (m_pVehiclePickedUp) {
- m_pVehiclePickedUp->GetPosition() = CVector(m_vecHookCurPos.x, m_vecHookCurPos.y, m_vecHookCurPos.z - m_pVehiclePickedUp->GetColModel()->boundingBox.max.z);
+ m_pVehiclePickedUp->SetPosition(m_vecHookCurPos.x, m_vecHookCurPos.y, m_vecHookCurPos.z - m_pVehiclePickedUp->GetColModel()->boundingBox.max.z);
m_pVehiclePickedUp->SetMoveSpeed(0.0f, 0.0f, 0.0f);
CVector up(vecHook.x - m_vecHookCurPos.x, vecHook.y - m_vecHookCurPos.y, 20.0f);
up.Normalise();
@@ -585,7 +585,7 @@ void CCrane::SetHookMatrix()
{
if (m_pHook == nil)
return;
- m_pHook->GetPosition() = m_vecHookCurPos;
+ m_pHook->SetPosition(m_vecHookCurPos);
CVector up(m_vecHookInitPos.x - m_vecHookCurPos.x, m_vecHookInitPos.y - m_vecHookCurPos.y, 20.0f);
up.Normalise();
m_pHook->GetRight() = CrossProduct(CVector(0.0f, 1.0f, 0.0f), up);
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index dd2c4e57..e4cd5883 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -144,11 +144,11 @@ CHeli::ProcessControl(void)
if(GetPosition().z > 31.55f)
break;
m_pathState = 7;
- GetPosition().z = 31.55f;
+ GetMatrix().GetPosition().z = 31.55f;
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
break;
case 7:
- GetPosition().z = 31.55f;
+ GetMatrix().GetPosition().z = 31.55f;
target = GetPosition();
break;
@@ -214,8 +214,8 @@ CHeli::ProcessControl(void)
vTargetDist = target - GetPosition();
m_fTargetZ = target.z;
if(m_pathState == 6){
- GetPosition().x = GetPosition().x*0.99f + target.x*0.01f;
- GetPosition().y = GetPosition().y*0.99f + target.y*0.01f;
+ GetMatrix().GetPosition().x = GetMatrix().GetPosition().x*0.99f + target.x*0.01f;
+ GetMatrix().GetPosition().y = GetMatrix().GetPosition().y*0.99f + target.y*0.01f;
}
}else{
vTargetDist = FindPlayerCoors() - GetPosition();
@@ -367,8 +367,8 @@ CHeli::ProcessControl(void)
m_vecMoveSpeed.x += speedDir.x*speedInc;
m_vecMoveSpeed.y += speedDir.y*speedInc;
}
- GetPosition().x += m_vecMoveSpeed.x*CTimer::GetTimeStep();
- GetPosition().y += m_vecMoveSpeed.y*CTimer::GetTimeStep();
+ GetMatrix().GetPosition().x += m_vecMoveSpeed.x*CTimer::GetTimeStep();
+ GetMatrix().GetPosition().y += m_vecMoveSpeed.y*CTimer::GetTimeStep();
// Find z target
if(m_heliStatus == HELI_STATUS_FLY_AWAY)
@@ -389,7 +389,7 @@ CHeli::ProcessControl(void)
m_vecMoveSpeed.z -= speedIncZ;
else
m_vecMoveSpeed.z += speedIncZ*1.5f;
- GetPosition().z += m_vecMoveSpeed.z*CTimer::GetTimeStep();
+ GetMatrix().GetPosition().z += m_vecMoveSpeed.z*CTimer::GetTimeStep();
// Find angular speed
float targetAngularSpeed;