Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fun with physics
  • Loading branch information
Filip Gawin committed Nov 24, 2020
1 parent 70d8bdc commit e7ae8a877cb90cb7e4cdd310212143ed894fb9d1
Showing with 508 additions and 271 deletions.
  1. +1 −1 CMakeLists.txt
  2. +2 −3 src/CMakeLists.txt
  3. +5 −5 src/animation/CutsceneMgr.cpp
  4. +1 −1 src/audio/DMAudio.cpp
  5. +5 −5 src/collision/Collision.cpp
  6. +1 −1 src/control/Bridge.cpp
  7. +3 −3 src/control/CarAI.cpp
  8. +5 −5 src/control/CarCtrl.cpp
  9. +2 −2 src/control/Darkel.cpp
  10. +2 −2 src/control/GameLogic.cpp
  11. +6 −6 src/control/Garages.cpp
  12. +2 −2 src/control/Phones.cpp
  13. +5 −5 src/control/Pickups.cpp
  14. +7 −7 src/control/Record.cpp
  15. +4 −4 src/control/Replay.cpp
  16. +3 −3 src/control/RoadBlocks.cpp
  17. +1 −2 src/control/Script.cpp
  18. +9 −9 src/control/TrafficLights.cpp
  19. +1 −1 src/core/Cam.cpp
  20. +6 −6 src/core/Camera.cpp
  21. +1 −1 src/core/Camera.h
  22. +1 −1 src/core/CdStreamPosix.cpp
  23. +4 −4 src/core/FileLoader.cpp
  24. +3 −3 src/core/Frontend.cpp
  25. +22 −3 src/core/Game.cpp
  26. +4 −2 src/core/Game.h
  27. +8 −3 src/core/Placeable.h
  28. +4 −4 src/core/PlayerInfo.cpp
  29. +3 −3 src/core/Pools.cpp
  30. +6 −4 src/core/Timer.cpp
  31. +4 −2 src/core/Timer.h
  32. +4 −4 src/core/World.cpp
  33. +2 −2 src/core/ZoneCull.cpp
  34. +2 −2 src/core/Zones.cpp
  35. +54 −19 src/core/main.cpp
  36. +16 −5 src/entities/Entity.cpp
  37. +2 −1 src/entities/Entity.h
  38. +6 −6 src/entities/Physical.cpp
  39. +144 −9 src/math/Matrix.cpp
  40. +24 −8 src/math/Matrix.h
  41. +10 −1 src/math/Vector.cpp
  42. +3 −2 src/math/Vector.h
  43. +2 −2 src/objects/CutsceneHead.cpp
  44. +2 −2 src/objects/ParticleObject.cpp
  45. +2 −2 src/peds/CopPed.cpp
  46. +15 −15 src/peds/Ped.cpp
  47. +4 −4 src/peds/PedAI.cpp
  48. +2 −2 src/peds/PlayerPed.cpp
  49. +3 −3 src/peds/Population.cpp
  50. +2 −2 src/render/Clouds.cpp
  51. +2 −2 src/render/Coronas.cpp
  52. +5 −5 src/render/Fluff.cpp
  53. +2 −2 src/render/Particle.cpp
  54. +1 −1 src/render/Renderer.cpp
  55. +5 −5 src/render/Rubbish.cpp
  56. +3 −3 src/render/SpecialFX.cpp
  57. +3 −3 src/render/SpecialFX.h
  58. +2 −2 src/render/WaterCannon.cpp
  59. +3 −3 src/render/Weather.cpp
  60. +1 −1 src/rw/RwHelper.cpp
  61. +28 −27 src/vehicles/Automobile.cpp
  62. +3 −3 src/vehicles/Boat.cpp
  63. +3 −3 src/vehicles/Heli.cpp
  64. +5 −5 src/vehicles/Plane.cpp
  65. +4 −4 src/vehicles/Train.cpp
  66. +3 −3 src/weapons/Explosion.cpp
  67. +2 −2 src/weapons/ShotInfo.cpp
  68. +3 −3 src/weapons/Weapon.cpp
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.8)

