Move with collision reacts along the contact normal: it travels to the surface, stays flush and slides the rest of the move along it with Coulomb friction (the mean of both colliders, a tile counts as 0.5), a circle now rolls over an edge instead of catching on it, pushed dynamic bodies move off along the normal, Move gains the outputs hit, normal x and normal y, an object without its own collider moves freely, and editor run and play share the same path through Solids; contact point and normal come from our own f64 geometry (contactBetween), because Rapier's castShape lands 3e-6 px inside the wall in f32 (#150)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d931e66f92
commit
1b5e386b60
15 files changed
+680
-161
No files matched your search
@@ -836,13 +836,28 @@ const CASES: Record<string, Case[]> = {
|
||||
name: 'moves by (dx, dy) × scale × dt',
|
||||
inputs: { object: at('m', 0, 0), dx: 1, dy: 0, scale: 100, dt: 0.5 },
|
||||
next: 'exec',
|
||||
outputs: { blockedX: false, blockedY: false },
|
||||
outputs: { blockedX: false, blockedY: false, hit: false, normalX: 0, normalY: 0 },
|
||||
},
|
||||
{
|
||||
name: 'with collision it hands on what the move met',
|
||||
inputs: { object: at('m', 0, 0), dx: 4, dy: 2, scale: 1, dt: 1 },
|
||||
params: { collide: true },
|
||||
context: {
|
||||
moveAndSlide: (_target: unknown, dx: number, dy: number) => ({
|
||||
blockedX: dx === 4,
|
||||
blockedY: dy === 3,
|
||||
hit: true,
|
||||
normal: { x: -1, y: 0 },
|
||||
}),
|
||||
},
|
||||
next: 'exec',
|
||||
outputs: { blockedX: true, blockedY: false, hit: true, normalX: -1, normalY: 0 },
|
||||
},
|
||||
{
|
||||
name: 'no object is a no-op that still continues the flow',
|
||||
inputs: { object: null, dx: 1, dy: 1 },
|
||||
next: 'exec',
|
||||
outputs: { blockedX: false, blockedY: false },
|
||||
outputs: { blockedX: false, blockedY: false, hit: false, normalX: 0, normalY: 0 },
|
||||
},
|
||||
],
|
||||
SetPosition: [
|
||||
|
||||
Reference in new issue
Block a user