Method DirectSnap
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 |
---|---|
bool |