Skip to content

Fix plunger pullback, kinematic motion, and mesh tip#569

Draft
freezy wants to merge 6 commits into
masterfrom
plunger-issue-398
Draft

Fix plunger pullback, kinematic motion, and mesh tip#569
freezy wants to merge 6 commits into
masterfrom
plunger-issue-398

Conversation

@freezy

@freezy freezy commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix plunger pullback/fire command behavior and analog mechanical plunger handling
  • Keep plunger collider and generated Unity meshes in local Z so transformed plungers behave correctly
  • Update kinematic plunger displacement/collision handling
  • Close the generated rod tip mesh and harden spring mesh generation for empty spring data
  • Add regression coverage for plunger command behavior, transformed assumptions, local mesh/collider Z, kinematic motion, and mesh generation

Testing

  • dotnet test VisualPinball.Engine.Test\VisualPinball.Engine.Test.csproj -c Release --filter FullyQualifiedName~Plunger -v:minimal

Note: dotnet build VisualPinball.Unity\VisualPinball.Unity.Test\VisualPinball.Unity.Test.csproj -c Release does not complete in this shell because Unity/package-only references such as NativeTrees, Newtonsoft, GLTFast, and Unity collections types are unavailable outside the Unity project environment.

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates plunger behavior and geometry handling. The main changes are:

  • Fixed pullback, fire, retract, and analog mechanical plunger state handling.
  • Kept plunger collider and generated mesh data in local Z space.
  • Updated kinematic plunger displacement and collision velocity handling.
  • Closed the generated rod tip mesh and guarded empty spring mesh generation.
  • Added tests for plunger commands, physics, local mesh/collider Z, and mesh generation.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
VisualPinball.Engine/VPT/Plunger/PlungerMeshGenerator.cs Adds local mesh generation, closes the rod tip, and handles empty spring meshes.
VisualPinball.Unity/VisualPinball.Unity/VPT/Plunger/PlungerCollider.cs Moves plunger collider bounds to local Z and includes surface velocity in collision response.
VisualPinball.Unity/VisualPinball.Unity/Game/PhysicsCycle.cs Routes kinematic plunger displacement through the kinematic collider collection.
VisualPinball.Unity/VisualPinball.Unity/Game/PhysicsStaticCollision.cs Passes kinematic surface velocity into plunger collision handling.
VisualPinball.Unity/VisualPinball.Unity/VPT/Plunger/PlungerVelocityPhysics.cs Maps analog mechanical plunger input into the valid rest-to-full-pull range.
VisualPinball.Unity/VisualPinball.Unity/VPT/Plunger/PlungerCommands.cs Resets pullback and retract motion state more explicitly.
VisualPinball.Unity/VisualPinball.Unity/Game/Player.cs Registers analog plunger callbacks for performed and canceled input phases.
VisualPinball.Unity/VisualPinball.Unity/Input/InputManager.cs Changes the default analog plunger binding to a processed value-axis input.

Reviews (1): Last reviewed commit: "plunger: close rod tip mesh" | Re-trigger Greptile

@freezy freezy changed the title plunger: fix pullback, kinematic motion, and mesh tip Fix plunger pullback, kinematic motion, and mesh tip Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant