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
@@ -90,7 +90,10 @@ describe.each(COLLISION_SYSTEMS)('$system', ({ physics }) => {
|
||||
// Close the loop: the wall's collider is its child and the wall is parented to that collider.
|
||||
wall.parent = wallColliderEntity;
|
||||
|
||||
expect(collisions.moveAndSlide(world, mover, 10, 0)).toEqual({ blockedX: false, blockedY: false });
|
||||
expect(collisions.moveAndSlide(world, mover, 10, 0)).toMatchObject({
|
||||
blockedX: false,
|
||||
blockedY: false,
|
||||
});
|
||||
expect(mover.x).toBe(10);
|
||||
// And a whole tick, which walks every collider up to the body it belongs to.
|
||||
world.tick(1 / 60);
|
||||
|
||||
Reference in new issue
Block a user