Struct GorgonRay
Represents a three dimensional line based on a point in space and a direction.
Inherited Members
Namespace: Gorgon.Renderers.Data
Assembly: Gorgon.Core.dll
Syntax
public struct GorgonRay : IGorgonEquatableByRef<GorgonRay>, IEquatable<GorgonRay>
Constructors
| Edit this page View SourceGorgonRay(Vector3, Vector3)
Initializes a new instance of the GorgonRay struct.
Declaration
public GorgonRay(Vector3 position, Vector3 direction)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position in three dimensional space of the origin of the ray. |
Vector3 | direction | The normalized direction of the ray. |
Fields
| Edit this page View SourceDirection
The normalized direction in which the ray points.
Declaration
public Vector3 Direction
Field Value
Type | Description |
---|---|
Vector3 |
Position
The position in three dimensional space where the ray starts.
Declaration
public Vector3 Position
Field Value
Type | Description |
---|---|
Vector3 |
Methods
| Edit this page View SourceEquals(GorgonRay)
Determines whether the specified Vector4 is equal to this instance.
Declaration
public readonly bool Equals(GorgonRay value)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | value | The Vector4 to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Equals(in GorgonRay)
Function to compare this instance with another.
Declaration
public readonly bool Equals(in GorgonRay other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override readonly bool Equals(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
| Edit this page View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override readonly 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
| Edit this page View SourceGetPickRay(int, int, in ViewportF, in Matrix4x4)
Calculates a world space GorgonRay from 2d screen coordinates.
Declaration
public static GorgonRay GetPickRay(int x, int y, in ViewportF viewport, in Matrix4x4 worldViewProjection)
Parameters
Type | Name | Description |
---|---|---|
int | x | X coordinate on 2d screen. |
int | y | Y coordinate on 2d screen. |
ViewportF | viewport | The viewport to use. |
Matrix4x4 | worldViewProjection | The world, view, projection matrix. |
Returns
Type | Description |
---|---|
GorgonRay | Resulting GorgonRay. |
ToString()
Returns a string that represents this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(in GorgonRay, in GorgonRay)
Tests for equality between two objects.
Declaration
public static bool operator ==(in GorgonRay left, in GorgonRay right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | left | The first value to compare. |
GorgonRay | right | The second value to compare. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(in GorgonRay, in GorgonRay)
Tests for inequality between two objects.
Declaration
public static bool operator !=(in GorgonRay left, in GorgonRay right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | left | The first value to compare. |
GorgonRay | right | The second value to compare. |
Returns
Type | Description |
---|---|
bool |
|