Class UsesSnappingMethods
Namespace: Unity.Labs.EditorXR.Interfaces
Syntax
public static class UsesSnappingMethods
Methods
ClearSnappingState(IUsesSnapping, Transform)
Clear state information for a given ray
Declaration
public static void ClearSnappingState(this IUsesSnapping user, Transform rayOrigin)
Parameters
Type | Name | Description |
---|---|---|
IUsesSnapping | user | The functionality user |
Transform | rayOrigin | The ray whose state to clear |
DirectSnap(IUsesSnapping, Transform, Transform, ref Vector3, ref Quaternion, Vector3, Quaternion)
Perform direct snapping: Transform a position/rotation directly while also respecting snapping
Declaration
public static bool DirectSnap(this IUsesSnapping user, Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation)
Parameters
Type | Name | Description |
---|---|---|
IUsesSnapping | user | The functionality user |
Transform | rayOrigin | The ray doing the transforming |
Transform | transform | The object being transformed (used to determine bounds; Transforms do not get modified) |
Vector3 | position | The position being transformed. This will be set to a snapped position if possible |
Quaternion | rotation | The rotation being transformed. This will only be modified if rotation snapping is enabled |
Vector3 | targetPosition | The input position provided by direct transformation |
Quaternion | targetRotation | The input rotation provided by direct transformation |
Returns
Type | Description |
---|---|
Boolean |
ManipulatorSnap(IUsesSnapping, Transform, Transform[], ref Vector3, ref Quaternion, Vector3, AxisFlags, PivotMode)
Perform manipulator snapping: Translate a position vector using deltas while also respecting snapping
Declaration
public static bool ManipulatorSnap(this IUsesSnapping user, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, AxisFlags constraints, PivotMode pivotMode)
Parameters
Type | Name | Description |
---|---|---|
IUsesSnapping | user | The functionality user |
Transform | rayOrigin | The ray doing the translating |
Transform[] | transforms | The transforms being translated (used to determine bounds; Transforms do not get modified) |
Vector3 | position | The position being modified by delta. This will be set with a snapped position if possible |
Quaternion | rotation | The rotation to be modified if rotation snapping is enabled |
Vector3 | delta | The position delta to apply |
AxisFlags | constraints | The axis constraints |
PivotMode | pivotMode | The current pivot mode |
Returns
Type | Description |
---|---|
Boolean | Whether the position was set to a snapped position |