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

    Interface RaycastHit

    Result structure returned from a physics raycast or shape-cast query.

    interface RaycastHit {
        collider: Collidable;
        distance: number;
        normal: Vector3D;
        object?: Object3D;
        point: Vector3D;
    }
    Index
    collider: Collidable

    The hit Collidable entity (e.g., Object3D or StaticCollider).

    distance: number

    Distance t from ray origin to the intersection point.

    normal: Vector3D

    Surface normal vector pointing outward from the struck surface.

    object?: Object3D

    The hit Object3D if the collider is an instance of Object3D.

    point: Vector3D

    Exact 3D world position where the ray or volume struck the surface.