Libraries.Compute.Plane Documentation

This class represents a plane. A plane is defined as a unit length normal and the distance from the origin.

Inherits from: Libraries.Language.Object

Summary

Variable Summary Table

VariablesDescription
text back
text onPlane
text front

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
Distance(Libraries.Compute.Vector3 point)This action returns the shortest distance from the plane and the passed point.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetDistance()This action returns the distance of the plane from the origin.
GetHashCode()This action gets the hash code for an object.
GetNormal()This action returns the normal vector of the plane.
IsFrontFacing(Libraries.Compute.Vector3 direction)This action determines whether the plane is facing the passed direction vector.
Set(Libraries.Compute.Vector3 normalVector, number distanceFromOrigin)This action sets the plane's normal vector and distance form the origin.
Set(Libraries.Compute.Plane plane)This action sets the plane using the normal vector and distance from the origin from the passed Plane object.
Set(Libraries.Compute.Vector3 normalVector, Libraries.Compute.Vector3 point)This action sets the plane based on the passed normal vector and a point on the plane.
Set(number normalX, number normalY, number normalZ, number distanceFromOrigin)This action sets the plane with the given normal vector from the passed x, y, and z components and the passed distance from the origin.
Set(Libraries.Compute.Vector3 point1, Libraries.Compute.Vector3 point2, Libraries.Compute.Vector3 point3)This action sets the plane given the three passed points that are on the plane.
TestPoint(number x, number y, number z)This action returns which side the given point lies relative to the plane and its normal.
TestPoint(Libraries.Compute.Vector3 point)This action returns which side the given point lies relative to the plane and its normal.

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.

Distance(Libraries.Compute.Vector3 point)

This action returns the shortest distance from the plane and the passed point.

Parameters

Return

number: the shortest distance between the point and plane

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.

GetDistance()

This action returns the distance of the plane from the origin.

Return

number: the distance of the plane from the origin

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.

GetNormal()

This action returns the normal vector of the plane.

Return

Libraries.Compute.Vector3: The normal vector of the plane

IsFrontFacing(Libraries.Compute.Vector3 direction)

This action determines whether the plane is facing the passed direction vector. The direction vector can be thought of as the direction a camera looks in. The plane is front facing (and the action will return true) if the front side of the plane determined by the normal vector faces the camera.

Parameters

Return

boolean: true if the plane is front facing, false if not

Set(Libraries.Compute.Vector3 normalVector, number distanceFromOrigin)

This action sets the plane's normal vector and distance form the origin.

Parameters

Set(Libraries.Compute.Plane plane)

This action sets the plane using the normal vector and distance from the origin from the passed Plane object.

Parameters

Set(Libraries.Compute.Vector3 normalVector, Libraries.Compute.Vector3 point)

This action sets the plane based on the passed normal vector and a point on the plane.

Parameters

Set(number normalX, number normalY, number normalZ, number distanceFromOrigin)

This action sets the plane with the given normal vector from the passed x, y, and z components and the passed distance from the origin.

Parameters

Set(Libraries.Compute.Vector3 point1, Libraries.Compute.Vector3 point2, Libraries.Compute.Vector3 point3)

This action sets the plane given the three passed points that are on the plane. The normal vector of the plane is calculated as the cross-product between (point1 - point2) x (point2 - point3).

Parameters

TestPoint(number x, number y, number z)

This action returns which side the given point lies relative to the plane and its normal. "OnPlane" is returned if the point lies on the plane. "Front" is the side of the plane to which the normal points. "Back" is the side of the plane that is not the front.

Parameters

Return

text: which side of the plane the point is on

TestPoint(Libraries.Compute.Vector3 point)

This action returns which side the given point lies relative to the plane and its normal. "OnPlane" is returned if the point lies on the plane. "Front" is the side of the plane to which the normal points. "Back" is the side of the plane that is not the front.

Parameters

Return

text: which side of the plane the point is on