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::Contains

Syntax

bool Ray::Contains(const float3 &point, float distanceThreshold=1e-3f) const; [4 lines of code]
bool Ray::Contains(const LineSegment &lineSegment, float distanceThreshold=1e-3f) const; [4 lines of code]

Tests if the given object is fully contained on this ray.

Parameters

floatdistanceThresholdThe magnitude of the epsilon test threshold to use. Since a Ray is a 1D object in a 3D space, an epsilon threshold is used to allow errors caused by floating-point inaccuracies.

Return Value

True if this ray contains the given object, up to the given distance threshold.

Performance

bool Ray::Contains(const float3 &point, float distanceThreshold=1e-3f) const

20.526nsecs/call ≈ 48.72M calls/second ≈ 811.97k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

bool Ray::Contains(const LineSegment &lineSegment, float distanceThreshold=1e-3f) const

20.526nsecs/call ≈ 48.72M calls/second ≈ 811.97k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

class LineSegment, Distance(), ClosestPoint(), Intersects().

Leave a Comment

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