RSX Code Reference
    Preparing search index...

    Class Rect3

    The Rect3 implements a rectangle in three dimensional space. It is represented by two axes that extend from the specified origin. Axes should be perpendicular to each other and they extend in both positive and negative directions from the origin by the amount specified by extents.

    The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the rectangle with updates values. It also implies that the values of the rectangle cannot be directly modified.

    The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.

    Index
    __axisHorizontal: Vector3
    __axisVertical: Vector3
    __center: Vector3
    __extentHorizontal: number
    __extentVertical: number
    • get _axisHorizontal(): Vector3

      Returns Vector3

    • set _axisHorizontal(value: Immutable<Vector3>): void

      Parameters

      Returns void

    • get _axisVertical(): Vector3

      Returns Vector3

    • set _axisVertical(value: Immutable<Vector3>): void

      Parameters

      Returns void

    • get _extentHorizontal(): number

      Returns number

    • set _extentHorizontal(value: number): void

      Parameters

      • value: number

      Returns void

    • get _extentVertical(): number

      Returns number

    • set _extentVertical(value: number): void

      Parameters

      • value: number

      Returns void

    • Copies all properties defined by the prototype of Rect3 from other to this instance.

      Parameters

      Returns Rect3

    • Clones this instance and returns a new Rect3 with identical values.

      Returns Rect3

    • Creates a new rectangle.

      Parameters

      • center: Immutable<Vector3>

        Origin of the rectangle.

      • axes: Vector3[]

        Two axes that define orientation of the rectangle. Axes extend from the origin. Axes should be normalized.

      • extents: number[]

        Two extents that define the size of the rectangle. Extends should be half the width/height as they are applied in both directions.

      Returns Rect3