public final class BoundingVolumeHierarchy
extends java.lang.Object
BoundingVolumeHierarchy
is an implementation of an acceleration structure called a Bounding Volume Hierarchy (BVH).Modifier and Type | Class and Description |
---|---|
static class |
BoundingVolumeHierarchy.LeafNode
A
LeafNode is a BoundingVolumeHierarchy.Node implementation that represents a leaf node in a Bounding Volume Hierarchy (BVH). |
static class |
BoundingVolumeHierarchy.Node
A
Node is an abstract base type used to represent a node in a Bounding Volume Hierarchy (BVH). |
static class |
BoundingVolumeHierarchy.TreeNode
A
TreeNode is a BoundingVolumeHierarchy.Node implementation that represents a tree node in a Bounding Volume Hierarchy (BVH). |
Modifier and Type | Field and Description |
---|---|
static int |
NODE_TYPE_LEAF
The type number associated with a
BoundingVolumeHierarchy.LeafNode . |
static int |
NODE_TYPE_TREE
The type number associated with a
BoundingVolumeHierarchy.TreeNode . |
Modifier and Type | Method and Description |
---|---|
static BoundingVolumeHierarchy |
createBoundingVolumeHierarchy(java.util.List<Triangle> triangles)
|
boolean |
equals(java.lang.Object object)
Compares
object to this BoundingVolumeHierarchy instance for equality. |
BoundingVolumeHierarchy.Node |
getRoot()
Returns the root
BoundingVolumeHierarchy.Node of this BoundingVolumeHierarchy instance. |
int |
hashCode()
Returns a hash code for this
BoundingVolumeHierarchy instance. |
public static final int NODE_TYPE_LEAF
BoundingVolumeHierarchy.LeafNode
. The number is 2
.public static final int NODE_TYPE_TREE
BoundingVolumeHierarchy.TreeNode
. The number is 1
.public BoundingVolumeHierarchy.Node getRoot()
BoundingVolumeHierarchy.Node
of this BoundingVolumeHierarchy
instance.Node
of this BoundingVolumeHierarchy
instancepublic boolean equals(java.lang.Object object)
object
to this BoundingVolumeHierarchy
instance for equality.
Returns true
if, and only if, object
is an instance of BoundingVolumeHierarchy
, and their respective values are equal, false
otherwise.
equals
in class java.lang.Object
object
- the Object
to compare to this BoundingVolumeHierarchy
instance for equalitytrue
if, and only if, object
is an instance of BoundingVolumeHierarchy
, and their respective values are equal, false
otherwisepublic int hashCode()
BoundingVolumeHierarchy
instance.hashCode
in class java.lang.Object
BoundingVolumeHierarchy
instancepublic static BoundingVolumeHierarchy createBoundingVolumeHierarchy(java.util.List<Triangle> triangles)
BoundingVolumeHierarchy
based on a List
of Triangle
s.
Returns a BoundingVolumeHierarchy
instance.
If either triangles
or at least one Triangle
in triangles
are null
, a NullPointerException
will be thrown.
triangles
- the Triangle
s to create the BoundingVolumeHierarchy
fromBoundingVolumeHierarchy
instancejava.lang.NullPointerException
- thrown if, and only if, either triangles
or at least one Triangle
in triangles
are null