fix(physics): restore relative slingshot response
A full comparison against the 175-record ledger found stale guessed coordinates in both relative slingshot chains. Circles 56/58/71/73 and lines 57/59/72/74 were displaced by up to 70 pixels. The corrected record-57 geometry then exposed a second issue: readable C and Rust had collapsed two independent binary response projections into one. Transcribe the accumulated initializer coordinates exactly. Use the swapped-component projection only to sign the current tangential response `abs(normal_velocity) * response_tangent`, and use the standard dot product for `spin_delta * 0.02 * response_tangent`. Correct the readable C evidence and Rust together, extend live tracing with the six-byte spin field, and seal the stopped-Wine transition from `(75530,354765)/(3000,15)` to `(77369,356597)/(1839,1832)` with Real48 spin `-5.28` in both harnesses. Test Plan: - stopped Wine 11.15 record-57 injection/trace -- matched position, velocity, and spin - `cargo test --workspace --all-targets --all-features` -- 123 passed - `cargo clippy --workspace --all-targets --all-features -- -D warnings` -- passed - `bash original/tools/test_reconstructed_c.sh` -- passed - `python3 original/tools/audit_reconstruction.py --require-complete` -- passed with zero incomplete or unclassified units - `python3 -m py_compile original/tools/trace_original_state.py original/tools/inject_original_state.py` -- passed - `rumdl check --flavor commonmark RECONSTRUCTION.md CHANGELOG.md` -- passed - `git diff --cached --check` -- passed
This commit is contained in:
+12
-4
@@ -10,10 +10,11 @@ and this project adheres to
|
||||
|
||||
### Fixed
|
||||
|
||||
- Correct the common Real48 tangent projection to the binary's
|
||||
`spin*0.4 - ((vx*ny + vy*nx)/length)*response_tangent`; live probes now
|
||||
match horizontal drain `(-302,-1809)`, ordinary circle `(94,564)`, and
|
||||
bumper `(197,3096)` transitions instead of rounding a bare coefficient away.
|
||||
- Separate the common response's two binary projections: the swapped-component
|
||||
value supplies the sign of `abs(normal_velocity)*response_tangent`, while
|
||||
`(vx*nx+vy*ny)/length * 0.02 * response_tangent` updates spin. Live probes now
|
||||
match horizontal drain `(-302,-1809)`, ordinary circle `(94,564)`, bumper
|
||||
`(197,3096)`, and relative record 57 `(1839,1832)` with spin exactly `-5.28`.
|
||||
- Gate dynamic record 174/175 impulse transfer on the other slot's capture age:
|
||||
a held ball remains velocity-stationary and the moving response retains its
|
||||
full normal velocity instead of always subtracting 1,000.
|
||||
@@ -67,6 +68,13 @@ and this project adheres to
|
||||
- Apply the collision table's predicted-position broadphase bounds before
|
||||
type-1/type-2 detection, including the registered five-pixel ball margin,
|
||||
and retain unresolved candidates until the selected response phase.
|
||||
- Correct the two relative slingshot initializer chains after records 55 and
|
||||
70: circles 56/58/71/73 and lines 57/59/72/74 now accumulate from each
|
||||
preceding path endpoint exactly as the 175-record ledger specifies. The
|
||||
flagless TDK companion lines also retain their zero contact/link field rather
|
||||
than carrying unused synthetic head IDs. Record 57 additionally matches the
|
||||
live original's `(75530,354765)/(3000,15)` to
|
||||
`(77369,356597)/(1839,1832)` transition.
|
||||
- Match rectangular type-4 magnetic gates to raw `1000:9b69`: enter only when
|
||||
the previous position is inside, then deactivate when the newly predicted
|
||||
position exits any edge, replacing a swept-intersection approximation.
|
||||
|
||||
@@ -22,9 +22,9 @@ implementation.
|
||||
| Artwork | Exact | All 34 custom DIB images, three standard bitmaps, icon, and palette derivatives are preserved in `assets/original/`. The game uses the original 640x460 table, help, ball, wheel, robot, plunger, media, and item frames. DAT400-407 expose the current per-player bonus/collect/release effect at `(55,79)` while preserving the saved 14x14 wheel overlap. Loading presents DAT995 and advances the original DAT994 strip at raw `1000:531e` destination `(202,328)`, height 13, and clipped width `(stage-1)*7` through stages 2-35. Player items 1-5 cumulatively light the five recovered bumper-value Word-Quads from 2,000 through 6,000 points. The nine partially completed bumper/TDK bank heads use their record-ledger overlay-A bounds until each three-line group rearms. Record 148's armed player-item-20 state uses its exact overlay-A Word-Quad `(9,14)-(25,30)`. |
|
||||
| Audio | Exact samples and recovered dispatch | All 16 mono PCM WAV resources are embedded unchanged. Playback is emitted at the reconstructed call sites, including multi-sound bank completions, nudge-then-tilt ordering, and Tilt suppression of the pre-reset WAVE-2008 drain cue. Like Win16 `SndPlaySound(SND_ASYNC|SND_NODEFAULT)`, each new resource stops the previous one and plays at the host mixer level without an application-side attenuation. WAV 2022 is loaded by the original generic resource loop but has no playback call and is therefore never played by Rust. |
|
||||
| Help and languages | Exact | Original resource images 1001-1005 are displayed directly. |
|
||||
| Playfield collision layout | Recovered | All 109 active type-2 line objects and 40 static active type-1 circles are transcribed from the original 175-object registration table. The registration routine converts its sideways inputs with `screen = (y, x - 20)` and accumulates explicitly relative objects. Every static record retains its `+0x49` layer mask; the scanner selects layer 1 below the old Y value 250,000 and layer 2 at or above it, while mask 3 records remain shared. Before detection, the raw `1000:9b69` predicted position must lie in the record bounds derived with the registered five-pixel ball margin. Type-2 records retain every recovered Real48 normal/tangent response pair and registered one-sided orientation. Type-1 records retain their swept-circle radius, radial rebound, tangent coupling, and bumper kick. Detection retains unresolved normal/material candidates so later scan-time motion changes can participate in the selected response. Raw stack slot `SS:...d8a2` makes the first detected record ID win; later nearer candidates are stored but never applied, and both C/Rust have two-candidate regression coverage for this quirk. Each flipper uses its exact two line records plus moving tip circle in both positions. Moving-flipper contact ports `1000:7ed9` rather than fitting live samples: delta-specific pivots/edges, integer cross gates, radial/penetration calculations, response-record gain, and position/velocity publication are tested against all four C harness directions and the raised release geometry. Object 174 is overwritten with the live first ball and Rust handles its ball-to-ball role directly. |
|
||||
| Playfield collision layout | Recovered | All 109 active type-2 line objects and 40 static active type-1 circles are transcribed from the original 175-object registration table. The registration routine converts its sideways inputs with `screen = (y, x - 20)` and accumulates explicitly relative objects. Both left/right relative slingshot chains (54-59 and 69-74) are checked record-for-record against their accumulated ledger coordinates. Every static record retains its `+0x49` layer mask; the scanner selects layer 1 below the old Y value 250,000 and layer 2 at or above it, while mask 3 records remain shared. Before detection, the raw `1000:9b69` predicted position must lie in the record bounds derived with the registered five-pixel ball margin. Type-2 records retain every recovered Real48 normal/tangent response pair and registered one-sided orientation. Type-1 records retain their swept-circle radius, radial rebound, tangent coupling, and bumper kick. Detection retains unresolved normal/material candidates so later scan-time motion changes can participate in the selected response. Raw stack slot `SS:...d8a2` makes the first detected record ID win; later nearer candidates are stored but never applied, and both C/Rust have two-candidate regression coverage for this quirk. Each flipper uses its exact two line records plus moving tip circle in both positions. Moving-flipper contact ports `1000:7ed9` rather than fitting live samples: delta-specific pivots/edges, integer cross gates, radial/penetration calculations, response-record gain, and position/velocity publication are tested against all four C harness directions and the raised release geometry. Object 174 is overwritten with the live first ball and Rust handles its ball-to-ball role directly. |
|
||||
| Ball launcher and nudge input | Recovered | The initial 32-bit fixed-point coordinates decode to `(325, 413)` in the right shooter lane. Each Down keydown subtracts `15*50 = 750` millipixels, release subtracts another `15*100 = 1500`, and the result follows the recovered randomized `-3800` lower and `-2280` weak upper clamp branches. The ten decoration frames use the same strict 750-millipixel thresholds. Left Shift and keypad 3 apply their directional `(50-Random(20))*15` impulses; Space uses the recovered Real48 horizontal factor and `(60-Random(20))*15` vertical impulse. With two balls, the key path still consumes those active-window draws, then applies its separately recovered fixed/shared random slot impulse to both saved velocities. Each nudge adds 25 to the wrapping 16-bit tilt counter, compares it with `30+Random(10)`, and the detail timer decrements a nonzero counter once per callback. Flipper key flags and raised geometry survive ordinary drains; Tilt and a player's final ball clear the flags, lower raised flippers through the normal WAVE-2021 timer edge, and require a physical key release before another press. |
|
||||
| Physics arithmetic | Recovered Real48 core | Production movement uses the original 10 ms millipixel substep, `+15` vertical acceleration, Real48 `3800/speed` clamp, four-sided pre-scan prediction bounds `(0,340000] x (0,460000]`, type-2 distance/cross gates, type-1 midpoint normal, first-detected candidate selection, persistent Real48 spin, and the common impulse response. The scan follows record chunks 1-5, 6, 7-88, 89, 90-128, 129-133, 134-139, 140-152, 153-154, 155-173, and dynamic 174/175 while carrying prediction separately from mutable motion. Negative auxiliary thresholds and kick coefficients are retained for bumpers 51-53 and lines 55/74/107, including weak-hit score behavior, unscored-rail WAVE 2019, and tilt suppression. Type-3 reads the pre-movement coordinate for pull/hold, obeys its prediction broadphase, and contributes its recovered radial rim candidate when a nonzero contact is outside the deep zone. Type-4 randomization mutates motion before the selected candidate is resolved and before position publication; only rectangular magnetic records rewrite prediction. Detail callbacks freeze their starting ball count, run all 5/4/3/2/1 substeps for slot 1 before slot 2, stop a slot after its first collision/reset/removal, and apply effect-seven spawn requests after the current batch. Dynamic records 174/175 use their 21-pixel prediction bounds and transfer normal impulse only when the other slot's capture age is nonpositive; successful transfer then applies `normal_velocity-1000`, while a held slot remains unchanged and leaves the moving normal velocity intact. Effect seven spawns record/slot 2 from record 148 coordinates `(17000,23000)` with exact `(0,3040)` velocity. Both slots traverse the same type-3/type-4 dispatcher. Capture age is saved per slot, contact words retain ball ownership, a completed multiball capture removes exactly that slot and promotes the survivor when needed, and effect seven's argument-2 guard prevents a third ball. The original Borland seed update, high-word `Random(n)`, and normalized Real48 random register result drive launcher variation, effects, claw terminals, magnetic fields, and trigger response. Type-4 triggers retain a shared transient entry flag; type-3 captures retain per-player 16-bit contact words, deep-inside pull/hold progression to age 300, first-contact sound, and `99`/`2` completion sentinels. Zero-spin C harnesses and retained-spin Wine probes are tested separately rather than conflated. |
|
||||
| Physics arithmetic | Recovered Real48 core | Production movement uses the original 10 ms millipixel substep, `+15` vertical acceleration, Real48 `3800/speed` clamp, four-sided pre-scan prediction bounds `(0,340000] x (0,460000]`, type-2 distance/cross gates, type-1 midpoint normal, first-detected candidate selection, persistent Real48 spin, and the common impulse response. The swapped-component projection supplies only the sign of `abs(normal_velocity)*response_tangent`; the independent standard dot-product projection drives `spin_delta = projection*0.02*response_tangent`, while retained `spin*0.4` contributes to the current tangential response. The scan follows record chunks 1-5, 6, 7-88, 89, 90-128, 129-133, 134-139, 140-152, 153-154, 155-173, and dynamic 174/175 while carrying prediction separately from mutable motion. Negative auxiliary thresholds and kick coefficients are retained for bumpers 51-53 and lines 55/74/107, including weak-hit score behavior, unscored-rail WAVE 2019, and tilt suppression. Type-3 reads the pre-movement coordinate for pull/hold, obeys its prediction broadphase, and contributes its recovered radial rim candidate when a nonzero contact is outside the deep zone. Type-4 randomization mutates motion before the selected candidate is resolved and before position publication; only rectangular magnetic records rewrite prediction. Detail callbacks freeze their starting ball count, run all 5/4/3/2/1 substeps for slot 1 before slot 2, stop a slot after its first collision/reset/removal, and apply effect-seven spawn requests after the current batch. Dynamic records 174/175 use their 21-pixel prediction bounds and transfer normal impulse only when the other slot's capture age is nonpositive; successful transfer then applies `normal_velocity-1000`, while a held slot remains unchanged and leaves the moving normal velocity intact. Effect seven spawns record/slot 2 from record 148 coordinates `(17000,23000)` with exact `(0,3040)` velocity. Both slots traverse the same type-3/type-4 dispatcher. Capture age is saved per slot, contact words retain ball ownership, a completed multiball capture removes exactly that slot and promotes the survivor when needed, and effect seven's argument-2 guard prevents a third ball. The original Borland seed update, high-word `Random(n)`, and normalized Real48 random register result drive launcher variation, effects, claw terminals, magnetic fields, and trigger response. Type-4 triggers retain a shared transient entry flag; type-3 captures retain per-player 16-bit contact words, deep-inside pull/hold progression to age 300, first-contact sound, and `99`/`2` completion sentinels. Zero-spin C harnesses and retained-spin Wine probes are tested separately rather than conflated. |
|
||||
| Rules | Recovered gameplay paths | Player count, controls, the five three-line bumper-value groups, four three-line TDK-diamond groups, five doubling-value lock holes, record-148 special/multiball hole, seven-way effect selector/consumer including multiball, ball-scoped double scoring, and four exact media/extra-ball thresholds follow original help/code paths, globals, and object flags. The ninth diamond pays the original 24,464 completion value, then immediately enables double scoring and all three magnetic fields before that collision's static 1,500-point award. Further completed banks during that ball add 100,000 to the per-player secondary score. A normal ball end clears double scoring, so the first later completion re-enables it without adding 100,000; effect seven's special respawn preserves it because it bypasses `normal_ball_end`. Bumpers 51-53 and targets 140-147/150-152 use the original 5/20/10 active-callback countdowns and exact overlay-A render rectangles. Record 121 runs the six-active-callback DAT600 target rotation with exact 91x90 frames/target points and rotates the five contact/item values at state 6; it pauses while a ball waits in the launcher and survives a normal drain. Completing all five lock holes with one ball suspends physics for the full 281-callback panel animation, clears contact/item state at the recovered boundaries, and uses the exact WAVE 2013/2012/stop sequence. A fifth multiball capture still transfers the capped 160,000-step secondary award, multiplier, and extra ball but defers the panel; a later survivor recapture can perform the same capped completion and start it. Capturing record 148 sets player item/contact 20 and preserves all five lock-hole items and contacts. Effect seven retains required state through active multiball; when the last ball is lost, `1000:ae6e` grants one uncharged special respawn at `(17000,23000)/(0,3040)`, clears required state, and suppresses record 148 until a broadphase-active type-4 record clears `0x0875`. Turn changes mirror the original save/load of all 175 collision active/contact states plus wheel/top targets and selected effect. Claw contact and all initially active type-4 targets use recovered records. The top three targets score 500 each and independently enable the left, center, or right magnetic field record. Each rectangular field requires the previous position inside, applies its Real48/random pull, and deactivates when raw `1000:9b69` finds the resulting `07db/07df` prediction outside any edge. The claw state machine and release table have live differential coverage for all four random terminals. |
|
||||
| Numeric scoring | Recovered gameplay values | Static scores come from the initialized 175-object ledger. Dynamic bumper progression, target-bank completion, diamond awards, 10k-160k lock bonuses, 310k transfer, six effect values, multiball mode, and all four media thresholds are transcribed from `1000:b476`, `1000:c4e1`, `1000:bc36`, and live state probes. The central helper suppresses all mutation during Tilt, applies a 2x active-multiball factor, and then independently applies the active ball's 2x factor, allowing the original 4x stack. Lock and effect awards share the original per-player secondary score and display multiplier; the fifth hole transfers and clears it, increments the multiplier, and grants the recovered ball award. Score mutation uses the original 32-bit wrapping behavior; media markers use the binary's signed-high/unsigned-low comparison, and each add operation can advance at most one threshold. Type-4 WAVE 2004, bumper WAVE 2006, and bank-completion WAVE 2017 dispatch before their associated score mutations, leaving a crossed marker's WAVE 2007 as the audible asynchronous sample. Rendering separately follows `1008:0996`'s eight-place 130x40 fields/right edge X=606 and `1008:0b9e`'s strict signed status thresholds; configured-player rows and 5x5 remaining-ball markers retain their exact dimensions and current/noncurrent counts. |
|
||||
| High scores | Recovered visible flow; portable storage | The original 276-byte table is decoded as ten `IWIK`-XOR-obfuscated little-endian scores plus ten 22-byte names. Each player is checked immediately when their own last ball is lost; qualifying scores use the original signed-high/unsigned-low comparison and a `TDK Pinball Player`-prefilled DIALOG 32514 flow with the exact caption, prompt, 21-character limit, OK/Cancel semantics, and allowance for an empty accepted name. The `HighScore` child uses exact DAT993 at 360x300, heading `(180,27)`, name/rank X=30, right-aligned score X=320, and ten 20-pixel rows before play resumes. Persisted updates use portable JSON rather than rewriting the Win16 file. |
|
||||
|
||||
@@ -3234,6 +3234,46 @@ mod tests {
|
||||
assert!(game.ball.velocity.y > 0.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn relative_record_57_matches_live_two_substep_transition() {
|
||||
let mut game = Game::new(1);
|
||||
game.ball.in_launcher = false;
|
||||
game.ball.position = vec2(72.530, 354.750);
|
||||
game.ball.velocity = MilliVec { x: 3_000, y: 0 }.to_velocity_per_second();
|
||||
let mut events = Vec::new();
|
||||
|
||||
assert!(!game.fixed_update(&mut events));
|
||||
assert_eq!(
|
||||
MilliVec::from_position(game.ball.position),
|
||||
MilliVec {
|
||||
x: 75_530,
|
||||
y: 354_765,
|
||||
}
|
||||
);
|
||||
assert_eq!(
|
||||
MilliVec::from_velocity_per_second(game.ball.velocity),
|
||||
MilliVec { x: 3_000, y: 15 }
|
||||
);
|
||||
|
||||
assert!(game.fixed_update(&mut events));
|
||||
assert_eq!(game.last_collision_id, Some(57));
|
||||
assert_eq!(
|
||||
game.ball.spin.bytes(),
|
||||
[0x83, 0x5d, 0x8f, 0xc2, 0xf5, 0xa8]
|
||||
);
|
||||
assert_eq!(
|
||||
MilliVec::from_position(game.ball.position),
|
||||
MilliVec {
|
||||
x: 77_369,
|
||||
y: 356_597,
|
||||
}
|
||||
);
|
||||
assert_eq!(
|
||||
MilliVec::from_velocity_per_second(game.ball.velocity),
|
||||
MilliVec { x: 1_839, y: 1_832 }
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retained_collision_candidate_clears_the_slot_capture_age() {
|
||||
let mut game = Game::new(1);
|
||||
|
||||
@@ -241,7 +241,7 @@ fn normal_velocity(velocity: MilliVec, normal_x: Real48, normal_y: Real48, lengt
|
||||
.round_i32()
|
||||
}
|
||||
|
||||
fn tangent_velocity(velocity: MilliVec, normal_x: Real48, normal_y: Real48, length: i32) -> i32 {
|
||||
fn tangent_direction(velocity: MilliVec, normal_x: Real48, normal_y: Real48, length: i32) -> i32 {
|
||||
if length <= 0 {
|
||||
return 0;
|
||||
}
|
||||
@@ -255,6 +255,17 @@ fn tangent_velocity(velocity: MilliVec, normal_x: Real48, normal_y: Real48, leng
|
||||
.round_i32()
|
||||
}
|
||||
|
||||
fn spin_velocity(velocity: MilliVec, normal_x: Real48, normal_y: Real48, length: i32) -> i32 {
|
||||
if length <= 0 {
|
||||
return 0;
|
||||
}
|
||||
Real48::from_i32(velocity.x)
|
||||
.multiply(normal_x)
|
||||
.add(Real48::from_i32(velocity.y).multiply(normal_y))
|
||||
.divide(Real48::from_i32(length))
|
||||
.round_i32()
|
||||
}
|
||||
|
||||
fn cross_at_endpoint(
|
||||
point: MilliVec,
|
||||
current: MilliVec,
|
||||
@@ -284,17 +295,21 @@ fn apply_response(
|
||||
x: normal_x.round_i32(),
|
||||
y: normal_y.round_i32(),
|
||||
});
|
||||
let initial_projection = tangent_velocity(velocity, normal_x, normal_y, length);
|
||||
let mut spin_delta = Real48::from_i32(initial_projection)
|
||||
// Raw 1000:ef19..f16a uses the swapped-component value only as the
|
||||
// response direction; the standard dot product independently updates spin.
|
||||
let tangent_direction = tangent_direction(velocity, normal_x, normal_y, length);
|
||||
let spin_projection = spin_velocity(velocity, normal_x, normal_y, length);
|
||||
let spin_delta = Real48::from_i32(spin_projection)
|
||||
.multiply(Real48::from_bytes([0x7b, 0x71, 0x3d, 0x0a, 0xd7, 0x23]))
|
||||
.multiply(coefficients.tangent)
|
||||
.multiply(Real48::from_i32(collision_velocity.wrapping_abs()));
|
||||
if initial_projection < 0 {
|
||||
spin_delta = spin_delta.negate();
|
||||
.multiply(coefficients.tangent);
|
||||
let mut tangent_response = Real48::from_i32(collision_velocity.wrapping_abs())
|
||||
.multiply(coefficients.tangent);
|
||||
if tangent_direction < 0 {
|
||||
tangent_response = tangent_response.negate();
|
||||
}
|
||||
let projection = spin
|
||||
.multiply(Real48::from_bytes([0x7f, 0xcd, 0xcc, 0xcc, 0xcc, 0x4c]))
|
||||
.add(Real48::from_i32(initial_projection).multiply(coefficients.tangent))
|
||||
.add(tangent_response)
|
||||
.round_i32();
|
||||
let spin = spin
|
||||
.multiply(Real48::from_bytes([0x80, 0x9a, 0x99, 0x99, 0x99, 0x19]))
|
||||
|
||||
+44
-12
@@ -66,10 +66,10 @@ impl TableSegment {
|
||||
96..=98 => 96,
|
||||
99..=101 => 99,
|
||||
102..=104 => 102,
|
||||
109..=111 => 109,
|
||||
112..=114 => 112,
|
||||
115..=117 => 115,
|
||||
118..=120 => 118,
|
||||
109 => 109,
|
||||
112 => 112,
|
||||
115 => 115,
|
||||
118 => 118,
|
||||
_ => 0,
|
||||
};
|
||||
let (response_auxiliary, response_kick) = match id {
|
||||
@@ -210,8 +210,8 @@ pub const WALLS: &[TableSegment] = &[
|
||||
TableSegment::new(49, Vec2::new(33.0, 231.0), Vec2::new(10.0, 300.0)),
|
||||
TableSegment::new(50, Vec2::new(12.0, 261.0), Vec2::new(12.0, 407.0)),
|
||||
TableSegment::new(55, Vec2::new(59.0, 287.0), Vec2::new(107.0, 359.0)),
|
||||
TableSegment::new(57, Vec2::new(49.0, 294.0), Vec2::new(2.0, 268.0)),
|
||||
TableSegment::new(59, Vec2::new(44.0, 287.0), Vec2::new(44.0, 242.0)),
|
||||
TableSegment::new(57, Vec2::new(97.0, 366.0), Vec2::new(50.0, 340.0)),
|
||||
TableSegment::new(59, Vec2::new(45.0, 333.0), Vec2::new(45.0, 288.0)),
|
||||
TableSegment::new(61, Vec2::new(37.0, 292.0), Vec2::new(37.0, 347.0)),
|
||||
TableSegment::new(62, Vec2::new(37.0, 347.0), Vec2::new(110.0, 384.0)),
|
||||
TableSegment::new(63, Vec2::new(92.0, 408.0), Vec2::new(19.0, 385.0)),
|
||||
@@ -219,8 +219,8 @@ pub const WALLS: &[TableSegment] = &[
|
||||
TableSegment::new(66, Vec2::new(112.0, 386.0), Vec2::new(141.0, 413.0)),
|
||||
TableSegment::new(68, Vec2::new(130.0, 427.0), Vec2::new(97.0, 411.0)),
|
||||
TableSegment::new(70, Vec2::new(267.0, 292.0), Vec2::new(267.0, 337.0)),
|
||||
TableSegment::new(72, Vec2::new(261.0, 299.0), Vec2::new(214.0, 321.0)),
|
||||
TableSegment::new(74, Vec2::new(252.0, 289.0), Vec2::new(302.0, 218.0)),
|
||||
TableSegment::new(72, Vec2::new(261.0, 344.0), Vec2::new(214.0, 366.0)),
|
||||
TableSegment::new(74, Vec2::new(205.0, 356.0), Vec2::new(255.0, 285.0)),
|
||||
TableSegment::new(76, Vec2::new(292.0, 291.0), Vec2::new(292.0, 385.0)),
|
||||
TableSegment::new(77, Vec2::new(292.0, 385.0), Vec2::new(221.0, 408.0)),
|
||||
TableSegment::new(78, Vec2::new(205.0, 384.0), Vec2::new(275.0, 347.0)),
|
||||
@@ -291,14 +291,14 @@ pub const PASSIVE_CIRCLES: &[StaticCircle] = &[
|
||||
StaticCircle::new(42, Vec2::new(38.0, 183.0), 8.0),
|
||||
StaticCircle::new(48, Vec2::new(25.0, 231.0), 8.0),
|
||||
StaticCircle::new(54, Vec2::new(53.0, 292.0), 8.0),
|
||||
StaticCircle::new(56, Vec2::new(50.0, 287.0), 8.0),
|
||||
StaticCircle::new(58, Vec2::new(52.0, 287.0), 8.0),
|
||||
StaticCircle::new(56, Vec2::new(98.0, 359.0), 8.0),
|
||||
StaticCircle::new(58, Vec2::new(53.0, 333.0), 8.0),
|
||||
StaticCircle::new(60, Vec2::new(29.0, 294.0), 10.0),
|
||||
StaticCircle::new(65, Vec2::new(103.0, 397.0), 15.0),
|
||||
StaticCircle::new(67, Vec2::new(134.0, 419.0), 9.0),
|
||||
StaticCircle::new(69, Vec2::new(260.0, 292.0), 8.0),
|
||||
StaticCircle::new(71, Vec2::new(260.0, 291.0), 8.0),
|
||||
StaticCircle::new(73, Vec2::new(261.0, 291.0), 8.0),
|
||||
StaticCircle::new(71, Vec2::new(260.0, 336.0), 8.0),
|
||||
StaticCircle::new(73, Vec2::new(214.0, 358.0), 8.0),
|
||||
StaticCircle::new(75, Vec2::new(284.0, 292.0), 9.0),
|
||||
StaticCircle::new(80, Vec2::new(210.0, 397.0), 15.0),
|
||||
StaticCircle::new(82, Vec2::new(179.0, 419.0), 9.0),
|
||||
@@ -411,6 +411,38 @@ mod tests {
|
||||
assert_eq!(shooter_wall.segment.end, Vec2::new(328.0, 58.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn relative_slingshot_chains_match_the_initialized_record_ledger() {
|
||||
for (id, expected_start, expected_end) in [
|
||||
(55, Vec2::new(59.0, 287.0), Vec2::new(107.0, 359.0)),
|
||||
(57, Vec2::new(97.0, 366.0), Vec2::new(50.0, 340.0)),
|
||||
(59, Vec2::new(45.0, 333.0), Vec2::new(45.0, 288.0)),
|
||||
(70, Vec2::new(267.0, 292.0), Vec2::new(267.0, 337.0)),
|
||||
(72, Vec2::new(261.0, 344.0), Vec2::new(214.0, 366.0)),
|
||||
(74, Vec2::new(205.0, 356.0), Vec2::new(255.0, 285.0)),
|
||||
] {
|
||||
let wall = WALLS
|
||||
.iter()
|
||||
.find(|wall| wall.id == id)
|
||||
.expect("relative line record must be present");
|
||||
assert_eq!((wall.segment.start, wall.segment.end), (expected_start, expected_end));
|
||||
}
|
||||
for (id, expected_center) in [
|
||||
(54, Vec2::new(53.0, 292.0)),
|
||||
(56, Vec2::new(98.0, 359.0)),
|
||||
(58, Vec2::new(53.0, 333.0)),
|
||||
(69, Vec2::new(260.0, 292.0)),
|
||||
(71, Vec2::new(260.0, 336.0)),
|
||||
(73, Vec2::new(214.0, 358.0)),
|
||||
] {
|
||||
let circle = PASSIVE_CIRCLES
|
||||
.iter()
|
||||
.find(|circle| circle.id == id)
|
||||
.expect("relative circle record must be present");
|
||||
assert_eq!(circle.center, expected_center);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_recovered_wall_has_its_registered_one_sided_contact() {
|
||||
for wall in WALLS {
|
||||
|
||||
Reference in New Issue
Block a user