Class OctreeNode
java.lang.Object
com.marginallyclever.ro3.apps.pathtracer.spatialaccelerationstructure.OctreeNode
- All Implemented Interfaces:
SpatialAccelerationStructure
OctreeNode is a node in an octree structure used for spatial partitioning.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called after all triangles are inserted.boolean
insert
(PathTriangle triangle) Add a new triangle to the SASFinds the first intersecting triangle for a given ray within the spatial acceleration structure.void
print()
-
Constructor Details
-
OctreeNode
-
-
Method Details
-
insert
Description copied from interface:SpatialAccelerationStructure
Add a new triangle to the SAS- Specified by:
insert
in interfaceSpatialAccelerationStructure
- Parameters:
triangle
- the triangle to add.- Returns:
- true if it was added.
-
finishInserts
public void finishInserts()Description copied from interface:SpatialAccelerationStructure
Called after all triangles are inserted. Good for final step optimizing.- Specified by:
finishInserts
in interfaceSpatialAccelerationStructure
-
intersect
Description copied from interface:SpatialAccelerationStructure
Finds the first intersecting triangle for a given ray within the spatial acceleration structure.- Specified by:
intersect
in interfaceSpatialAccelerationStructure
- Parameters:
ray
- the ray to test for intersection with the triangles in the structure- Returns:
- the first intersecting
PathTriangle
, ornull
if no intersection is found
-
print
public void print()
-