Gorgon
Show / Hide Table of Contents

Struct GorgonRay

Represents a three dimensional line based on a point in space and a direction.

Implements
IGorgonEquatableByRef<GorgonRay>
IEquatable<GorgonRay>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: Gorgon.Renderers.Data
Assembly: Gorgon.Core.dll
Syntax
public struct GorgonRay : IGorgonEquatableByRef<GorgonRay>, IEquatable<GorgonRay>

Constructors

| Edit this page View Source

GorgonRay(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 Source

Direction

The normalized direction in which the ray points.

Declaration
public Vector3 Direction
Field Value
Type Description
Vector3
| Edit this page View Source

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 Source

Equals(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

true if the specified Vector4 is equal to this instance; otherwise, false.

| Edit this page View Source

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.

| Edit this page View Source

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

true if the specified object is equal to this instance; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

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
ValueType.GetHashCode()
| Edit this page View Source

GetPickRay(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.

| Edit this page View Source

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
ValueType.ToString()

Operators

| Edit this page View Source

operator ==(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

true if left has the same value as right; otherwise, false.

| Edit this page View Source

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

true if left has a different value than right; otherwise, false.

Implements

IGorgonEquatableByRef<T>
IEquatable<T>

Extension Methods

GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author