Interface IProvidesSnapping
Provide access to the spatial hash
Inherited Members
Namespace: Unity.Labs.EditorXR.Interfaces
Syntax
public interface IProvidesSnapping : IFunctionalityProvider
Methods
ClearSnappingState(Transform)
Clear state information for a given ray
Declaration
void ClearSnappingState(Transform rayOrigin)
Parameters
Type | Name | Description |
---|---|---|
Transform | rayOrigin | The ray whose state to clear |
DirectSnap(Transform, Transform, ref Vector3, ref Quaternion, Vector3, Quaternion)
Perform direct snapping: Transform a position/rotation directly while also respecting snapping
Declaration
bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation)
Parameters
Type | Name | Description |
---|---|---|
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(Transform, Transform[], ref Vector3, ref Quaternion, Vector3, AxisFlags, PivotMode)
Perform manipulator snapping: Translate a position vector using deltas while also respecting snapping
Declaration
bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, AxisFlags constraints, PivotMode pivotMode)
Parameters
Type | Name | Description |
---|---|---|
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 |