@ascentbv/ts-common - v1.0.123
    Preparing search index...

    Class DirectionUtilAbstract

    Index

    Constructors

    Methods

    • Converts a cardinal Direction to a rotation object.

      Parameters

      Returns { x: number; y: number }

      An object with x and y rotation values in degrees.

    • Converts a yaw rotation (in degrees) to the closest Direction.

      Parameters

      • num: number

        The yaw value in degrees.

      Returns Direction

      The closest facing direction.

    • Converts a yaw rotation (in degrees) to a direction Vec3.

      Parameters

      • num: number

        The yaw rotation in degrees.

      Returns Vec3

      The directional vector.

    • Locks a yaw rotation to the nearest 90-degree cardinal direction (e.g. -90, 0, 90, 180).

      Parameters

      • rotation: number

        The original yaw rotation.

      Returns number

      The snapped rotation value.