Skip to main content

Module entity_move

Module entity_move 

Source
Expand description

Entity movement physics with vanilla parity.

Implements vanilla’s Entity.move() method with:

  • Step-up mechanics for climbing small obstacles
  • Sneak-edge prevention for staying on blocks while crouching
  • Proper collision detection and resolution

StructsΒ§

MoveResult
Result of a movement operation.

EnumsΒ§

MoverType
Type of movement being performed.

ConstantsΒ§

EDGE_COLLISION_EPSILON πŸ”’
EDGE_STEP πŸ”’
MTH_EQUAL_EPSILON πŸ”’
STEP_HEIGHT_COLLISION_EPSILON πŸ”’
ZERO_MOVEMENT_EPSILON πŸ”’

FunctionsΒ§

apply_sneak_edge_prevention πŸ”’
Applies sneak-edge prevention to keep player from walking off blocks.
axis_step_order πŸ”’
Returns the axis step order for collision resolution.
can_fall_at_least πŸ”’
collect_candidate_step_up_heights πŸ”’
collect_collisions_with_context πŸ”’
collide_with_shapes πŸ”’
Resolves movement against a pre-collected shape set.
collide_with_world πŸ”’
Performs collision detection and resolution along all three axes.
horizontal_axis_collided πŸ”’
is_above_ground πŸ”’
move_aabb πŸ”’
Moves an AABB along a single axis by the given amount.
move_entity πŸ”’
Moves an entity through the world with collision detection and resolution.
push_step_height_candidate πŸ”’
should_try_step_up πŸ”’
Checks if step-up should be attempted.
sweep_aabb πŸ”’
Creates an AABB that encompasses the start and end positions of a movement.
try_step_up πŸ”’
Attempts to step up over an obstacle.