project(re3 C CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
@@ -1,4 +1,4 @@
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if(${RE3_AUDIO} STREQUAL "OAL")
@@ -76,7 +76,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang
PRIVATE
"-Wextra"
"-Wdouble-promotion"
"-Wpedantic"
)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
@@ -91,7 +90,7 @@ set_target_properties(re3
C_STANDARD 11
C_EXTENSIONS OFF
C_STANDARD_REQUIRED ON
CXX_STANDARD 11
CXX_STANDARD 14
CXX_EXTENSIONS OFF
CXX_STANDARD_REQUIRED ON
PREFIX ""
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "General.h"
#include "CutsceneMgr.h"
@@ -225,7 +225,7 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName)
ms_cutsceneOffset = CVector(0.0f, 0.0f, 0.0f);

pPlayerPed = FindPlayerPed();
CTimer::Update();
//CTimer::Update(1000/30);

pPlayerPed->m_pWanted->ClearQdCrimes();
pPlayerPed->bIsVisible = false;
@@ -275,8 +275,8 @@ CCutsceneMgr::SetupCutsceneToStart(void)
}
}

CTimer::Update();
CTimer::Update();
//CTimer::Update(1000/30);
//CTimer::Update(1000/30);
ms_running = true;
ms_cutsceneTimer = 0.0f;
}
@@ -375,7 +375,7 @@ CCutsceneMgr::DeleteCutsceneData(void)
}
CTimer::Stop();
CGame::DrasticTidyUpMemory(TheCamera.GetScreenFadeStatus() == FADE_2);
CTimer::Update();
//CTimer::Update(1000/30);
}

void
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "DMAudio.h"
#include "MusicManager.h"
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "VuVector.h"
#include "main.h"
@@ -2106,7 +2106,7 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
assert(modelA.numLines <= MAXNUMLINES);

// From model A space to model B space
matAB = Invert(matrixB, matAB);
matAB.save(Invert(matrixB, matAB));
matAB *= matrixA;

CColSphere bsphereAB; // bounding sphere of A in B space
@@ -2115,7 +2115,7 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
if(!TestSphereBox(bsphereAB, modelB.boundingBox))
return 0;
// B to A space
matBA = Invert(matrixA, matBA);
matBA.save(Invert(matrixA, matBA));
matBA *= matrixB;

