Skip to content

Commit 1865364

Browse files
committed
fix Tank/Truck particles on water
1 parent 938c974 commit 1865364

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankDraw.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ void W3DTankDraw::doDrawModule(const Matrix3D* transformMtx)
320320
// if tank is moving, kick up dust and debris
321321
Real velMag = vel->x*vel->x + vel->y*vel->y; // only care about moving on the ground
322322

323-
const Bool doStartMoveDebris = velMag > DEBRIS_THRESHOLD && !getDrawable()->isDrawableEffectivelyHidden() && !getFullyObscuredByShroud();
323+
const Bool doStartMoveDebris = velMag > DEBRIS_THRESHOLD && !getDrawable()->isDrawableEffectivelyHidden() && !getFullyObscuredByShroud() &&
324+
!(obj->isKindOf(KINDOF_NO_MOVE_EFFECTS_ON_WATER) && obj->isOverWater());
324325

325326
// kick debris higher the faster we move
326327
Coord3D velMult;

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ void W3DTankTruckDraw::doDrawModule(const Matrix3D* transformMtx)
605605

606606
Bool wasPowersliding = m_isPowersliding;
607607
m_isPowersliding = false;
608-
if (physics->isMotive() && !obj->isSignificantlyAboveTerrain()) {
608+
if (physics->isMotive() && !obj->isSignificantlyAboveTerrain() && !overWater) {
609609
enableWheelEmitters(true);
610610
Coord3D accel = *physics->getAcceleration();
611611
accel.z = 0; // ignore gravitational force.
@@ -666,7 +666,8 @@ void W3DTankTruckDraw::doDrawModule(const Matrix3D* transformMtx)
666666
// if tank is moving, kick up dust and debris
667667
Real velMag = vel->x*vel->x + vel->y*vel->y; // only care about moving on the ground
668668

669-
const Bool doStartMoveDebris = velMag > DEBRIS_THRESHOLD && !getDrawable()->isDrawableEffectivelyHidden() && !getFullyObscuredByShroud();
669+
const Bool doStartMoveDebris = velMag > DEBRIS_THRESHOLD && !getDrawable()->isDrawableEffectivelyHidden() && !getFullyObscuredByShroud() &&
670+
!(obj->isKindOf(KINDOF_NO_MOVE_EFFECTS_ON_WATER) && obj->isOverWater());
670671

671672
// kick debris higher the faster we move
672673
Coord3D velMult;

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void W3DTruckDraw::doDrawModule(const Matrix3D* transformMtx)
548548

549549
Bool wasPowersliding = m_isPowersliding;
550550
m_isPowersliding = false;
551-
if (physics->isMotive() && !obj->isSignificantlyAboveTerrain()) {
551+
if (physics->isMotive() && !obj->isSignificantlyAboveTerrain() && !overWater) {
552552
enableWheelEmitters(true);
553553
Coord3D accel = *physics->getAcceleration();
554554
accel.z = 0; // ignore gravitational force.

0 commit comments

Comments
 (0)