Skip to content

physics: add spring hinge mechanisms - #576

Merged
freezy merged 16 commits into
masterfrom
feat/physics-components
Sep 12, 2026
Merged

freezy merged 16 commits into
masterfrom
feat/physics-components

Conversation

@freezy

@freezy freezy commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Adds a complete spring-hinge mechanism for rotating and bash toys, including the runtime collider and solver state, reciprocal magnet ownership, threaded state publication, packaging, editor authoring, creator documentation, and numerical qualification fixtures.

The branch also corrects spinner collision direction and hardens transitions from moving kinematic platforms. Kinematic transforms are paced on the simulation clock, stopped movers expire their velocity, static contacts can apply a bounded penetration correction, and kicker ball teardown avoids stale callbacks.

Validation

  • Unity project compiles cleanly.
  • PhysicsRegressionTests and PhysicsKinematicsTests: 27/27 passed.
  • SpringHingeColliderTests and SpringHingeQualificationTests: 23/23 passed after addressing review feedback about speculative fallback impacts.
  • Fable 5.1 reviewed the final kinematic handoff changes and approved them; its suggested resting-contact regression was added and passed.
  • A broader 596-test assembly run reached 236 tests before a long-running packaging test timed out. The failures observed before the timeout were existing float-precision, packaging, plunger, and primitive failures; none were in the changed physics tests.

@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no actionable new defect established by the changes since the previous review.

Summary

  • Implements finite-inertia spring-hinge collision and movement physics.
  • Adds reciprocal owned-magnet behavior and lifecycle handling.
  • Integrates editor tooling, packaging, runtime state, and rendering publication.
  • Hardens kinematic-platform transitions, static-contact correction, spinner collision direction, and kicker teardown.
  • Since the previous review, removes speculative fallback impacts and adds a regression test for fast near misses.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Spring Hinge authoring] --> B[Packaged component state]
  B --> C[Physics engine registration]
  C --> D[Hinge velocity and displacement]
  E[Ball] --> F[Analytic box collision]
  D --> F
  F --> G[Reciprocal ball and hinge impulses]
  H[Owned spatial magnet] --> I[Capture and hold solver]
  E --> I
  D --> I
  I --> G
  D --> J[Threaded state publication]
  J --> K[Visible toy rotation]
Loading

Reviews (2) · Last reviewed commit: "spring-hinge: reject speculative fallbac..."

Comment thread VisualPinball.Unity/VisualPinball.Unity/VPT/SpringHinge/SpringHingeCollider.cs Outdated
@freezy
freezy merged commit acde3a9 into master Sep 12, 2026
15 checks passed
@freezy
freezy deleted the feat/physics-components branch September 12, 2026 22:44
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