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 TypeMethodDescriptionvoidCalled after all triangles are inserted.booleaninsert(PathTriangle triangle) Add a new triangle to the SASFinds the first intersecting triangle for a given ray within the spatial acceleration structure.voidprint()
-
Constructor Details
-
OctreeNode
-
-
Method Details
-
insert
Description copied from interface:SpatialAccelerationStructureAdd a new triangle to the SAS- Specified by:
insertin interfaceSpatialAccelerationStructure- Parameters:
triangle- the triangle to add.- Returns:
- true if it was added.
-
finishInserts
public void finishInserts()Description copied from interface:SpatialAccelerationStructureCalled after all triangles are inserted. Good for final step optimizing.- Specified by:
finishInsertsin interfaceSpatialAccelerationStructure
-
intersect
Description copied from interface:SpatialAccelerationStructureFinds the first intersecting triangle for a given ray within the spatial acceleration structure.- Specified by:
intersectin interfaceSpatialAccelerationStructure- Parameters:
ray- the ray to test for intersection with the triangles in the structure- Returns:
- the first intersecting
PathTriangle, ornullif no intersection is found
-
print
public void print()
-