jakke-graphics-ts
    Preparing search index...

    Class BVHBoundingBox

    Index

    Accessors

    • get isEmpty(): boolean

      Indicates whether the BVH tree is empty. Returns true if the tree has not been initialized.

      Returns boolean

    • get max(): BVHVertex

      Gets the maximum BVH vertex in the tree.

      Returns BVHVertex

      The maximum BVHVertex stored in this BVHTree.

    • get min(): BVHVertex

      Gets the minimum bounding vertex of the BVH tree.

      Returns BVHVertex

      The BVHVertex representing the minimum bounds.

    Methods

    • Adds a vertex to the BVH tree if it is not already present. Updates the minimum and maximum bounds of the tree to include the new vertex. Marks the tree as initialized after adding the vertex.

      Parameters

      • v: BVHVertex

        The BVHVertex to add to the tree.

      Returns ActionResult

      An ActionResult object indicating whether the vertex was added successfully. If the vertex is already present, returns result: false with a message.

    • Calculates and returns the centroid of the bounding volume defined by _min and _max. The centroid is computed as the midpoint between the minimum and maximum coordinates.

      Returns undefined | BVHVertex

      The centroid as a BVHVertex instance, or undefined if the tree is not initialized.

    • Calculates and returns the diagonal vector of the bounding box defined by _min and _max. The diagonal is computed as the difference between the maximum and minimum coordinates along each axis (x, y, z).

      Returns undefined | BVHVertex

      A new BVHVertex representing the diagonal vector, or undefined if the bounding box is not initialized.