Struct Ray
Represents a ray.
Implements
Inherited Members
Namespace: Evergine.Mathematics
Assembly: Evergine.Mathematics.dll
Syntax
public struct Ray : IEquatable<Ray>
  Constructors
Ray(Vector3, Vector3)
Initializes a new instance of the Ray struct.
Declaration
public Ray(Vector3 position, Vector3 direction)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Vector3 | position | The position.  | 
      
| Vector3 | direction | The direction.  | 
      
Fields
Direction
Ray direction.
Declaration
public Vector3 Direction
  Field Value
| Type | Description | 
|---|---|
| Vector3 | 
Position
Ray origin position.
Declaration
public Vector3 Position
  Field Value
| Type | Description | 
|---|---|
| Vector3 | 
Methods
Equals(Ray)
Equalses the specified other.
Declaration
public bool Equals(Ray other)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | other | The other.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | The result.  | 
      
Equals(ref Ray)
Equalses the specified other.
Declaration
public bool Equals(ref Ray other)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | other | The other.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | The result.  | 
      
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| object | obj | The object to compare with this instance.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.  | 
      
Overrides
GetPoint(float)
Gets a point at distance units along the ray.
Declaration
public Vector3 GetPoint(float distance)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | distance | he distance.  | 
      
Returns
| Type | Description | 
|---|---|
| Vector3 | The point.  | 
      
GetPoint(float, out Vector3)
Gets a point at distance units along the ray.
Declaration
public void GetPoint(float distance, out Vector3 result)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | distance | he distance.  | 
      
| Vector3 | result | The point.  | 
      
IntersectionXPlane(float)
Gets the intersection point with the X plane at the specified X value.
Declaration
public Vector3 IntersectionXPlane(float xValue)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | xValue | The X plane value.  | 
      
Returns
| Type | Description | 
|---|---|
| Vector3 | The intersection point with the ray.  | 
      
IntersectionXPlane(float, out Vector3)
Gets the intersection point with the X plane at the specified X value.
Declaration
public void IntersectionXPlane(float xValue, out Vector3 point)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | xValue | The X plane value.  | 
      
| Vector3 | point | The intersection point with the ray.  | 
      
IntersectionYPlane(float)
Gets the intersection point with the Y plane at the specified Y value.
Declaration
public Vector3 IntersectionYPlane(float yValue)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | yValue | The Y plane value.  | 
      
Returns
| Type | Description | 
|---|---|
| Vector3 | The intersection point with the ray.  | 
      
IntersectionYPlane(float, out Vector3)
Gets the intersection point with the Y plane at the specified Y value.
Declaration
public void IntersectionYPlane(float yValue, out Vector3 point)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | yValue | The Y plane value.  | 
      
| Vector3 | point | The intersection point with the ray.  | 
      
IntersectionZPlane(float)
Gets the intersection point with the Z plane at the specified Z value.
Declaration
public Vector3 IntersectionZPlane(float zValue)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | zValue | The Z plane value.  | 
      
Returns
| Type | Description | 
|---|---|
| Vector3 | The intersection point with the ray.  | 
      
IntersectionZPlane(float, out Vector3)
Gets the intersection point with the Z plane at the specified Z value.
Declaration
public void IntersectionZPlane(float zValue, out Vector3 point)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | zValue | The Z plane value.  | 
      
| Vector3 | point | The intersection point with the ray.  | 
      
Intersects(BoundingBox)
Intersectses the specified box.
Declaration
public float? Intersects(BoundingBox box)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | box | The box.  | 
      
Returns
| Type | Description | 
|---|---|
| float? | The result.  | 
      
Intersects(ref BoundingBox, out float?)
Intersectses the specified box.
Declaration
public void Intersects(ref BoundingBox box, out float? result)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | box | The box.  | 
      
| float? | result | The result.  | 
      
Intersects(BoundingFrustum)
Intersectses the specified frustum.
Declaration
public float? Intersects(BoundingFrustum frustum)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingFrustum | frustum | The frustum.  | 
      
Returns
| Type | Description | 
|---|---|
| float? | The result.  | 
      
Intersects(BoundingSphere)
Intersectses the specified sphere.
Declaration
public float? Intersects(BoundingSphere sphere)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere.  | 
      
Returns
| Type | Description | 
|---|---|
| float? | The result.  | 
      
Intersects(ref BoundingSphere, out float?)
Intersectses the specified sphere.
Declaration
public void Intersects(ref BoundingSphere sphere, out float? result)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere.  | 
      
| float? | result | The result.  | 
      
Intersects(Plane, bool)
Intersectses the specified plane.
Declaration
public float? Intersects(Plane plane, bool ignoreNegative = true)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Plane | plane | The plane.  | 
      
| bool | ignoreNegative | Ignore negative values.  | 
      
Returns
| Type | Description | 
|---|---|
| float? | The result.  | 
      
Intersects(ref Plane, out float?, bool)
Intersectses the specified plane.
Declaration
public void Intersects(ref Plane plane, out float? result, bool ignoreNegative = true)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Plane | plane | The plane.  | 
      
| float? | result | The result.  | 
      
| bool | ignoreNegative | Ignore negative values.  | 
      
Intersects(ref Ray, out float?, out float?)
Calculate the closest points between two rays.
Declaration
public void Intersects(ref Ray ray, out float? distanceA, out float? distanceB)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | ray | The second ray.  | 
      
| float? | distanceA | The closest point distance in first ray to the second ray.  | 
      
| float? | distanceB | The closest point distance in second ray to the first ray.  | 
      
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| string | A string that represents this instance.  | 
      
Overrides
Operators
operator ==(Ray, Ray)
Implements the operator ==.
Declaration
public static bool operator ==(Ray a, Ray b)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | a | The a.  | 
      
| Ray | b | The b.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | The result of the operator.  | 
      
operator !=(Ray, Ray)
Implements the operator !=.
Declaration
public static bool operator !=(Ray a, Ray b)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | a | The a.  | 
      
| Ray | b | The b.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | The result of the operator.  |