Class UsesSnappingMethods | Unity Reflect | 1.1.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    Class UsesSnappingMethods

    Inheritance
    Object
    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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023