A ray in 3D space.
struct
|
Ray
|
The unit-length ray direction vector.
public
readonly
field
|
Direction
|
||
type
|
Vec3D
|
Is this ray undefined?
public
property
|
IsUndefined
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
ray
is
undefined,
false
if
not. |
See also:
UndefinedThe origin of the ray.
public
readonly
field
|
Origin
|
||
type
|
Vec3D
|
The undefined ray.
public
static
readonly
field
|
Undefined
|
||
type
|
Ray
|
See also:
IsUndefinedCreates a ray that starts at origin and points into the given direction.
[Pure]
|
||||
public
static
method
|
ForDirection
(Vec3D origin,
Vec3D direction)
|
|||
type
|
Ray
|
|||
params
|
origin
|
The start point of the ray. | ||
direction
|
The direction vector of the ray. The vector will be normalized to unit length. | |||
returns
|
|
The ray originating at origin, pointing in direction. |
Creates a ray that starts at origin and points into the given direction.
[Pure]
|
||||
public
static
method
|
ForDirection
(Vec3D origin,
Vec3D direction,
out Ray ray)
|
|||
type
|
float64
|
|||
params
|
origin
|
The start point of the ray. | ||
direction
|
The direction vector of the ray. The vector will be normalized to unit length. | |||
ray
|
The ray originating at origin, pointing in direction. | |||
returns
|
|
Length of direction. |
Creates a ray that starts at origin and points towards target.
[Pure]
|
||||
public
static
method
|
ForTarget
(Vec3D origin,
Vec3D target)
|
|||
type
|
Ray
|
|||
params
|
origin
|
The start point of the ray. | ||
target
|
The target point of the ray. | |||
returns
|
|
The ray originating at origin, pointing towards target. |
Creates a ray that starts at origin and points towards target.
[Pure]
|
||||
public
static
method
|
ForTarget
(Vec3D origin,
Vec3D target,
out Ray ray)
|
|||
type
|
float64
|
|||
params
|
origin
|
The start point of the ray. | ||
target
|
The target point of the ray. | |||
ray
|
The ray originating at origin, pointing towards target. | |||
returns
|
|
The distance between origin and target. |
Creates a new instance of Ray.
public
constructor
|
Ray
(Vec3D origin,
Vec3D direction)
|
||
params
|
origin
|
The ray origin. | |
direction
|
The unit-length ray direction. |
Returns the point at the given distance along the ray Direction from the ray Origin.
[Pure]
|
||||
public
method
|
Distance
(float64 v)
|
|||
type
|
Vec3D
|
|||
params
|
v
|
The distance along Direction. | ||
returns
|
The point. |
Returns the distance of the given point along the ray Direction from the ray Origin.
[Pure]
|
||||
public
method
|
Distance
(Vec3D v)
|
|||
type
|
float64
|
|||
params
|
v
|
The point. | ||
returns
|
The distance along Direction. |
Returns the distance of the given point along this ray.
[Pure]
|
||||
public
method
|
Distance
(float64 x,
float64 y,
float64 z)
|
|||
type
|
float64
|
|||
params
|
x
|
X-coordinate of the point. | ||
y
|
Y-coordinate of the point. | |||
z
|
Z-coordinate of the point. | |||
returns
|
The distance of the given point along this ray. |
Intersects this ray with the given plane.
[Pure]
|
||||
public
method
|
Intersect
(Plane plane)
|
|||
type
|
Vec3D
|
|||
params
|
plane
|
The plane to intersect with. | ||
returns
|
The intersection point or Undefined if there is no intersection. |
Intersects this ray with the given sphere.
[Pure]
|
||||
public
method
|
Intersect
(Sphere sphere)
|
|||
type
|
Vec3D
|
|||
params
|
sphere
|
The sphere to intersect with. | ||
returns
|
The intersection point or Undefined if there is no intersection. |
Scales this ray.
[Pure]
|
||||
public
method
|
Scale
(float64 factor)
|
|||
type
|
Ray
|
|||
params
|
factor
|
The scale factor. | ||
returns
|
The scaled ray. |
The serialization helper object for values of Ray.
public
static
readonly
field
|
Serializer
|
||
type
|
ITypeSerializer<Ray>
|