The ray type, for ray-object intersection tests (raycasting)

Constructor

inlinenew()

New unintialized ray

Variables

d:Vec3

Direction of the ray

o:Vec3

Starting point of the ray

tmax:Float

Maximum t parameter (for excluding far intersections)

tmin:Float

Minimum t parameter (for excluding near intersections)

Methods

inlinehitBBox(bb:BBox):RayHit

Intersection test with a bounding box

Parameters:

bb

the bounding box

Returns:

null (no intersection), or an object holding intersection info

inlinehitBVH(bvh:BVHTree):RayHit

Intersection test with a bounding volume hierarchy

Parameters:

bvh

the bounding volume hierarchy

Returns:

null (no intersection), or an object holding intersection info

inlinehitTriangle(p0:Vec3, p1:Vec3, p2:Vec3):RayHit

Intersection test with a triangle

Parameters:

p0

first vertex of the triangle

p1

second vertex of the triangle

p2

third vertex of the triangle

Returns:

null (no intersection), or an object holding intersection info