## Libraries.Compute.Ray Documentation

This class represents a ray. A ray has a starting position and a unit length directio

Inherits from: Libraries.Language.Object

## Summary

### Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Copy()This action creates a new Ray that is a copy of this Ray.
Equals(Libraries.Compute.Ray ray)This action determines if the passed ray is equal to this ray.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetDirection()This action returns the direction of the Ray.
GetEndPoint(number distance)This action returns the endpoint of the Ray given the distance.
GetHashCode()This action gets the hash code for an object.
GetOrigin()This action returns the origin of the Ray.
Multiply(Libraries.Compute.Matrix4 matrix)This action multiplies the Ray by the passed matrix.
Set(Libraries.Compute.Ray ray)This action sets the ray using the direction and orgin of the passed ray.
Set(Libraries.Compute.Vector3 origin, Libraries.Compute.Vector3 direction)This action sets the ray using the passed origin and direction vectors.
Set(number originX, number originY, number originZ, number directionX, number directionY, number directionZ)This action sets the ray using the passed origin and direction vectors.
SetDirection(Libraries.Compute.Vector3 direction)This action sets the direction of the ray to the passed direction vector.
SetOrigin(Libraries.Compute.Vector3 origin)This action sets the origin of the ray to the passed origin vector.

## Actions Documentation

### Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

``````Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smalle``````

#### Return

integer: The Compare result, Smaller, Equal, or Larger.

### Copy()

This action creates a new Ray that is a copy of this Ray.

#### Return

Libraries.Compute.Ray: A new Ray that is a copy of this R

### Equals(Libraries.Compute.Ray ray)

This action determines if the passed ray is equal to this ray. Two Rays are equal if their origins and directions are the same.

#### Return

boolean: true if the two rays are equal, false otherwi

### Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

``````use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(``````

#### Return

boolean: True if the hash codes are equal and false if they are not equal.

### GetDirection()

This action returns the direction of the Ray.

#### Return

Libraries.Compute.Vector3: The direction vector of the R

### GetEndPoint(number distance)

This action returns the endpoint of the Ray given the distance. The calculation is: startpoint + distance * direction.

#### Parameters

• number distance: The distance from the end point to the start point

#### Return

Libraries.Compute.Vector3: The endpoint given the distance as a Vect

### GetHashCode()

This action gets the hash code for an object.

Example Code

``````Object o
integer hash = o:GetHashCode``````

#### Return

integer: The integer hash code of the object.

### GetOrigin()

This action returns the origin of the Ray.

#### Return

Libraries.Compute.Vector3: The origin vector of the R

### Multiply(Libraries.Compute.Matrix4 matrix)

This action multiplies the Ray by the passed matrix. This action can be used to transform this ray into another coordinate system.

#### Return

Libraries.Compute.Ray: The result of the multiplicati

### Set(Libraries.Compute.Ray ray)

This action sets the ray using the direction and orgin of the passed ray.

#### Return

Libraries.Compute.Ray: The Ray after being s

### Set(Libraries.Compute.Vector3 origin, Libraries.Compute.Vector3 direction)

This action sets the ray using the passed origin and direction vectors.

#### Return

Libraries.Compute.Ray: The Ray after being s

### Set(number originX, number originY, number originZ, number directionX, number directionY, number directionZ)

This action sets the ray using the passed origin and direction vectors.

#### Return

Libraries.Compute.Ray: The Ray after being s

### SetDirection(Libraries.Compute.Vector3 direction)

This action sets the direction of the ray to the passed direction vector.

### SetOrigin(Libraries.Compute.Vector3 origin)

This action sets the origin of the ray to the passed origin vector.