Language
Edit

BoundsControl Class

Definition

A BoundsControl creates a bounds visual around the specified object.

[UnityEngine.AddComponentMenu("MRTK/Spatial Manipulation/Bounds Control")]
[UnityEngine.RequireComponent(typeof(MixedReality.Toolkit.SpatialManipulation.ConstraintManager))]
public class BoundsControl : UnityEngine.MonoBehaviour
[<UnityEngine.AddComponentMenu("MRTK/Spatial Manipulation/Bounds Control")>]
[<UnityEngine.RequireComponent(typeof(MixedReality.Toolkit.SpatialManipulation.ConstraintManager))>]
type BoundsControl = class
    inherit MonoBehaviour
Public Class BoundsControl
Inherits MonoBehaviour
Inheritance
UnityEngine.MonoBehaviour
BoundsControl
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.RequireComponentAttribute

Remarks

Any BoundsHandleInteractable component on the bounds game object will forward their manipulation events to this script, allowing for handle-based manipulation of the target object.

Constructors

Name Description
BoundsControl()

Properties

Name Description
BoundsCalculationMethod

How should the bounds be automatically calculated?

BoundsOverride

The bounds will be calculated from this object and this object only, instead of the entire hierarchy.

BoundsPadding

The bounds will be padded around the extent of the object by this amount, in world units.

BoundsVisualsPrefab

This prefab will be instantiated as the bounds visuals.

ConstraintsManager

Constraint manager slot to enable constraints when manipulating the object.

CurrentBounds

Accessor that can be used to retrieve most recently calculated bounds for the bounds control cube

DragToggleThreshold

During a selection of the associated interactable, if the interactable is dragged/moved a smaller distance than this value, the handles will be activated/deactivated.

EnableConstraints

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

EnabledHandles

Which type of handles should be visible?

FlattenMode

How should this BoundsControl flatten?

HandlesActive

Should any handles be visible?

IncludeInactiveObjects

Should BoundsControl include inactive objects when it traverses the hierarchy to calculate bounds?

Interactable

Reference to the interactable (such as ObjectManipulator) in charge of the wrapped object

IsFlat

Is this BoundsControl actively flattening along its thinnest axis?

IsManipulated

Is this BoundsControl currently being manipulated?

ManipulationEnded

Fired when manipulation on a handle ends.

ManipulationLogicImplementations

The instantiated manipulation logic objects, as specified by the types in ManipulationLogicTypes.

ManipulationLogicTypes
ManipulationStarted

Fired when manipulation on a handle begins.

OppositeCorner

Accessor for the corner opposite from the current scale handle (if a scale handle is being selected)

OverrideBounds

Should BoundsControl use a specific object to calculate bounds, instead of the entire hierarchy?

RotateAnchor

Specifies whether the rotate handles will rotate the object around its origin, or the center of its calculated bounds.

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.

ScaleAnchor

Specifies whether the scale handles will rotate the scale around the opposing corner, or the center of its calculated bounds.

ScaleBehavior

Scale behavior that is applied when interacting with scale handles - default is uniform scaling. Non uniform mode scales the control according to hand / controller movement in space.

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.

SmoothingActive

Check to enable frame-rate independent smoothing.

Target

The transform to be manipulated. If null, it is automatically set to the transform that this BoundsControl is on.

ToggleHandlesOnClick

Toggle the handles when the interactable is selected, not moved, and then released.

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.

Methods

Name Description
RecomputeBounds()

Recomputes the bounds of the BoundsControl and updates the current bounds visuals to match.

Update()

A Unity event function that is called every frame, if this object is enabled.

Applies to