CollideXZ: (
from: { x: number; z: number },
to: { x: number; z: number },
) => { blocked?: boolean; x: number; z: number }
Type Declaration
-
- (
from: { x: number; z: number },
to: { x: number; z: number },
): { blocked?: boolean; x: number; z: number }
-
Parameters
- from: { x: number; z: number }
- to: { x: number; z: number }
Returns { blocked?: boolean; x: number; z: number }
Clamps one frame's intended horizontal move to wherever collision actually allows - the hook
mwg/3d's own grid collision (resolveCapsuleAgainstGrid) plugs into.blocked, when the resolver reports it (resolveCapsuleAgainstGridalways does), tellsupdatedirectly whether the move was cut short, rather thanupdatere-deriving the same fact by comparing the resolved position against the intended one through separate floating-point arithmetic - two numbers that are conceptually equal are not guaranteed bit-identical.