// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.MixedReality.Toolkit.Utilities; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Input { /// /// Interface for cursor modifiers that can modify a GameObject's properties. /// public interface ICursorModifier : IMixedRealityFocusChangedHandler { /// /// Transform for which this modifies applies its various properties. /// Transform HostTransform { get; set; } /// /// How much a 's position should be offset from the surface of the GameObject when overlapping. /// Vector3 CursorPositionOffset { get; set; } /// /// Should the snap to the GameObject's position? /// bool SnapCursorPosition { get; set; } /// /// Scale of the when looking at this GameObject. /// Vector3 CursorScaleOffset { get; set; } /// /// Direction of the offset. /// Vector3 CursorNormalOffset { get; set; } /// /// If true, the normal from the pointing vector will be used to orient the instead of the targeted GameObject's normal at point of contact. /// bool UseGazeBasedNormal { get; set; } /// /// Should the be hidden when this GameObject is focused? /// bool HideCursorOnFocus { get; set; } /// /// animation parameters to set when this GameObject is focused. Leave empty for none. /// AnimatorParameter[] CursorParameters { get; } /// /// Indicates whether the should be visible or not. /// /// True if should be visible, false if not. bool GetCursorVisibility(); /// /// Returns the position after considering this modifier. /// /// that is being modified. /// New position for the Vector3 GetModifiedPosition(IMixedRealityCursor cursor); /// /// Returns the rotation after considering this modifier. /// /// that is being modified. /// New rotation for the Quaternion GetModifiedRotation(IMixedRealityCursor cursor); /// /// Returns the 's local scale after considering this modifier. /// /// that is being modified. /// New local scale for the Vector3 GetModifiedScale(IMixedRealityCursor cursor); /// /// Returns the modified Transform for the after considering this modifier. /// /// Cursor that is being modified. /// Modified position. /// Modified rotation. /// Modified scale. void GetModifiedTransform(IMixedRealityCursor cursor, out Vector3 position, out Quaternion rotation, out Vector3 scale); } }