Skip to content

Commit 73820d1

Browse files
committed
Fixed camera shake and emotives happening way too much
1 parent b11bf6b commit 73820d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

engine/source/game/marble/marblephysics.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ void Marble::velocityCancel(bool surfaceSlide, bool noBounce, bool& bouncedYet,
384384

385385
F32 bounceSpeed = sVel.len() * restitution;
386386
Point3F bounceNormal = contact->normal;
387-
bounceEmitter(bounceSpeed, bounceNormal);
388387
#if defined(MBXP_CAMERA_SHAKE) || defined(MBXP_EMOTIVES)
389388
#ifdef MB_ULTRA_PREVIEWS
390389
if (isGhost() || gSPMode)
@@ -400,8 +399,10 @@ void Marble::velocityCancel(bool surfaceSlide, bool noBounce, bool& bouncedYet,
400399
else if (mDataBlock->minBounceSpeed <= bounceSpeed)
401400
bounceType = 1;
402401

403-
if (bounceType > 0)
402+
if (bounceType > 0 && !mBounceEmitDelay)
404403
{
404+
bounceEmitter(bounceSpeed, bounceNormal);
405+
mBounceEmitDelay = 300;
405406
#ifdef MBXP_CAMERA_SHAKE
406407
auto cameraShake = new CameraShake;
407408
#endif
@@ -455,6 +456,8 @@ void Marble::velocityCancel(bool surfaceSlide, bool noBounce, bool& bouncedYet,
455456
#endif
456457
}
457458
}
459+
#else
460+
bounceEmitter(bounceSpeed, bounceNormal);
458461
#endif
459462

460463
vAtC -= contact->normal * mDot(contact->normal, sVel);

0 commit comments

Comments
 (0)