RSX Code Reference
    Preparing search index...

    Class Capsule

    The CapsuleD implements a capsule represented by a line segment and a radius. The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the sphere with updates values. It also implies that the values of the sphere 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
    _radius: number
    _segment: LineSegment
    • get radius(): number

      Returns number

    • set radius(value: number): void

      Parameters

      • value: number

      Returns void

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

      Returns Capsule

    • Creates a new capsule with the given parameters.

      Parameters

      • start: Vector3

        The start of the line segment defining the capsule.

      • end: Vector3

        The end of the line segment defining the capsule.

      • radius: number

        The radius of the capsule.

      Returns Capsule

      The newly constructed capsule.