Skip to main content

collide_with_world

Function collide_with_world 

Source
fn collide_with_world(
    state: &EntityPhysicsState,
    movement: DVec3,
    aabb: &WorldAabb,
    world: &dyn CollisionWorld,
    entity_collisions: &[WorldAabb],
) -> MoveResult
Expand description

Performs collision detection and resolution along all three axes.

Matches vanilla’s Entity.collideWithShapes() behavior exactly:

  • Uses dynamic axis order based on movement direction (Y first, then X/Z based on magnitude)
  • Accumulates resolved movement and moves AABB after each axis