summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-04-23 10:58:38 +0200
committerGitHub <noreply@github.com>2020-04-23 10:58:38 +0200
commite1495ba9dfa118d105e767f8d0d2d9503e8d3b29 (patch)
treed461c5aca74e9679ec87d1e3d70a5e674a57ee21 /src/vehicles
parentMerge pull request #482 from withmorten/master (diff)
parentMerge branch 'master' into master (diff)
downloadre3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.tar
re3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.tar.gz
re3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.tar.bz2
re3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.tar.lz
re3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.tar.xz
re3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.tar.zst
re3-e1495ba9dfa118d105e767f8d0d2d9503e8d3b29.zip
Diffstat (limited to 'src/vehicles')
-rw-r--r--src/vehicles/Automobile.cpp86
-rw-r--r--src/vehicles/Boat.cpp55
2 files changed, 133 insertions, 8 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 1b14e7a2..74609e15 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -2848,6 +2848,7 @@ CAutomobile::ProcessBuoyancy(void)
static uint32 nGenerateWaterCircles = 0;
if(initialSpeed.z < -0.3f && impulse.z > 0.3f){
+#if defined(PC_PARTICLE) || defined (PS2_ALTERNATIVE_CARSPLASH)
RwRGBA color;
color.red = (0.5f * CTimeCycle::GetDirectionalRed() + CTimeCycle::GetAmbientRed())*0.45f*255;
color.green = (0.5f * CTimeCycle::GetDirectionalGreen() + CTimeCycle::GetAmbientGreen())*0.45f*255;
@@ -2856,6 +2857,30 @@ CAutomobile::ProcessBuoyancy(void)
CParticleObject::AddObject(POBJECT_CAR_WATER_SPLASH, GetPosition(),
CVector(0.0f, 0.0f, CGeneral::GetRandomNumberInRange(0.15f, 0.3f)),
0.0f, 75, color, true);
+#else
+ CVector pos = (initialSpeed * 2.0f) + (GetPosition() + point);
+
+ for ( int32 i = 0; i < 360; i += 4 )
+ {
+ float fSin = Sin(float(i));
+ float fCos = Cos(float(i));
+
+ CVector dir(fSin*0.01f, fCos*0.01f, CGeneral::GetRandomNumberInRange(0.25f, 0.45f));
+
+ CParticle::AddParticle(PARTICLE_CAR_SPLASH,
+ pos + CVector(fSin*4.5f, fCos*4.5f, 0.0f),
+ dir, NULL, 0.0f, CRGBA(225, 225, 255, 180));
+
+ for ( int32 j = 0; j < 3; j++ )
+ {
+ float fMul = 1.5f * float(j + 1);
+
+ CParticle::AddParticle(PARTICLE_CAR_SPLASH,
+ pos + CVector(fSin * fMul, fCos * fMul, 0.0f),
+ dir, NULL, 0.0f, CRGBA(225, 225, 255, 180));
+ }
+ }
+#endif
nGenerateRaindrops = CTimer::GetTimeInMilliseconds() + 300;
nGenerateWaterCircles = CTimer::GetTimeInMilliseconds() + 60;
@@ -2909,9 +2934,16 @@ CAutomobile::ProcessBuoyancy(void)
CVector pos = m_aWheelColPoints[i].point + 0.3f*GetUp() - GetPosition();
CVector vSpeed = GetSpeed(pos);
vSpeed.z = 0.0f;
+#ifdef GTA_PS2_STUFF
+ // ps2 puddle physics
+ CVector moveForce = CTimer::GetTimeStep() * (m_fMass * (vSpeed * -0.003f));
+ ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);
+#endif
float fSpeed = vSpeed.MagnitudeSqr();
+#ifdef PC_PARTICLE
if(fSpeed > sq(0.05f)){
fSpeed = Sqrt(fSpeed);
+
float size = Min((fSpeed < 0.15f ? 0.25f : 0.75f)*fSpeed, 0.6f);
CVector right = 0.2f*fSpeed*GetRight() + 0.2f*vSpeed;
@@ -2924,10 +2956,39 @@ CAutomobile::ProcessBuoyancy(void)
CParticle::AddParticle(PARTICLE_RUBBER_SMOKE,
pos + GetPosition(), -0.6f*right,
nil, size, smokeCol, 0, 0, 0, 0);
-
+
if((CTimer::GetFrameCounter() & 0xF) == 0)
DMAudio.PlayOneShot(m_audioEntityId, SOUND_CAR_SPLASH, 2000.0f*fSpeed);
}
+#else
+ if ( ( (CTimer::GetFrameCounter() + i) & 3 ) == 0 )
+ {
+ if(fSpeed > sq(0.05f))
+ {
+ fSpeed = Sqrt(fSpeed);
+ CRGBA color(155, 185, 155, 255);
+ float boxY = GetColModel()->boundingBox.max.y;
+ CVector right = 0.5f * GetRight();
+
+ if ( i == 2 )
+ {
+ CParticle::AddParticle(PARTICLE_PED_SPLASH,
+ GetPosition() + (boxY * GetForward()) + right,
+ 0.75f*m_vecMoveSpeed, NULL, 0.0f, color);
+
+ }
+ else if ( i == 0 )
+ {
+ CParticle::AddParticle(PARTICLE_PED_SPLASH,
+ GetPosition() + (boxY * GetForward()) - right,
+ 0.75f*m_vecMoveSpeed, NULL, 0.0f, color);
+ }
+
+ if((CTimer::GetFrameCounter() & 0xF) == 0)
+ DMAudio.PlayOneShot(m_audioEntityId, SOUND_CAR_SPLASH, 2000.0f*fSpeed);
+ }
+ }
+#endif
}
}
}
@@ -3486,14 +3547,29 @@ CAutomobile::AddWheelDirtAndWater(CColPoint *colpoint, uint32 belowEffectSpeed)
}
return 0;
default:
- // Is this even visible?
- if(CWeather::WetRoads > 0.01f && CTimer::GetFrameCounter() & 1){
- CParticle::AddParticle(PARTICLE_WATERSPRAY,
+ if ( CWeather::WetRoads > 0.01f
+#ifdef PC_PARTICLE
+ && CTimer::GetFrameCounter() & 1
+#endif
+ )
+ {
+ CParticle::AddParticle(
+#ifdef FIX_BUGS
+ PARTICLE_WHEEL_WATER,
+#else
+ PARTICLE_WATERSPRAY,
+#endif
colpoint->point + CVector(0.0f, 0.0f, 0.25f+0.25f),
- CVector(0.0f, 0.0f, 1.0f), nil,
+#ifdef PC_PARTICLE
+ CVector(0.0f, 0.0f, 1.0f),
+#else
+ CVector(0.0f, 0.0f, CGeneral::GetRandomNumberInRange(0.005f, 0.04f)),
+#endif
+ nil,
CGeneral::GetRandomNumberInRange(0.1f, 0.5f), waterCol);
return 0;
}
+
return 1;
}
}
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 42beeb6c..d31182cd 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -340,27 +340,46 @@ CBoat::ProcessControl(void)
else
jetPos.z = 0.0f;
+#ifdef PC_PARTICLE
CVector wakePos = GetPosition() + sternPos;
wakePos.z -= 0.65f;
+#else
+ CVector wakePos = GetPosition() + sternPos;
+ wakePos.z = -0.3f;
+#endif
CVector wakeDir = 0.75f * jetDir;
CParticle::AddParticle(PARTICLE_BOAT_THRUSTJET, jetPos, jetDir, nil, 0.0f, jetColor);
+#ifdef PC_PARTICLE
CParticle::AddParticle(PARTICLE_CAR_SPLASH, jetPos, 0.25f * jetDir, nil, 1.0f, splashColor,
CGeneral::GetRandomNumberInRange(0, 30),
CGeneral::GetRandomNumberInRange(0, 90), 3);
+#endif
if(!cameraHack)
CParticle::AddParticle(PARTICLE_BOAT_WAKE, wakePos, wakeDir, nil, 0.0f, jetColor);
}else if((CTimer::GetFrameCounter() + m_randomSeed) & 1){
+#ifdef PC_PARTICLE
jetDir.z = 0.018f;
jetDir.x *= 0.01f;
jetDir.y *= 0.01f;
propellerWorld.z += 1.5f;
-
+
CParticle::AddParticle(PARTICLE_BOAT_SPLASH, propellerWorld, jetDir, nil, 1.5f, jetColor);
+#else
+ jetDir.z = 0.018f;
+ jetDir.x *= 0.03f;
+ jetDir.y *= 0.03f;
+ propellerWorld.z += 1.0f;
+
+ CParticle::AddParticle(PARTICLE_BOAT_SPLASH, propellerWorld, jetDir, nil, 0.0f, jetColor);
+#endif
+
+#ifdef PC_PARTICLE
CParticle::AddParticle(PARTICLE_CAR_SPLASH, propellerWorld, 0.1f * jetDir, nil, 0.5f, splashColor,
CGeneral::GetRandomNumberInRange(0, 30),
CGeneral::GetRandomNumberInRange(0, 90), 3);
+#endif
}
}
}else if(!onLand){
@@ -416,36 +435,66 @@ CBoat::ProcessControl(void)
}
// Spray particles on sides of boat
- if(m_nDeltaVolumeUnderWater > 75){
+#ifdef PC_PARTICLE
+ if(m_nDeltaVolumeUnderWater > 75)
+#else
+ if(m_nDeltaVolumeUnderWater > 120)
+#endif
+ {
float speed = m_vecMoveSpeed.Magnitude();
float splash1Size = speed;
- float splash2Size = m_nDeltaVolumeUnderWater * 0.005f * 0.2f;
+ float splash2Size = float(m_nDeltaVolumeUnderWater) * 0.005f * 0.2f;
float front = 0.9f * GetColModel()->boundingBox.max.y;
if(splash1Size > 0.75f) splash1Size = 0.75f;
CVector dir, pos;
// right
+#ifdef PC_PARTICLE
dir = -0.5f*m_vecMoveSpeed;
dir.z += 0.1f*speed;
dir += 0.5f*GetRight()*speed;
pos = front*GetForward() + 0.5f*GetRight() + GetPosition() + m_vecBuoyancePoint;
CWaterLevel::GetWaterLevel(pos, &pos.z, true);
+#else
+ dir = 0.3f*m_vecMoveSpeed;
+ dir.z += 0.05f*speed;
+ dir += 0.5f*GetRight()*speed;
+ pos = (GetPosition() + m_vecBuoyancePoint) + (1.5f*GetRight());
+#endif
+
+#ifdef PC_PARTICLE
CParticle::AddParticle(PARTICLE_CAR_SPLASH, pos, 0.75f * dir, nil, splash1Size, splashColor,
CGeneral::GetRandomNumberInRange(0, 30),
CGeneral::GetRandomNumberInRange(0, 90), 1);
CParticle::AddParticle(PARTICLE_BOAT_SPLASH, pos, dir, nil, splash2Size, jetColor);
+#else
+ CParticle::AddParticle(PARTICLE_BOAT_SPLASH, pos, dir, nil, splash2Size);
+#endif
+
// left
+#ifdef PC_PARTICLE
dir = -0.5f*m_vecMoveSpeed;
dir.z += 0.1f*speed;
dir -= 0.5f*GetRight()*speed;
pos = front*GetForward() - 0.5f*GetRight() + GetPosition() + m_vecBuoyancePoint;
CWaterLevel::GetWaterLevel(pos, &pos.z, true);
+#else
+ dir = 0.3f*m_vecMoveSpeed;
+ dir.z += 0.05f*speed;
+ dir -= 0.5f*GetRight()*speed;
+ pos = (GetPosition() + m_vecBuoyancePoint) - (1.5f*GetRight());
+#endif
+
+#ifdef PC_PARTICLE
CParticle::AddParticle(PARTICLE_CAR_SPLASH, pos, 0.75f * dir, nil, splash1Size, splashColor,
CGeneral::GetRandomNumberInRange(0, 30),
CGeneral::GetRandomNumberInRange(0, 90), 1);
CParticle::AddParticle(PARTICLE_BOAT_SPLASH, pos, dir, nil, splash2Size, jetColor);
+#else
+ CParticle::AddParticle(PARTICLE_BOAT_SPLASH, pos, dir, nil, splash2Size);
+#endif
}
m_fPrevVolumeUnderWater = m_fVolumeUnderWater;