Modifica

Condividi tramite


BoundsControl Class

Definition

Bounds Control allows to transform objects (rotate and scale) and draws a cube around the object to visualize the possibility of user triggered transform manipulation. Bounds Control provides scale and rotation handles that can be used for far and near interaction manipulation of the object. It further provides a proximity effect for scale and rotation handles that alters scaling and material.

public ref class BoundsControl : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::Input::IMixedRealityFocusChangedHandler, Microsoft::MixedReality::Toolkit::Input::IMixedRealityFocusHandler, Microsoft::MixedReality::Toolkit::Input::IMixedRealitySourceStateHandler, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/BoundsControl")]
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/bounds-control")]
[UnityEngine.RequireComponent(typeof(Microsoft.MixedReality.Toolkit.UI.ConstraintManager))]
public class BoundsControl : UnityEngine.MonoBehaviour, Microsoft.MixedReality.Toolkit.Input.IMixedRealityFocusChangedHandler, Microsoft.MixedReality.Toolkit.Input.IMixedRealityFocusHandler, Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/BoundsControl")>]
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/bounds-control")>]
[<UnityEngine.RequireComponent(typeof(Microsoft.MixedReality.Toolkit.UI.ConstraintManager))>]
type BoundsControl = class
    inherit MonoBehaviour
    interface IMixedRealitySourceStateHandler
    interface IEventSystemHandler
    interface IMixedRealityFocusChangedHandler
    interface IMixedRealityFocusHandler
Public Class BoundsControl
Inherits MonoBehaviour
Implements IEventSystemHandler, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler, IMixedRealitySourceStateHandler
Inheritance
UnityEngine.MonoBehaviour
BoundsControl
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.HelpURLAttribute UnityEngine.RequireComponentAttribute
Implements

Constructors

BoundsControl()

Properties

Active

Whether the bounds control is currently active and will respond to input.

BoundsControlActivation

Type of activation method for showing/hiding bounds control handles and controls

BoundsCorners
Obsolete.

This property is unused and will be removed in a future release. It has not, and does not, return any information.

BoundsOverride

For complex objects, automatic bounds calculation may not behave as expected. Use an existing Box Collider (even on a child object) to manually determine bounds of bounds control.

BoxDisplayConfig

Bounds control box display configuration section.

BoxPadding

Extra padding added to the actual Target bounds

CalculationMethod

Defines the volume type and the priority for the bounds calculation

ConstraintsManager

Constraint manager slot to enable constraints when manipulating the object.

DebugText

Component used to display debug messages.

ElasticsManager

Elastics Manager slot to enable elastics simulation when manipulating the object.

EnableConstraints

Enable or disable constraint support of this component. When enabled, transform changes will be post processed by the linked constraint manager.

FlattenAxis

Flatten bounds in the specified axis or flatten the smallest one if 'auto' is selected

HandleProximityEffectConfig

Configuration for Proximity Effect to scale handles or change materials on proximity.

HideElementsInInspector

Determines whether to hide GameObjects (i.e handles, links etc) created and managed by this component in the editor

LinksConfig

This section defines the links / lines that are drawn between the corners of the control.

RotateLerpTime

Enter amount representing amount of smoothing to apply to the rotation. Smoothing of 0 means no smoothing. Max value means no change to value.

RotateStarted

Event that gets fired when interaction with a rotation handle starts.

RotateStopped

Event that gets fired when interaction with a rotation handle stops.

RotationHandlesConfig

Configuration of the rotation handles.

ScaleHandlesConfig

Configuration of the scale handles.

ScaleLerpTime

Enter amount representing amount of smoothing to apply to the scale. Smoothing of 0 means no smoothing. Max value means no change to value.

ScaleStarted

Event that gets fired when interaction with a scale handle starts.

ScaleStopped

Event that gets fired when interaction with a scale handle stops.

SmoothingActive

Check to enable frame-rate independent smoothing.

Target

The object that the bounds control rig will be modifying.

TargetBounds

The collider reference tracking the bounds utilized by this component during runtime

TranslateLerpTime

Enter amount representing amount of smoothing to apply to the translation. Smoothing of 0 means no smoothing. Max value means no change to value.

TranslateStarted

Event that gets fired when interaction with a translation handle starts.

TranslateStopped

Event that gets fired when interaction with a translation handle stops.

TranslationHandlesConfig

Configuration of the translation handles.

UniformScaleOnFlattenedAxis

Whether scale the flattened axis when uniform scale is used.

WireframeOnly

Whether we should be displaying just the wireframe (if enabled) or the handles too

Methods

CreateRig()

Destroys and re-creates the rig around the bounds control

HighlightWires()

Allows the manual enabling of the wireframe display of the bounds control. This is useful if connected to the Manipulation events of a ObjectManipulator when used in conjunction with this MonoBehavior.

OnSourceDetected(SourceStateEventData)

Raised when a source is detected.

OnSourceLost(SourceStateEventData)

Raised when a source is lost.

UnhighlightWires()

Allows the manual disabling of the wireframe display.

UpdateBounds()

Update the bounds. Call this function after modifying the transform of the target externally to make sure the bounds are also updated accordingly.

Explicit Interface Implementations

IMixedRealityFocusChangedHandler.OnBeforeFocusChange(FocusEventData)

Focus event that is raised before the focus is actually changed.

IMixedRealityFocusChangedHandler.OnFocusChanged(FocusEventData)

Focus event that is raised when the focused object is changed.

IMixedRealityFocusHandler.OnFocusEnter(FocusEventData)

The Focus Enter event is raised on this GameObject whenever a IMixedRealityPointer's focus enters this GameObject's Collider.

IMixedRealityFocusHandler.OnFocusExit(FocusEventData)

The Focus Exit event is raised on this GameObject whenever a IMixedRealityPointer's focus leaves this GameObject's Collider.

Applies to