Header menu logo Nu

Ray3 Type

Represents a ray with an origin and a direction in 3D space. Copied from - https://github.com/MonoGame/MonoGame/blob/v3.8/MonoGame.Framework/Ray.cs Renamed Position to Origin by BGE for nomenclature more consistent with Nu.

Constructors

Constructor Description

Ray3(origin, direction)

Full Usage: Ray3(origin, direction)

Parameters:

Create a Ray3.

origin : Vector3

The origin of the Ray3.

direction : Vector3

The direction of the Ray3.

Instance members

Instance member Description

this.Equals

Full Usage: this.Equals

Parameters:
    obj : obj - The Object to test for equality with this Ray3.

Returns: bool
true
if the specified Object is equal to this Ray3,
false
if it is not.
Modifiers: abstract

Check if the specified Object is equal to this Ray3.

obj : obj

The Object to test for equality with this Ray3.

Returns: bool

true
if the specified Object is equal to this Ray3,
false
if it is not.

this.Equals

Full Usage: this.Equals

Parameters:
    other : Ray3 - The Ray3 to test for equality with this Ray3.

Returns: bool
true
if the specified Ray3 is equal to this Ray3,
false
if it is not.
Modifiers: abstract

Check if the specified Ray3 is equal to this Ray3.

other : Ray3

The Ray3 to test for equality with this Ray3.

Returns: bool

true
if the specified Ray3 is equal to this Ray3,
false
if it is not.

this.GetHashCode

Full Usage: this.GetHashCode

Returns: int A hash code for this Ray3.
Modifiers: abstract

Get a hash code for this Ray3.

Returns: int

A hash code for this Ray3.

this.Intersection

Full Usage: this.Intersection

Parameters:
Returns: Nullable<Vector3>

Attempt to find the intersection of the Ray3 with a Plane3. TODO: implement this in terms of Intersects?

plane : Plane3
Returns: Nullable<Vector3>

this.Intersects

Full Usage: this.Intersects

Parameters:
    box : Box3 - The Box3 to test for intersection.

Returns: Nullable<float32> The distance along the ray of the intersection or
null
if this Ray3 does not intersect the Box3.

Check if this Ray3 intersects the specified Box3.

box : Box3

The Box3 to test for intersection.

Returns: Nullable<float32>

The distance along the ray of the intersection or

null
if this Ray3 does not intersect the Box3.

this.Intersects

Full Usage: this.Intersects

Parameters:
    box : inref<Box3> - The Box3 to test for intersection.
    result : byref<Nullable<float32>> - The distance along the ray of the intersection or
    null
    
    if this Ray3 does not intersect the Box3.


Check if this Ray3 intersects the specified Box3.

box : inref<Box3>

The Box3 to test for intersection.

result : byref<Nullable<float32>>

The distance along the ray of the intersection or

null
if this Ray3 does not intersect the Box3.

this.Intersects

Full Usage: this.Intersects

Parameters:
Returns: Nullable<float32>
frustum : Frustum
Returns: Nullable<float32>

this.Intersects

Full Usage: this.Intersects

Parameters:
    sphere : Sphere - The !:Box to test for intersection.

Returns: Nullable<float32> The distance along the ray of the intersection or
null
if this Ray3 does not intersect the Sphere.

Check if this Ray3 intersects the specified Sphere.

sphere : Sphere

The !:Box to test for intersection.

Returns: Nullable<float32>

The distance along the ray of the intersection or

null
if this Ray3 does not intersect the Sphere.

this.Intersects

Full Usage: this.Intersects

Parameters:
Returns: Nullable<float32> The distance along the ray of the intersection or
null
if this Ray3 does not intersect the Plane3.

Check if this Ray3 intersects the specified Plane3.

plane : Plane3

The Plane3 to test for intersection.

Returns: Nullable<float32>

The distance along the ray of the intersection or

null
if this Ray3 does not intersect the Plane3.

this.Intersects

Full Usage: this.Intersects

Parameters:
    plane : inref<Plane3> - The Plane3 to test for intersection.
    result : byref<Nullable<float32>> - The distance along the ray of the intersection or
    null
    
    if this Ray3 does not intersect the Plane3.


Check if this Ray3 intersects the specified Plane3.

plane : inref<Plane3>

The Plane3 to test for intersection.

result : byref<Nullable<float32>>

The distance along the ray of the intersection or

null
if this Ray3 does not intersect the Plane3.

this.Intersects

Full Usage: this.Intersects

Parameters:
    sphere : inref<Sphere> - The Box3 to test for intersection.
    result : byref<Nullable<float32>> - The distance along the ray of the intersection or
    null
    
    if this Ray3 does not intersect the Sphere.


Check if this Ray3 intersects the specified Sphere.

sphere : inref<Sphere>

The Box3 to test for intersection.

result : byref<Nullable<float32>>

The distance along the ray of the intersection or

null
if this Ray3 does not intersect the Sphere.

this.Intersects

Full Usage: this.Intersects

Parameters:
Returns: bool

Attempt to get the first found intersection from an array of triangle vertices.

indices : int[]
vertices : Vector3[]
result : byref<Nullable<float32>>
Returns: bool

this.Project

Full Usage: this.Project

Parameters:
Returns: Vector3

Project a point onto the ray.

p : Vector3
Returns: Vector3

this.ToString

Full Usage: this.ToString

Returns: string A String representation of this Ray3.
Modifiers: abstract

Get a String representation of this Ray3.

Returns: string

A String representation of this Ray3.

this.Transform

Full Usage: this.Transform

Parameters:
Returns: Ray3

Transform this Ray3 by a matrix.

m : Matrix4x4
Returns: Ray3

this.Transform

Full Usage: this.Transform

Parameters:
Returns: Ray3

Transform this Ray3 by a quaternion.

q : Quaternion
Returns: Ray3

Static members

Static member Description

a <> b

Full Usage: a <> b

Parameters:
    a : Ray3 - A ray to check for inequality.
    b : Ray3 - A ray to check for inequality.

Returns: bool
true
if the two rays are not equal,
false
if they are.

Check if two rays are not equal.

a : Ray3

A ray to check for inequality.

b : Ray3

A ray to check for inequality.

Returns: bool

true
if the two rays are not equal,
false
if they are.

a = b

Full Usage: a = b

Parameters:
    a : Ray3 - A ray to check for equality.
    b : Ray3 - A ray to check for equality.

Returns: bool
true
if the two rays are equals,
false
if they are not.

Check if two rays are equal.

a : Ray3

A ray to check for equality.

b : Ray3

A ray to check for equality.

Returns: bool

true
if the two rays are equals,
false
if they are not.

Type something to start searching.