Ray Structure

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Defines a ray.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

Syntax

'Declaration
Public Structure Ray
public struct Ray

The Ray type exposes the following members.

Constructors

  Name Description
Public method Ray Creates a new instance of Ray.

Top

Methods

  Name Description
Public method Equals(Object) Determines whether two instances of Ray are equal. (Overrides ValueType.Equals(Object).)
Public method Equals(Ray) Determines whether the specified Ray is equal to the current Ray.
Public method GetHashCode Gets the hash code for this instance. (Overrides ValueType.GetHashCode().)
Public method Intersects(BoundingBox) Checks whether the Ray intersects a specified BoundingBox.
Public method Intersects(BoundingFrustum) Checks whether the Ray intersects a specified BoundingFrustum.
Public method Intersects(BoundingSphere) Checks whether the Ray intersects a specified BoundingSphere.
Public method Intersects(Plane) Determines whether this Ray intersects a specified Plane.
Public method Intersects(BoundingBox%, Nullable<Single>%) Checks whether the current Ray intersects a BoundingBox.
Public method Intersects(BoundingSphere%, Nullable<Single>%) Checks whether the current Ray intersects a BoundingSphere.
Public method Intersects(Plane%, Nullable<Single>%) Determines whether this Ray intersects a specified Plane.
Public method ToString Returns a String that represents the current Ray. (Overrides ValueType.ToString().)

Top

Operators

  Name Description
Public operatorStatic member Equality Determines whether two instances of Ray are equal.
Public operatorStatic member Inequality Determines whether two instances of Ray are not equal.

Top

Fields

  Name Description
Public field Direction Unit vector specifying the direction the Ray is pointing.
Public field Position Specifies the starting point of the Ray.

Top

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.