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

Syntax

Ray::Ray(); [1 line of code]

The default constructor does not initialize any members of this class.

This means that the values of the members pos and dir are undefined after creating a new Ray using this default constructor. Remember to assign to them before use.

See Also

pos, dir.

Syntax

Ray::Ray(const float4 &pos, const float4 &dir); [5 lines of code]

Constructs a new ray by explicitly specifying the member variables.

Parameters

const float4 &posThe origin position of the ray. const float4 &dirThe direction of the ray. This vector must be normalized, this function will not normalize the vector for you (for performance reasons).

See Also

pos, dir.

Syntax

Ray::Ray(const Line &line); [5 lines of code]

Converts a Line to a Ray.

This conversion simply copies the members pos and dir over from the given Line to this Ray. This means that the new Ray starts at the same position, but only extends to one direction in space, instead of two.

See Also

class Line, ToLine().

Syntax

Ray::Ray(const LineSegment &lineSegment); [4 lines of code]

Converts a LineSegment to a Ray.

This constructor sets pos = lineSegment.a, and dir = (lineSegment.b - lineSegment.a).Normalized().

See Also

class LineSegment, ToLineSegment().