Generated by DocFX

Class Ray

A ray is simply a position point and a direction.

Inheritance
System.Object
Ray
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public class Ray : IEquatable<Ray>

Constructors

| Improve this Doc View Source

Ray(Point3, Vector3)

Constructs the ray.

Declaration
public Ray(Point3 position, Vector3 direction)
Parameters
Type Name Description
Point3 position

The vector describing the direction of the ray.

Vector3 direction

The point describing the origin of the ray.

Properties

| Improve this Doc View Source

Direction

Gets the vector, describing the ray direction.

Declaration
public Vector3 Direction { get; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

Position

Gets the position point of the ray.

Declaration
public Point3 Position { get; }
Property Value
Type Description
Point3

Methods

| Improve this Doc View Source

ClosestPoint(Point3)

Computes the closest point on a ray from a point.

Declaration
public Point3 ClosestPoint(Point3 pt)
Parameters
Type Name Description
Point3 pt

The point.

Returns
Type Description
Point3

The closest point on a ray from a point.

| Improve this Doc View Source

DistanceTo(Point3)

Computes the shortest distance between this ray and a test point.

Declaration
public double DistanceTo(Point3 pt)
Parameters
Type Name Description
Point3 pt

The point to project.

Returns
Type Description
System.Double

The distance.

| Improve this Doc View Source

Equals(Ray)

Check if the ray is equal to the provided ray.
Two ray are equal if position and direction are the same.

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

The ray to compare.

Returns
Type Description
System.Boolean

True if position and direction are equal, otherwise false.

| Improve this Doc View Source

GetHashCode()

Gets the hash code for the ray.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A unique hashCode of an ray.

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

OnRay(Double)

Calculates the point moved by a scalar value along a direction.

Declaration
public Vector3 OnRay(double amplitude)
Parameters
Type Name Description
System.Double amplitude

The scalar value to amplify the vector.

Returns
Type Description
Vector3

The point along the ray.

| Improve this Doc View Source

PointAt(Double)

Evaluates a point along the ray.

Declaration
public Point3 PointAt(double t)
Parameters
Type Name Description
System.Double t

The t parameter.

Returns
Type Description
Point3

A point at (Direction*t + Position).

| Improve this Doc View Source

ToString()

Constructs the string representation of the ray.

Declaration
public override string ToString()
Returns
Type Description
System.String

A text string.

Overrides
System.Object.ToString()

Implements

System.IEquatable<T>