Small World Engine API Reference - v0.76.20
    Preparing search index...

    Interface GridMovementOptions

    interface GridMovementOptions {
        direction?: Vector3D;
        gridSize?: number;
        onGridIntersection?: (
            currentPosition: Vector3D,
            currentDirection: Vector3D,
        ) => Vector3D | null;
        speed?: number;
    }
    Index
    direction?: Vector3D

    Initial movement direction. Must be normalized.

    gridSize?: number

    The size of the grid cells. Turns are only evaluated when crossing these bounds.

    onGridIntersection?: (
        currentPosition: Vector3D,
        currentDirection: Vector3D,
    ) => Vector3D | null

    Callback fired every time the object reaches a grid intersection. Return a new Vector3D to change direction, or null to keep the current direction.

    speed?: number

    The speed in units per second