Class BoundsControl
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. Todo: replace doc link - point to BoundsControl docs
Implements
Namespace: Microsoft.MixedReality.Toolkit.Experimental.UI.BoundsControl
Assembly: cs.temp.dll.dll
Syntax
public class BoundsControl : MonoBehaviour, IMixedRealitySourceStateHandler, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler, IBoundsTargetProvider
Properties
Active
Declaration
public bool Active { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
BoundsControlActivation
Type of activation method for showing/hiding bounds control handles and controls
Declaration
public BoundsControlActivationType BoundsControlActivation { get; set; }
Property Value
Type | Description |
---|---|
Bounds |
BoundsCorners
Declaration
public Vector3[] BoundsCorners { get; }
Property Value
Type | Description |
---|---|
Vector3[] |
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.
Declaration
public BoxCollider BoundsOverride { get; set; }
Property Value
Type | Description |
---|---|
Box |
BoxDisplayConfiguration
Bounds control box display configuration section.
Declaration
public BoxDisplayConfiguration BoxDisplayConfiguration { get; set; }
Property Value
Type | Description |
---|---|
Box |
BoxPadding
Extra padding added to the actual Target bounds
Declaration
public Vector3 BoxPadding { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
CalculationMethod
Defines the volume type and the priority for the bounds calculation
Declaration
public BoundsCalculationMethod CalculationMethod { get; set; }
Property Value
Type | Description |
---|---|
Bounds |
DebugText
Component used to display debug messages.
Declaration
public TextMesh DebugText { get; set; }
Property Value
Type | Description |
---|---|
Text |
DrawTetherWhenManipulating
Check to draw a tether point from the handles to the hand when manipulating.
Declaration
public bool DrawTetherWhenManipulating { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
FlattenAxis
Flatten bounds in the specified axis or flatten the smallest one if 'auto' is selected
Declaration
public FlattenModeType FlattenAxis { get; set; }
Property Value
Type | Description |
---|---|
Flatten |
HandleProximityEffectConfiguration
Configuration for Proximity Effect to scale handles or change materials on proximity.
Declaration
public ProximityEffectConfiguration HandleProximityEffectConfiguration { get; set; }
Property Value
Type | Description |
---|---|
Proximity |
HandlesIgnoreCollider
Add a Collider here if you do not want the handle colliders to interact with another object's collider.
Declaration
public Collider HandlesIgnoreCollider { get; set; }
Property Value
Type | Description |
---|---|
Collider |
HideElementsInInspector
Determines whether to hide GameObjects (i.e handles, links etc) created and managed by this component in the editor
Declaration
public bool HideElementsInInspector { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
LinksConfiguration
This section defines the links / lines that are drawn between the corners of the control.
Declaration
public LinksConfiguration LinksConfiguration { get; set; }
Property Value
Type | Description |
---|---|
Links |
RotateStarted
Event that gets fired when interaction with a rotation handle starts.
Declaration
public UnityEvent RotateStarted { get; set; }
Property Value
Type | Description |
---|---|
Unity |
RotateStopped
Event that gets fired when interaction with a rotation handle stops.
Declaration
public UnityEvent RotateStopped { get; set; }
Property Value
Type | Description |
---|---|
Unity |
RotationHandles
Configuration of the rotation handles.
Declaration
public RotationHandlesConfiguration RotationHandles { get; set; }
Property Value
Type | Description |
---|---|
Rotation |
ScaleHandlesConfiguration
Configuration of the scale handles.
Declaration
public ScaleHandlesConfiguration ScaleHandlesConfiguration { get; set; }
Property Value
Type | Description |
---|---|
Scale |
ScaleStarted
Event that gets fired when interaction with a scale handle starts.
Declaration
public UnityEvent ScaleStarted { get; set; }
Property Value
Type | Description |
---|---|
Unity |
ScaleStopped
Event that gets fired when interaction with a scale handle stops.
Declaration
public UnityEvent ScaleStopped { get; set; }
Property Value
Type | Description |
---|---|
Unity |
Target
The object that the bounds control rig will be modifying.
Declaration
public GameObject Target { get; set; }
Property Value
Type | Description |
---|---|
Game |
TargetBounds
The collider reference tracking the bounds utilized by this component during runtime
Declaration
public BoxCollider TargetBounds { get; }
Property Value
Type | Description |
---|---|
Box |
Methods
CreateRig()
Destroys and re-creates the rig around the bounds control TODO: this shouldn't be called every time we change a param - be more specific with what we recreate
Declaration
public void CreateRig()
HighlightWires()
Allows to manually enable wire (edge) highlighting (edges) of the bounds control.
This is useful if connected to the Manipulation events of a
Manipulation
Declaration
public void HighlightWires()
OnSourceDetected(SourceStateEventData)
Declaration
public void OnSourceDetected(SourceStateEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
Source |
eventData |
OnSourceLost(SourceStateEventData)
Declaration
public void OnSourceLost(SourceStateEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
Source |
eventData |
RegisterTransformScaleHandler(MinMaxScaleConstraint)
Register a transform scale handler to bounding box to limit the scaling range This is useful for adding/switching your scale handler during runtime
Declaration
public void RegisterTransformScaleHandler(MinMaxScaleConstraint transformScaleHandler)
Parameters
Type | Name | Description |
---|---|---|
Min |
transformScaleHandler | scale handler you want to switch to - can be null if scaling shouldn't be constrained |
UnhighlightWires()
Declaration
public void UnhighlightWires()