Package org.sunflow.core.accel
Class BoundingIntervalHierarchy
- java.lang.Object
-
- org.sunflow.core.accel.BoundingIntervalHierarchy
-
- All Implemented Interfaces:
AccelerationStructure
public class BoundingIntervalHierarchy extends java.lang.Object implements AccelerationStructure
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classBoundingIntervalHierarchy.BuildStats
-
Field Summary
Fields Modifier and Type Field Description private BoundingBoxboundsprivate intmaxPrimsprivate int[]objectsprivate PrimitiveListprimitivesprivate int[]tree
-
Constructor Summary
Constructors Constructor Description BoundingIntervalHierarchy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuild(PrimitiveList primitives)Construct an acceleration structure for the specified primitive list.private voidbuildHierarchy(IntArray tempTree, int[] indices, BoundingIntervalHierarchy.BuildStats stats)private voidcreateNode(IntArray tempTree, int nodeIndex, int left, int right)voidintersect(Ray r, IntersectionState state)Intersect the specified ray with the geometry in local space.private voidsubdivide(int left, int right, IntArray tempTree, int[] indices, float[] gridBox, float[] nodeBox, int nodeIndex, int depth, BoundingIntervalHierarchy.BuildStats stats)
-
-
-
Field Detail
-
tree
private int[] tree
-
objects
private int[] objects
-
primitives
private PrimitiveList primitives
-
bounds
private BoundingBox bounds
-
maxPrims
private int maxPrims
-
-
Method Detail
-
build
public void build(PrimitiveList primitives)
Description copied from interface:AccelerationStructureConstruct an acceleration structure for the specified primitive list.- Specified by:
buildin interfaceAccelerationStructure
-
buildHierarchy
private void buildHierarchy(IntArray tempTree, int[] indices, BoundingIntervalHierarchy.BuildStats stats)
-
createNode
private void createNode(IntArray tempTree, int nodeIndex, int left, int right)
-
subdivide
private void subdivide(int left, int right, IntArray tempTree, int[] indices, float[] gridBox, float[] nodeBox, int nodeIndex, int depth, BoundingIntervalHierarchy.BuildStats stats)
-
intersect
public void intersect(Ray r, IntersectionState state)
Description copied from interface:AccelerationStructureIntersect the specified ray with the geometry in local space. The ray will be provided in local space.- Specified by:
intersectin interfaceAccelerationStructure- Parameters:
r- ray in local spacestate- state to store the intersection into
-
-