Skip to content

Add guide-driven physical rubber authoring - #568

Draft
freezy wants to merge 16 commits into
masterfrom
feature/rubber-system
Draft

Add guide-driven physical rubber authoring#568
freezy wants to merge 16 commits into
masterfrom
feature/rubber-system

Conversation

@freezy

@freezy freezy commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • import every VPX rubber as a modern manual Unity spline while keeping VPX collider and slingshot behavior in Legacy mode
  • add stable guide support slots, circular post autofit, transactional guided rebakes, package round-trips, and editor authoring tools
  • add a Physical round-cord collider model with swept-circle contacts and hardened slow/degenerate/transformed collision handling
  • add calibrated physical slingshot authoring, validation, serialization, and device integration surfaces while keeping runtime actuation gated

Tests

  • Unity 6000.5 EditMode: targeted rubber feature suite (47 passed)
  • Unity 6000.5 EditMode: RubberSlingshotTests after final hardening (11 passed)
  • Unity 6000.5 EditMode: RubberAutofitTests and SweptCircleColliderTests review-fix regression suite (33 passed)
  • branch diff passes git diff --check

Compatibility

  • VPX imports never autofit and always select the Legacy collider model
  • VPX slingshot segments keep their existing legacy behavior
  • experimental cord deformation and physical slingshot runtime registration remain unavailable pending calibration/runtime gates

freezy added 15 commits July 10, 2026 21:45
Record byte-exact goldens for every drag-point geometry consumer, including
surface, ramp, rubber, wire guide, trigger-outline, and light-insert output.
The fixtures include vertex positions, normals, UVs, indices, and control-point
metadata so later storage and editor changes cannot alter generated geometry.

Exercise open and closed curves across smooth flags and accuracy levels in both
two and three dimensions. A VPX export/reload matrix also compares every BIFF
field for all six Unity-backed item types, separating serialized semantics from
the runtime-only IDs and calculated ramp heights.
Depend on Unity Splines 2.8.2 and expose it to the runtime, editor, and test
assemblies. Convert raw VPX knot positions to broken Bezier knots with tangents
ported from VPE's centripetal Catmull-Rom coefficients, preserving the exact
curve while keeping the source floats out of coordinate-space round trips.

Store every semantic and runtime drag-point field in serializable per-knot
metadata, and rebuild derived tangents after knot edits. Edit-mode tests cover
bit-identical data round trips, sampled Catmull-Rom/Bezier equivalence for open
and closed curves, and rejection of authored tangent changes.
Move Rubber, Trigger, Surface, MetalWireGuide, LightInsertMesh, and Ramp onto a
shared child SplineContainer with index-aligned VPE metadata. Legacy arrays now
upgrade lazily, while mesh, collider, packable, and VPX export consumers keep
reading computed DragPointData arrays and therefore retain their existing APIs.

Place spline children under the exact VPX-to-Unity basis so knot floats remain
verbatim in serialized data. Centralize insert/remove metadata alignment,
derived-tangent restoration, planar constraints, Undo/prefab recording, and
mesh invalidation; retain Ramp's endpoint Z-to-height behavior and cover the
migration with edit-mode component tests.
Route all six drag-point inspectors through Unity's spline tool context and
expose VPE metadata for the selected knots. Smoothness remains VPE-authored,
while slingshot and texture fields stay aligned with native knot selection.

Keep the established flip, reverse, and center-origin operations, including
closed-loop orientation and slingshot rotation. Draw segment ownership and
knot indices over the native gizmo, and cover the subtle transforms with
editor tests.
Delete the custom control-point selection, curve traveller, context menus, and
scene-view renderer now that Unity Splines owns knot editing. Remove the old
inspector contract and its drag-point-only handle utility as well.

Keep the remaining flip-axis detail local to the spline inspector so the new
editor path no longer references any part of the retired handle stack.
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds guide-driven rubber authoring and a new physical rubber collision path. The main changes are:

  • Guided rubber slots, autofit commands, inspectors, and dependency rebaking.
  • Physical round-cord rubber collider generation with legacy fallback behavior.
  • Rubber slingshot authoring, validation, packaging, and editor tooling.
  • Package round-trip support for guided rubber and slingshot data.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
VisualPinball.Unity/VisualPinball.Unity/VPT/Rubber/RubberApi.cs Adds legacy collision fallback when Physical rubber cannot use a current guided bake.
VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Rubber/RubberInspector.cs Adds guided path editing with delayed, transactional binding updates.
VisualPinball.Unity/VisualPinball.Unity/VPT/Rubber/RubberComponent.cs Stores guided rubber bindings, bake metadata, sampled paths, and reset helpers.
VisualPinball.Unity/VisualPinball.Unity/VPT/Rubber/RubberColliderComponent.cs Adds Physical and Legacy collider mode state plus guided-path availability checks.

Reviews (2): Last reviewed commit: "rubber: harden invalid guided state" | Re-trigger Greptile

@freezy

freezy commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Addressed both review findings in 31ba62d: guided binding edits now require a concrete slot and remain transactional, while invalid Physical rubber falls back to Legacy colliders. Focused autofit/collider tests pass 33/33.

Base automatically changed from refactor/splines to master August 11, 2026 22:07
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