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

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
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 a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Object o
        Object t
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: 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 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.

Example Code

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

Parameters

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 Ray

GetEndPoint(number distance)

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

Parameters

Return

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

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

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