Search Results for

    Show / Hide Table of Contents

    Struct Ray

    Represents a ray.

    Namespace: Evergine.Mathematics
    Assembly: Evergine.Mathematics.dll
    Syntax
    public struct 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)

    Compares the specified other for equality.

    Declaration
    public bool Equals(Ray other)
    Parameters
    Type Name Description
    Ray other

    The other object to compare.

    Returns
    Type Description
    bool

    The result of the comparison.

    Equals(ref Ray)

    Compares this instance with the specified other.

    Declaration
    public bool Equals(ref Ray other)
    Parameters
    Type Name Description
    Ray other

    The other instance to compare with.

    Returns
    Type Description
    bool

    The result of the comparison.

    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

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

    Overrides
    ValueType.Equals(object)

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

    GetPoint(float)

    Gets a point at a specified distance along the ray.

    Declaration
    public Vector3 GetPoint(float distance)
    Parameters
    Type Name Description
    float distance

    The 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

    The 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)

    Intersects 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?)

    Intersects 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)

    Intersects 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)

    Intersects 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?)

    Intersects 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)

    Intersects the specified plane.

    Declaration
    public float? Intersects(Plane plane, bool ignoreNegative = true)
    Parameters
    Type Name Description
    Plane plane

    The plane.

    bool ignoreNegative

    Ignores negative values.

    Returns
    Type Description
    float?

    The result.

    Intersects(ref Plane, out float?, bool)

    Intersects 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

    Ignores negative values.

    Intersects(ref Ray, out float?, out float?)

    Calculates 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 on the first ray to the second ray.

    float? distanceB

    The closest point distance on the 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
    ValueType.ToString()

    Operators

    operator ==(Ray, Ray)

    Implements the operator ==.

    Declaration
    public static bool operator ==(Ray a, Ray b)
    Parameters
    Type Name Description
    Ray a

    The first operand.

    Ray b

    The second operand.

    Returns
    Type Description
    bool

    The result of the operation.

    operator !=(Ray, Ray)

    Implements the operator !=.

    Declaration
    public static bool operator !=(Ray a, Ray b)
    Parameters
    Type Name Description
    Ray a

    The first operand.

    Ray b

    The second operand.

    Returns
    Type Description
    bool

    The result of the operator.

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX