BVHNode class

A single node in a bounding volume hierarchy (BVH).

@author {@link https://github.com/robp94|robp94} @author {@link https://github.com/Mugen87|Mugen87}

Constructors

BVHNode()

Properties

boundingVolume AABB
final
centroids List<double>
final
children List<BVHNode>
final
hashCode int
The hash code for this object.
no setterinherited
parent BVHNode?
getter/setter pair
primitives List<double>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(double branchingFactor, double primitivesPerNode, double maxDepth, double currentDepth) BVHNode
Builds this BVH node. That means the respective bounding volume is computed and the node's primitives are distributed under child nodes. This only happens if the maximum hierarchical depth is not yet reached and the node does contain enough primitives required for a split.
computeBoundingVolume() BVHNode
Computes the AABB for this BVH node.
computeSplitAxis() Vector3
Computes the split axis. Right now, only the cardinal axes are potential split axes.
getDepth() double
Returns the depth of this BVH node in its hierarchy.
intersectRay(Ray ray, Vector3 result) Vector3?
Performs a ray/BVH node intersection test and stores the closest intersection point to the given 3D vector. If no intersection is detected, null is returned.
intersectsRay(Ray ray) bool
Performs a ray/BVH node intersection test. Returns either true or false if there is a intersection or not.
leaf() bool
Returns true if this BVH node is a leaf node.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
root() bool
Returns true if this BVH node is a root node.
sortPrimitives(dynamic a, dynamic b) int
split(double branchingFactor) BVHNode
Splits the node and distributes node's primitives over child nodes.
toString() String
A string representation of this object.
inherited
traverse(Function callback) BVHNode
Executes the given callback for this BVH node and its ancestors.

Operators

operator ==(Object other) bool
The equality operator.
inherited