Interface SpatialAccelerationStructure
- All Known Implementing Classes:
BoundingVolumeHeirarchy,OctreeNode
public interface SpatialAccelerationStructure
Interface for a Spatial Acceleration Structure (SAS) used in ray tracing to optimize intersection tests.
-
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.
-
Method Details
-
insert
Add a new triangle to the SAS- Parameters:
triangle- the triangle to add.- Returns:
- true if it was added.
-
finishInserts
void finishInserts()Called after all triangles are inserted. Good for final step optimizing. -
intersect
Finds the first intersecting triangle for a given ray within the spatial acceleration structure.- Parameters:
ray- the ray to test for intersection with the triangles in the structure- Returns:
- the first intersecting
PathTriangle, ornullif no intersection is found
-