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
uiCursor
Type: GameObject
Cursor for 2D UI
uiCursorMode
Type: bool
When true, renders the cursor from uiCursor
on a 2D canvas.
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)
GetOverObject()
Returns: bool
Returns true if cursor is over an object
Last updated
Was this helpful?