// transform modelA's spheres and lines to B space
@@ -2592,7 +2592,7 @@ CCollision::DrawColModel_Coloured(const CMatrix &mat, const CColModel &colModel,

if(s == SURFACE_TRANSPARENT_CLOTH || s == SURFACE_METAL_CHAIN_FENCE ||
s == SURFACE_TRANSPARENT_STONE || s == SURFACE_SCAFFOLD_POLE)
if(CTimer::GetFrameCounter() & 1){
if(CTimer::GetTickCounter() & 1){
r = 0;
g = 0;
b = 0;
@@ -2673,7 +2673,7 @@ CCollision::DrawColModel_Coloured(const CMatrix &mat, const CColModel &colModel,

if(s == SURFACE_TRANSPARENT_CLOTH || s == SURFACE_METAL_CHAIN_FENCE ||
s == SURFACE_TRANSPARENT_STONE || s == SURFACE_SCAFFOLD_POLE)
if(CTimer::GetFrameCounter() & 1){
if(CTimer::GetTickCounter() & 1){
r = 0;
g = 0;
b = 0;
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "Bridge.h"
#include "Pools.h"
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "CarAI.h"

@@ -204,7 +204,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
}
else if (distance > FindSwitchDistanceFarNormalVehicle(pVehicle) && !pVehicle->AutoPilot.m_bIgnorePathfinding && (CTimer::GetFrameCounter() & 7) == 0){
else if (distance > FindSwitchDistanceFarNormalVehicle(pVehicle) && !pVehicle->AutoPilot.m_bIgnorePathfinding && (CTimer::GetTickCounter() & 7) == 0){
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
pVehicle->AutoPilot.m_nCarMission = (CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, pVehicle->AutoPilot.m_vecDestinationCoors, true)) ?
MISSION_GOTOCOORDS_STRAIGHT : MISSION_GOTOCOORDS;
@@ -260,7 +260,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
}
else if (distance > FindSwitchDistanceFarNormalVehicle(pVehicle) && !pVehicle->AutoPilot.m_bIgnorePathfinding && (CTimer::GetFrameCounter() & 7) == 0) {
else if (distance > FindSwitchDistanceFarNormalVehicle(pVehicle) && !pVehicle->AutoPilot.m_bIgnorePathfinding && (CTimer::GetTickCounter() & 7) == 0) {
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
pVehicle->AutoPilot.m_nCarMission = (CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, pVehicle->AutoPilot.m_vecDestinationCoors, true)) ?
MISSION_GOTO_COORDS_STRAIGHT_ACCURATE : MISSION_GOTOCOORDS_ACCURATE;
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "CarCtrl.h"

@@ -168,7 +168,7 @@ CCarCtrl::GenerateOneRandomCar()
testForCollision = true;
frontX = TheCamera.CamFrontXNorm;
frontY = TheCamera.CamFrontYNorm;
switch (CTimer::GetFrameCounter() & 1) {
switch (CTimer::GetTickCounter() & 1) {
case 0:
/* Spawn a vehicle relatively far away from player. */
/* Forward to his current direction (camera direction). */
@@ -190,7 +190,7 @@ CCarCtrl::GenerateOneRandomCar()
frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
frontY = vecPlayerVehicleSpeed.y / fPlayerVehicleSpeed;
testForCollision = false;
switch (CTimer::GetFrameCounter() & 3) {
switch (CTimer::GetTickCounter() & 3) {
case 0:
case 1:
/* Spawn a vehicle in a very narrow gap in front of a player */
@@ -219,7 +219,7 @@ CCarCtrl::GenerateOneRandomCar()
frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
frontY = vecPlayerVehicleSpeed.y / fPlayerVehicleSpeed;
testForCollision = false;
switch (CTimer::GetFrameCounter() & 3) {
switch (CTimer::GetTickCounter() & 3) {
case 0:
/* Spawn a vehicle in a very narrow gap in front of a player */
angleLimit = 0.85f; /* approx 30 degrees */
@@ -248,7 +248,7 @@ CCarCtrl::GenerateOneRandomCar()
testForCollision = true;
frontX = TheCamera.CamFrontXNorm;
frontY = TheCamera.CamFrontYNorm;
switch (CTimer::GetFrameCounter() & 1) {
switch (CTimer::GetTickCounter() & 1) {
case 0:
/* Spawn a vehicle relatively far away from player. */
/* Forward to his current direction (camera direction). */
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "main.h"
#include "Darkel.h"
@@ -105,7 +105,7 @@ CDarkel::DrawMessages()
uint32 timeLeft = CDarkel::TimeLimit - (CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart);
sprintf(gString, "%d:%02d", timeLeft / 60000, timeLeft % 60000 / 1000);
AsciiToUnicode(gString, gUString);
if (timeLeft > 4000 || CTimer::GetFrameCounter() & 1) {
if (timeLeft > 4000 || CTimer::GetTickCounter() & 1) {
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(109.0f), gUString);
CFont::SetColor(CRGBA(150, 100, 255, 255));
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "GameLogic.h"
#include "Clock.h"
@@ -60,7 +60,7 @@ CGameLogic::SortOutStreamingAndMemory(const CVector &pos)
CStreaming::RemoveUnusedModelsInLoadedList();
CGame::DrasticTidyUpMemory(true);
CStreaming::LoadScene(pos);
CTimer::Update();
//CTimer::Update(1000/30);
}

void
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "Garages.h"
#include "main.h"
@@ -190,7 +190,7 @@ void CGarages::Update(void)
if (aGarages[i].IsUsed())
aGarages[i].Update();
}
if ((CTimer::GetFrameCounter() & 0xF) != 0xC)
if ((CTimer::GetTickCounter() & 0xF) != 0xC)
return;
if (++GarageToBeTidied >= NUM_GARAGES)
GarageToBeTidied = 0;
@@ -593,7 +593,7 @@ void CGarage::Update()
switch (m_eGarageState) {
case GS_OPENED:
if (((CVector2D)FindPlayerCoors() - CVector2D(GetGarageCenterX(), GetGarageCenterY())).MagnitudeSqr() > SQR(DISTANCE_TO_CLOSE_MISSION_GARAGE)) {
if ((CTimer::GetFrameCounter() & 0x1F) == 0 && !IsAnyOtherCarTouchingGarage(nil)) {
if ((CTimer::GetTickCounter() & 0x1F) == 0 && !IsAnyOtherCarTouchingGarage(nil)) {
m_eGarageState = GS_CLOSING;
m_bClosingWithoutTargetCar = true;
}
@@ -859,8 +859,8 @@ void CGarage::Update()
switch (m_eGarageState) {
case GS_OPENED:
{
int i = CPools::GetVehiclePool()->GetSize() * (CTimer::GetFrameCounter() % CRUSHER_VEHICLE_TEST_SPAN) / CRUSHER_VEHICLE_TEST_SPAN;
int end = CPools::GetVehiclePool()->GetSize() * (CTimer::GetFrameCounter() % CRUSHER_VEHICLE_TEST_SPAN + 1) / CRUSHER_VEHICLE_TEST_SPAN;
int i = CPools::GetVehiclePool()->GetSize() * (CTimer::GetTickCounter() % CRUSHER_VEHICLE_TEST_SPAN) / CRUSHER_VEHICLE_TEST_SPAN;
int end = CPools::GetVehiclePool()->GetSize() * (CTimer::GetTickCounter() % CRUSHER_VEHICLE_TEST_SPAN + 1) / CRUSHER_VEHICLE_TEST_SPAN;
for (; i < end; i++) {
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
if (!pVehicle)
@@ -923,7 +923,7 @@ void CGarage::Update()
default:
break;
}
if (!FindPlayerVehicle() && (CTimer::GetFrameCounter() & 0x1F) == 0x17 && IsEntityEntirelyInside(FindPlayerPed()))
if (!FindPlayerVehicle() && (CTimer::GetTickCounter() & 0x1F) == 0x17 && IsEntityEntirelyInside(FindPlayerPed()))
FindPlayerPed()->InflictDamage(nil, WEAPONTYPE_RAMMEDBYCAR, 300.0f, PEDPIECE_TORSO, 0);
break;
case GARAGE_MISSION_KEEPCAR:
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "Phones.h"
#include "Pools.h"
@@ -148,7 +148,7 @@ CPhoneInfo::Update(void)
}
if (CVector2D(TheCamera.GetPosition() - m_aPhones[phoneId].m_vecPos).MagnitudeSqr() > sq(100.0f))
m_aPhones[phoneId].m_visibleToCam = false;
} else if (!((CTimer::GetFrameCounter() + m_aPhones[phoneId].m_pEntity->m_randomSeed) % 16)) {
} else if (!((CTimer::GetTickCounter() + m_aPhones[phoneId].m_pEntity->m_randomSeed) % 16)) {
if (CVector2D(TheCamera.GetPosition() - m_aPhones[phoneId].m_vecPos).MagnitudeSqr() < sq(60.0f))
m_aPhones[phoneId].m_visibleToCam = true;
}
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "main.h"

@@ -666,9 +666,9 @@ CPickups::Update()
#endif
#define PICKUPS_FRAME_SPAN (6)
#ifdef FIX_BUGS
for (uint32 i = NUMGENERALPICKUPS * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN) / PICKUPS_FRAME_SPAN; i < NUMGENERALPICKUPS * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN + 1) / PICKUPS_FRAME_SPAN; i++) {
for (uint32 i = NUMGENERALPICKUPS * (CTimer::GetTickCounter() % PICKUPS_FRAME_SPAN) / PICKUPS_FRAME_SPAN; i < NUMGENERALPICKUPS * (CTimer::GetTickCounter() % PICKUPS_FRAME_SPAN + 1) / PICKUPS_FRAME_SPAN; i++) {
#else // BUG: this code can only reach 318 out of 320 pickups
for (uint32 i = NUMGENERALPICKUPS / PICKUPS_FRAME_SPAN * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN); i < NUMGENERALPICKUPS / PICKUPS_FRAME_SPAN * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN + 1); i++) {
for (uint32 i = NUMGENERALPICKUPS / PICKUPS_FRAME_SPAN * (CTimer::GetTickCounter() % PICKUPS_FRAME_SPAN); i < NUMGENERALPICKUPS / PICKUPS_FRAME_SPAN * (CTimer::GetTickCounter() % PICKUPS_FRAME_SPAN + 1); i++) {
#endif
if (aPickUps[i].m_eType != PICKUP_NONE && aPickUps[i].Update(FindPlayerPed(), FindPlayerVehicle(), CWorld::PlayerInFocus)) {
AddToCollectedPickupsArray(i);
@@ -1111,7 +1111,7 @@ CPacManPickups::Update()
}
if (bPMActive) {
#define PACMANPICKUPS_FRAME_SPAN (4)
for (uint32 i = (CTimer::GetFrameCounter() % PACMANPICKUPS_FRAME_SPAN) * (NUMPACMANPICKUPS / PACMANPICKUPS_FRAME_SPAN); i < ((CTimer::GetFrameCounter() % PACMANPICKUPS_FRAME_SPAN) + 1) * (NUMPACMANPICKUPS / PACMANPICKUPS_FRAME_SPAN); i++) {
for (uint32 i = (CTimer::GetTickCounter() % PACMANPICKUPS_FRAME_SPAN) * (NUMPACMANPICKUPS / PACMANPICKUPS_FRAME_SPAN); i < ((CTimer::GetTickCounter() % PACMANPICKUPS_FRAME_SPAN) + 1) * (NUMPACMANPICKUPS / PACMANPICKUPS_FRAME_SPAN); i++) {
if (aPMPickUps[i].m_eType != PACMAN_NONE)
aPMPickUps[i].Update();
}
@@ -1343,7 +1343,7 @@ CPacManPickups::Render()
if (CSprite::CalcScreenCoors(aPMPickUps[i].m_vecPosn, &pos, &w, &h, true) && pos.z < 100.0f) {
if (aPMPickUps[i].m_pObject != nil) {
aPMPickUps[i].m_pObject->GetMatrix().SetRotateZOnly((CTimer::GetTimeInMilliseconds() % 1024) * TWOPI / 1024.0f);
aPMPickUps[i].m_pObject->GetMatrix().UpdateRW();
aPMPickUps[i].m_pObject->GetMatrix().UpdateRWInterPolated();
aPMPickUps[i].m_pObject->UpdateRwFrame();
}
float fsin = Sin((CTimer::GetTimeInMilliseconds() % 1024) * 6.28f / 1024.0f); // yes, it is 6.28f when it was TWOPI just now...
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "Record.h"

@@ -209,8 +209,8 @@ void CRecordDataForChase::SaveOrRetrieveDataForThisFrame(void)
return;
case STATE_RECORD:
{
if ((CTimer::GetFrameCounter() & 1) == 0)
StoreInfoForCar(pChaseCars[CurrentCar], &pBaseMemForCar[CurrentCar][CTimer::GetFrameCounter() / 2]);
if ((CTimer::GetTickCounter() & 1) == 0)
StoreInfoForCar(pChaseCars[CurrentCar], &pBaseMemForCar[CurrentCar][CTimer::GetTickCounter() / 2]);
if (CTimer::GetFrameCounter() < CHASE_SCENE_LENGTH_IN_FRAMES * 2)
return;
CFileMgr::SetDir("data\\paths");
@@ -267,14 +267,14 @@ void CRecordDataForChase::SaveOrRetrieveCarPositions(void)
case STATE_RECORD:
case STATE_PLAYBACK_BEFORE_RECORDING:
for (int i = 0; i < NUM_CHASE_CARS; i++) {
if (i != CurrentCar && CTimer::GetFrameCounter()) {
RestoreInfoForCar(pChaseCars[i], &pBaseMemForCar[i][CTimer::GetFrameCounter() / 2], false);
if (i != CurrentCar && CTimer::GetTickCounter()) {
RestoreInfoForCar(pChaseCars[i], &pBaseMemForCar[i][CTimer::GetTickCounter() / 2], false);
pChaseCars[i]->GetMatrix().UpdateRW();
pChaseCars[i]->UpdateRwFrame();
}
}
if (Status == STATE_PLAYBACK_BEFORE_RECORDING && CTimer::GetFrameCounter()) {
RestoreInfoForCar(pChaseCars[CurrentCar], &pBaseMemForCar[CurrentCar][CTimer::GetFrameCounter() / 2], false);
if (Status == STATE_PLAYBACK_BEFORE_RECORDING && CTimer::GetTickCounter()) {
RestoreInfoForCar(pChaseCars[CurrentCar], &pBaseMemForCar[CurrentCar][CTimer::GetTickCounter() / 2], false);
pChaseCars[CurrentCar]->GetMatrix().UpdateRW();
pChaseCars[CurrentCar]->UpdateRwFrame();
}
@@ -1,4 +1,4 @@
#include "common.h"
#include "common.h"

#include "AnimBlendAssociation.h"
#include "Boat.h"
@@ -492,7 +492,7 @@ void CReplay::ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayB
ped->m_fRotationDest = pp->heading * PI / 128.0f;
CMatrix ped_matrix;
pp->matrix.DecompressIntoFullMatrix(ped_matrix);
ped->GetMatrix() = ped->GetMatrix() * CMatrix(1.0f - interpolation);
ped->GetMatrix().save(ped->GetMatrix() * CMatrix(1.0f - interpolation));
ped->GetMatrix().GetPosition() *= (1.0f - interpolation);
ped->GetMatrix() += CMatrix(interpolation) * ped_matrix;
if (pp->vehicle_index) {
@@ -717,7 +717,7 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI
}
CMatrix vehicle_matrix;
vp->matrix.DecompressIntoFullMatrix(vehicle_matrix);
vehicle->GetMatrix() = vehicle->GetMatrix() * CMatrix(1.0f - interpolation);
vehicle->GetMatrix().save(vehicle->GetMatrix() * CMatrix(1.0f - interpolation));
vehicle->GetMatrix().GetPosition() *= (1.0f - interpolation);
vehicle->GetMatrix() += CMatrix(interpolation) * vehicle_matrix;
vehicle->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
@@ -896,7 +896,7 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo
case REPLAYPACKET_GENERAL:
{
tGeneralPacket* pg = (tGeneralPacket*)&ptr[offset];
TheCamera.GetMatrix() = TheCamera.GetMatrix() * CMatrix(split);
TheCamera.GetMatrix().save(TheCamera.GetMatrix() * CMatrix(split));
TheCamera.GetMatrix().GetPosition() *= split;
TheCamera.GetMatrix() += CMatrix(interpolation) * pg->camera_pos;
RwMatrix* pm = RwFrameGetMatrix(RwCameraGetFrame(TheCamera.m_pRwCamera));

0 comments on commit e7ae8a8

Please sign in to comment.