Back to class index
Ray[Class Summary]
pos
dir
ctor (+3 overloads)
GetPoint(distance)[const]
Transform(transform) (+3 overloads)
Contains(...)[const] (+1 overload)
Equals(otherRay,epsilon)[const]
Distance(point,d)[const] (+9 overloads)
ClosestPoint(targetPoint,d)[const] (+3 overloads)
Intersects(...)[const] (+13 overloads)
IntersectsDisc(disc)[const]
ToLine()[const]
ToLineSegment(d)[const]

Ray::GetPoint

Syntax

float3 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.

Performance

4.105nsecs/call ≈ 243.59M calls/second ≈ 4.06M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

pos, dir.

Leave a Comment

Name:
Comments:
Captcha:captcha image Type in the black symbols:
Back to class index