@kognifai/cogsengine
    Preparing search index...

    Class BoundingBox

    BoundingBox in single precision Engine Coordinates. Engine Coordinates. Used by

    • Scene.getSceneBoundingBox etc.
    • ...
    Index

    Constructors

    • Initializes a new instance of BoundingBox passing the extents.

      Parameters

      • Optionalmin: vec3

        Smallest xyz coordinate

      • Optionalmax: vec3

        Largest xyz coordinate

      Returns BoundingBox

    Properties

    _max: vec3
    _min: vec3

    Accessors

    • get center(): vec3

      Gets the center position of the bounding box.

      Returns vec3

    • get data(): Float32Array

      Gets the BoundingBox as Float32Array length=6, min + max

      Returns Float32Array

    • get extents(): vec3

      Gets the extents of the bounding box, negative if empty.

      Returns vec3

    • get max(): vec3

      Return max coordinate.

      Returns vec3

      Extents max

    • set max(value: vec3): void

      Set max coordinate.

      Parameters

      • value: vec3

        Extents min

      Returns void

    • get min(): vec3

      Return min coordinate.

      Returns vec3

      Extents min

    • set min(value: vec3): void

      Set min coordinate.

      Parameters

      • value: vec3

        Extents min

      Returns void

    Methods

    • Returns true if empty BoundingBox (e.g. min[x/y/z] > max)

      Returns boolean

    • Returns true if BoundingBoxes are equal

      Parameters

      Returns boolean

    • Returns true if bounding box hax max > min in all directions

      Returns boolean

    • Return intersection of this and other bounding box.

      Parameters

      Returns BoundingBox

      Intersection.

    • Convert to string. Returns "empty" or "{ min[0], min[1] etc. }"

      Returns string

    • Creates a new BoundingBox passing the extents.

      Parameters

      • Optionalmin: vec3

        Smallest xyz coordinate

      • Optionalmax: vec3

        Largest xyz coordinate

      Returns BoundingBox

      Created Bounding box

    • Create a new BoundingBox.

      Parameters

      • array: Float32Array<ArrayBufferLike> | number[]

        Array of six numbers: min and max xyz coordinates

      Returns BoundingBox

      Created instance.