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

    Class Ray

    Represents a mathematical ray in 3D space.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    direction: Vector3D = ...

    The normalized direction vector of the ray.

    origin: Vector3D = ...

    The origin point of the ray.

    Methods

    • Computes the point along the ray at a given distance.

      Parameters

      • t: number

        The distance along the ray.

      • target: Vector3D = ...

        Optional target vector.

      Returns Vector3D

      The computed point.

    • Tests whether this ray intersects the given AABB. Uses the slab method.

      Parameters

      Returns number

      The distance t to the intersection, or -1 if no intersection.