Class HandleUtils
Namespace: Unity.MARS
Syntax
public static class HandleUtils
Methods
CircleHandleCap(Vector3, Quaternion, Boolean)
Draw a noninteractive circle handle.
Declaration
public static void CircleHandleCap(Vector3 position, Quaternion rotation, bool constantSize = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the handle in the space of Handles.matrix. |
Quaternion | rotation | The rotation of the handle in the space of Handles.matrix. |
Boolean | constantSize | If true, draw this handle at constant screen size. |
ConeHandleCap(Vector3, Quaternion, Boolean)
Draw a noninteractive cone handle.
Declaration
public static void ConeHandleCap(Vector3 position, Quaternion direction, bool constantSize = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the handle in the space of Handles.matrix. |
Quaternion | direction | The direction of the cone in the space of Handles.matrix. |
Boolean | constantSize | If true, draw this handle at constant screen size. |
CubeHandleCap(Vector3, Quaternion, Boolean)
Draw a noninteractive cube handle.
Declaration
public static void CubeHandleCap(Vector3 position, Quaternion rotation, bool constantSize = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the handle in the space of Handles.matrix. |
Quaternion | rotation | The rotation of the handle in the space of Handles.matrix. |
Boolean | constantSize | If true, draw this handle at constant screen size. |
DrawDottedLine(Vector3, Vector3, Single)
Draw a dotted line from startPosition to endPosition.
Declaration
public static void DrawDottedLine(Vector3 startPosition, Vector3 endPosition, float screenSpaceSize = 2F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | startPosition | Start position of the line. |
Vector3 | endPosition | End position of the line. |
Single | screenSpaceSize | The size in pixels for the lengths of the line segments and the gaps between them. |
DrawLine(Vector3, Vector3)
Draw a thick (anti-aliased) line between two points.
Declaration
public static void DrawLine(Vector3 startPosition, Vector3 endPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | startPosition | Start position of the line. |
Vector3 | endPosition | End position of the line. |
DrawXZPlaneRect(Vector3, Vector2)
Draw a wire-frame rectangle on the XZ plane in the space of Handles.matrix.
Declaration
public static void DrawXZPlaneRect(Vector3 center, Vector2 extents)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | center | The center of the rectangle in the space of Handles.matrix |
Vector2 | extents | The width and height of the rectangle. |
FreeMoveHandle(Vector3)
Draw an unconstrained movement handle.
Declaration
public static Vector3 FreeMoveHandle(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the handle in the space of Handles.matrix. |
Returns
Type | Description |
---|---|
Vector3 | The new value modified by the user's interaction with the handle. |
Label(Vector3, String)
Make a text label positioned in 3D space.
Declaration
public static void Label(Vector3 position, string text)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position in 3D space as seen from the current handle camera. |
String | text | Text to display on the label. |
Slider(Vector3, Vector3)
Draw a 3D slider that moves along one axis.
Declaration
public static Vector3 Slider(Vector3 position, Vector3 direction)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the current point in the space of Handles.matrix. |
Vector3 | direction | The direction axis of the slider in the space of Handles.matrix. |
Returns
Type | Description |
---|---|
Vector3 | The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the position value passed into the function. |
Slider2D(Vector3, Vector3, Vector3)
Draw a 3D slider that moves along two axes.
Declaration
public static Vector3 Slider2D(Vector3 position, Vector3 slideDirection1, Vector3 sliderDirection2)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the current point in the space of Handles.matrix. |
Vector3 | slideDirection1 | The first axis of the slider's plane of movement in the space of Handles.matrix. |
Vector3 | sliderDirection2 | The second axis of the slider's plane of movement in the space of Handles.matrix. |
Returns
Type | Description |
---|---|
Vector3 | The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the position value passed into the function. |
Slider2D(Vector3, Vector3, Vector3, Int32)
Draw a 3D slider that moves along two axes.
Declaration
public static Vector3 Slider2D(Vector3 position, Vector3 slideDirection1, Vector3 sliderDirection2, int id)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the current point in the space of Handles.matrix. |
Vector3 | slideDirection1 | The first axis of the slider's plane of movement in the space of Handles.matrix. |
Vector3 | sliderDirection2 | The second axis of the slider's plane of movement in the space of Handles.matrix. |
Int32 | id | A control id to be used for the slider instead of allowing it to be auto generated. |
Returns
Type | Description |
---|---|
Vector3 | The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the position value passed into the function. |
SphereHandleCap(Vector3, Boolean)
Draw a noninteractive sphere handle.
Declaration
public static void SphereHandleCap(Vector3 position, bool constantSize = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the handle in the space of Handles.matrix. |
Boolean | constantSize | If true, draw this handle at constant screen size. |