Header menu logo Nu

Ray2 Type

Represents a ray with an origin and a direction in 2D space. Copied from - https://github.com/MonoGame/MonoGame/blob/v2.8/MonoGame.Framework/Ray.cs Renamed Position to Origin by BGE for nomenclature more consistent with Nu. TODO: implement Circle type and intersection with this and it.

Constructors

Constructor Description

Ray2(origin, direction)

Full Usage: Ray2(origin, direction)

Parameters:

Create a Ray2.

origin : Vector2

The origin of the Ray2.

direction : Vector2

The direction of the Ray2.

Instance members

Instance member Description

this.Equals

Full Usage: this.Equals

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

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

Check if the specified Object is equal to this Ray2.

obj : obj

The Object to test for equality with this Ray2.

Returns: bool

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

this.Equals

Full Usage: this.Equals

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

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

Check if the specified Ray2 is equal to this Ray2.

other : Ray2

The Ray2 to test for equality with this Ray2.

Returns: bool

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

this.GetHashCode

Full Usage: this.GetHashCode

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

Get a hash code for this Ray2.

Returns: int

A hash code for this Ray2.

this.Intersects

Full Usage: this.Intersects

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

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

Check if this Ray2 intersects the specified Box2.

box : Box2

The Box2 to test for intersection.

Returns: Nullable<float32>

The distance along the ray of the intersection or

null
if this Ray2 does not intersect the Box2.

this.Intersects

Full Usage: this.Intersects

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


Check if this Ray2 intersects the specified Box2.

box : inref<Box2>

The Box2 to test for intersection.

result : byref<Nullable<float32>>

The distance along the ray of the intersection or

null
if this Ray2 does not intersect the Box2.

this.Project

Full Usage: this.Project

Parameters:
Returns: Vector2

Project a point onto the ray.

p : Vector2
Returns: Vector2

this.ToString

Full Usage: this.ToString

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

Get a String representation of this Ray2.

Returns: string

A String representation of this Ray2.

this.Transform

Full Usage: this.Transform

Parameters:
Returns: Ray2

Transform this Ray2 by a matrix.

m : Matrix4x4
Returns: Ray2

this.Transform

Full Usage: this.Transform

Parameters:
Returns: Ray2

Transform this Ray2 by a quaternion.

q : Quaternion
Returns: Ray2

Static members

Static member Description

a <> b

Full Usage: a <> b

Parameters:
    a : Ray2 - A ray to check for inequality.
    b : Ray2 - 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 : Ray2

A ray to check for inequality.

b : Ray2

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 : Ray2 - A ray to check for equality.
    b : Ray2 - 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 : Ray2

A ray to check for equality.

b : Ray2

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.