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Β§
- Move
Result - Result of a movement operation.
EnumsΒ§
- Mover
Type - 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.