Skip to content

Commit ca3d458

Browse files
committed
Hack for spinning ball in the plunger lane until plunger has a proper Physics Material, also removed old comment that was not true anymore
1 parent cbd9ed0 commit ca3d458

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

VisualPinball.Engine/VPT/MetalWireGuide/MetalWireGuideMeshGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private Mesh GetMesh(float playfieldHeight, float meshHeight, int detailLevel, f
8989
SplineVertex sv = new SplineVertex(_data.DragPoints, (int)(_data.Thickness+0.5), detailLevel, splineAccuracy, margin: margin, loop: false);
9090

9191
var height = playfieldHeight + meshHeight;
92-
// hack - Component has to get edited. --- and TODO: Thickness should become a float.
92+
9393
var standheight = _data.Standheight;
9494
// dont lat the Collider be higher than the visible mesh, just shift the top of the MWG.
9595
if (createHitShape)

VisualPinball.Unity/VisualPinball.Unity/VPT/Plunger/PlungerCollider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ public static void Collide(ref BallData ball, ref CollisionEventData collEvent,
234234
var dot = (ball.Velocity.x - collEvent.HitVelocity.x) * collEvent.HitNormal.x
235235
+ (ball.Velocity.y - collEvent.HitVelocity.y) * collEvent.HitNormal.y;
236236

237+
// HACK to stop the ball from spinning.
238+
ball.AngularMomentum.z *= 0.6f;
239+
237240
// nearly receding ... make sure of conditions
238241
if (dot >= -PhysicsConstants.LowNormVel) {
239242

0 commit comments

Comments
 (0)