Libraries.Compute.Ray Documentation

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

Inherits from: Libraries.Language.Object

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.

Parameters

Return

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

Example

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

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 Ray

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.

Parameters

Return

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

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

GetDirection()

This action returns the direction of the Ray.

Return

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

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 Vector

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetOrigin()

This action returns the origin of the Ray.

Return

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

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.

Parameters

Return

Libraries.Compute.Ray: The result of the multiplication

Set(Libraries.Compute.Ray ray)

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

Parameters

Return

Libraries.Compute.Ray: The Ray after being set

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

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

Parameters

Return

Libraries.Compute.Ray: The Ray after being set

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.

Parameters

  • number originX
  • number originY
  • number originZ
  • number directionX
  • number directionY
  • number directionZ

Return

Libraries.Compute.Ray: The Ray after being set

SetDirection(Libraries.Compute.Vector3 direction)

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

Parameters

SetOrigin(Libraries.Compute.Vector3 origin)

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

Parameters