Package org.sunflow.core.accel
Class UniformGrid
- java.lang.Object
-
- org.sunflow.core.accel.UniformGrid
-
- All Implemented Interfaces:
AccelerationStructure
public final class UniformGrid extends java.lang.Object implements AccelerationStructure
-
-
Field Summary
Fields Modifier and Type Field Description private BoundingBoxboundsprivate int[][]cellsprivate floatinvVoxelwxprivate floatinvVoxelwyprivate floatinvVoxelwzprivate intnxprivate intnyprivate intnzprivate PrimitiveListprimitivesprivate floatvoxelwxprivate floatvoxelwyprivate floatvoxelwz
-
Constructor Summary
Constructors Constructor Description UniformGrid()
-
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 voidgetGridIndex(float x, float y, float z, int[] i)voidintersect(Ray r, IntersectionState state)Intersect the specified ray with the geometry in local space.
-
-
-
Field Detail
-
nx
private int nx
-
ny
private int ny
-
nz
private int nz
-
primitives
private PrimitiveList primitives
-
bounds
private BoundingBox bounds
-
cells
private int[][] cells
-
voxelwx
private float voxelwx
-
voxelwy
private float voxelwy
-
voxelwz
private float voxelwz
-
invVoxelwx
private float invVoxelwx
-
invVoxelwy
private float invVoxelwy
-
invVoxelwz
private float invVoxelwz
-
-
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
-
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
-
getGridIndex
private void getGridIndex(float x, float y, float z, int[] i)
-
-