Skip to content

Cursor3D.cs

This script drives the 3D Cursor prefab.

With this script, you an use the cursor to point at and select objects.

The script uses depth maps to determine location. Consequently, objects with Fade and Transparent materials will not be able to be selected.

To ensure an object isn't picked up by the 3D cursor, set its layer to "Ignore Raycast" (ver 1.2 or later).

Fields

holoplay

Type: Holoplay

The Holoplay used to calculate depth and normals. If left blank this will autofill with the Holoplay found in the scene, if there is one.

disableSystemCursor

Type: bool

If true, the computer OS cursor is disabled and the user will only see the one generated in Unity

relativeScale

Type: bool

Whether the 3D cursor should scale with Holoplay

Functions

GetWorldPos();

Returns: Vector3

Returns the location of the 3D cursor (in world space)

GetLocalPos();

Returns: Vector3

Returns the location of the 3D cursor (in the Holoplay space)

GetNormal();

Returns: Vector3

Returns the direction of the normal at the given point

GetRotation();

Returns: Quaternion

Returns the rotation of the 3d Cursor (in world space)

GetLocalRotation()

Returns: Quaternion

Returns the rotation of the 3D Cursor (relative to the Holoplay Capture's space)