Class Ray
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Ray
Represents a ray used for tracing through an
OctreeVolume.
A ray is defined by an origin point and a direction vector.
After tracing through the octree, the intersection results are stored in the
hitPoint, hitCellSize, and hitCellX/hitCellY/hitCellZ
fields, which are populated by the octree traversal algorithm.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe direction vector of the ray.intThe size (side length) of the octree cell that was hit.intThe x coordinate of the octree cell that was hit.intThe y coordinate of the octree cell that was hit.intThe z coordinate of the octree cell that was hit.The point in world space where the ray intersected an octree cell.The origin point of the ray (the starting position in world space). -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
origin
The origin point of the ray (the starting position in world space). -
direction
The direction vector of the ray. Does not need to be normalized; the octree traversal handles arbitrary direction magnitudes. -
hitPoint
The point in world space where the ray intersected an octree cell. Set by the octree traversal algorithm after a successful intersection. -
hitCellSize
public int hitCellSizeThe size (side length) of the octree cell that was hit. A value of 1 indicates a leaf cell at the finest resolution. -
hitCellX
public int hitCellXThe x coordinate of the octree cell that was hit. -
hitCellY
public int hitCellYThe y coordinate of the octree cell that was hit. -
hitCellZ
public int hitCellZThe z coordinate of the octree cell that was hit.
-
-
Constructor Details
-
Ray
Creates a new ray with the specified origin and direction.- Parameters:
origin- the starting point of the raydirection- the direction vector of the ray
-