Back to class index
Ray[Class Summary]
pos
dir
ctor (+3 overloads)
IsFinite()[const]
GetPoint(distance)[const]
Translate(offset)
Transform(transform) (+3 overloads)
Contains(...)[const] (+1 overload)
Equals(otherRay,epsilon)[const]
BitEquals(other)[const]
Distance(point)[const] (+12 overloads)
ClosestPoint(targetPoint)[const] (+10 overloads)
Intersects(...)[const] (+13 overloads)
IntersectsDisc(disc)[const]
ToLine()[const]
ToLineSegment(d)[const]
ProjectToAxis(...)[const]
ToLineSegment(dStart,dEnd)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
FromString(str,outEndStr)[static] (+1 overload)

Ray::GetPoint

Syntax

float4 Ray::GetPoint(float distance) const; [5 lines of code]

Gets a point along the ray at the given distance.

Use this function to convert a 1D parametric point along the Ray to a 3D point in the linear space.

Parameters

floatdistanceThe point to compute. GetPoint(0) will return pos. GetPoint(t) will return a point at distance |t| from pos. Passing in negative values is allowed, but in that case, the returned point does not actually lie on this Ray.

Return Value

pos + distance * dir.

See Also

pos, dir.