DeepAR Scripting API v5.6.9

Class: Intersection

Intersection(localPosition, worldPosition, UVCoordinates, UV2Coordinates, intersectedNode)

Represents an intersection that is the result of ray casting on a node that contains a Mesh Renderer.

Constructor

new Intersection(localPosition, worldPosition, UVCoordinates, UV2Coordinates, intersectedNode)

Constructs a new intersection.
Parameters:
Name Type Description
localPosition Vector3 Local position of the intersection.
worldPosition Vector3 World position of the intersection.
UVCoordinates Vector2 UV coordinates of the intersection.
UV2Coordinates Vector2 UV2 coordinates of the intersection.
intersectedNode Node The node that contains the intersection.

Members

(readonly) intersectedNode :Node

The node (with a Mesh Renderer) that contains the intersection.
Type:

(readonly) localPosition :Vector3

Local position of the mesh intersection.
Type:

(readonly) UV2Coordinates :Vector2

UV2 coordinates of the mesh intersection.
Type:

(readonly) UVCoordinates :Vector2

UV coordinates of the mesh intersection.
Type:

(readonly) worldPosition :Vector3

World position of the mesh intersection.
Type:

Methods

equals(intersection) → {bool}

Checks whether the intersection instances are same.
Parameters:
Name Type Description
intersection Intersection Intersection instance.
Returns:
True if same, false otherwise.
Type
bool

toString() → {string}

Gets the string representation of the intersection.
Returns:
Intersection string representation.
Type
string
Example
// Outputs '[Intersection point -> world position: ({x}, {y}, {z})]' to the debug console.
Debug.log(intersection.toString());