struct
TRay
template<typename T>A ray in 3D space represented with an origin and direction.
Public
Constructors
Methods
TransformAffine
Transforms the ray by the given matrix.
Intersects
Ray/plane intersection, returns boolean result and distance to intersection point.
Intersects
Ray/sphere intersection, returns boolean result and distance to nearest intersection point.
Intersects
Ray/axis aligned box intersection, returns boolean result and distance to nearest intersection point.
Intersects
Ray/triangle intersection, returns boolean result and distance to intersection point.
- a
- Triangle first vertex.
- b
- Triangle second vertex.
- c
- Triangle third vertex.
- normal
- The normal of the triangle. Doesn't need to be normalized.
- positiveSide
- (optional) Should intersections with the positive side (normal facing) count.
- negativeSide
- (optional) Should intersections with the negative side (opposite of normal facing) count.
Returns: Boolean result if intersection happened and distance to intersection point.
GetPoint
Gets the position of a point t units along the ray.
TransformAffine
Transforms the ray by the given matrix.
Intersects
Ray/plane intersection, returns boolean result and distance to intersection point.
Intersects
Ray/sphere intersection, returns boolean result and distance to nearest intersection point.
Intersects
Ray/axis aligned box intersection, returns boolean result and distance to nearest intersection point.
Intersects
Ray/triangle intersection, returns boolean result and distance to intersection point.
- a
- Triangle first vertex.
- b
- Triangle second vertex.
- c
- Triangle third vertex.
- normal
- The normal of the triangle. Doesn't need to be normalized.
- positiveSide
- (optional) Should intersections with the positive side (normal facing) count.
- negativeSide
- (optional) Should intersections with the negative side (opposite of normal facing) count.
Returns: Boolean result if intersection happened and distance to intersection point.
GetPoint
Gets the position of a point t units along the ray.
TransformAffine
Transforms the ray by the given matrix.
Intersects
Ray/plane intersection, returns boolean result and distance to intersection point.
Intersects
Ray/sphere intersection, returns boolean result and distance to nearest intersection point.
Intersects
Ray/axis aligned box intersection, returns boolean result and distance to nearest intersection point.
Intersects
Ray/triangle intersection, returns boolean result and distance to intersection point.
- a
- Triangle first vertex.
- b
- Triangle second vertex.
- c
- Triangle third vertex.
- normal
- The normal of the triangle. Doesn't need to be normalized.
- positiveSide
- (optional) Should intersections with the positive side (normal facing) count.
- negativeSide
- (optional) Should intersections with the negative side (opposite of normal facing) count.
Returns: Boolean result if intersection happened and distance to intersection point.
Fields
Origin
Direction
Origin
Direction
Origin
Direction
Operators
operator*
Gets the position of a point t units along the ray.
operator*
Gets the position of a point t units along the ray.