Bearbeiten

Freigeben über


BoundingBox Class

Definition

BoundingBox allows to transform objects (rotate and scale) and draws a cube around the object to visualize the possibility of user triggered transform manipulation. BoundingBox 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 BoundingBox : 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/BoundingBox (deprecated)")]
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/bounding-box")]
public class BoundingBox : 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/BoundingBox (deprecated)")>]
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/ux-building-blocks/bounding-box")>]
type BoundingBox = class
    inherit MonoBehaviour
    interface IMixedRealitySourceStateHandler
    interface IEventSystemHandler
    interface IMixedRealityFocusChangedHandler
    interface IMixedRealityFocusHandler
Public Class BoundingBox
Inherits MonoBehaviour
Implements IEventSystemHandler, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler, IMixedRealitySourceStateHandler
Inheritance
UnityEngine.MonoBehaviour
BoundingBox
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.HelpURLAttribute
Implements

Constructors

BoundingBox()

Fields

debugText
RotateStarted
RotateStopped

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

ScaleStarted

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

ScaleStopped

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

Properties

Active

Flag that indicates if the bounding box is currently active / visible.

BoundingBoxActivation

Type of activation method for showing/hiding bounding box handles and controls

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 Bounding Box.

BoxGrabbedMaterial

Material used to display the bounding box when grabbed. If set to null no change will occur when grabbed.

BoxMaterial

Material used to display the bounding box. If set to null no bounding box will be displayed

BoxPadding

Extra padding added to the actual Target bounds

CalculationMethod

Defines the volume type and the priority for the bounds calculation

CloseGrowRate

Scaling animation velocity from medium to close proximity.

CloseScale

A Proximity-enabled Handle scales by this amount when a hand moves into the Close Proximity range. Default is 1.5, larger handle size

DrawTetherWhenManipulating

Check to draw a tether point from the handles to the hand when manipulating.

FarGrowRate

Scaling animation velocity from medium to far proximity state.

FarScale

A Proximity-enabled Handle scales by this amount when a hand moves out of range. Default is 0, invisible handle.

FlattenAxis

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

FlattenAxisDisplayScale

When an axis is flattened what value to set that axis's scale to for display.

HandleCloseProximity

Distance between handle and hand that will trigger the close proximity effect.

HandleGrabbedMaterial

Material applied to handles while they are a grabbed

HandleMaterial

Material applied to handles when they are not in a grabbed state

HandleMediumProximity

Distance between handle and hand before proximity scaling will be triggered.

HandlesIgnoreCollider

Add a Collider here if you do not want the handle colliders to interact with another object's collider.

HideElementsInInspector

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

MediumGrowRate

Scaling animation velocity from far to medium proximity.

MediumScale

A Proximity-enabled Handle scales by this amount when a hand moves into the Medium Proximity range. Default is 1.0, original handle size.

ProximityEffectActive

Determines whether proximity feature (scaling and material toggling) for bounding box handles is activated

RotateHandleColliderPadding

Additional padding to apply to the collider on rotate handle to make handle easier to hit

RotateMidpoints

Returns list of transforms pointing to the rotation handles of the bounding box.

RotationHandlePrefab

Prefab used to display rotation handles in the midpoint of each edge. Aligns the Y axis of the prefab with the pivot axis, and the X and Z axes pointing outward. If not set, spheres will be displayed instead

RotationHandlePrefabColliderType

Determines the type of collider that will surround the rotation handle prefab.

RotationHandleSize

Radius of the handle geometry of rotation handles

RotationHandleSlatePrefab
Obsolete.

Prefab used to display rotation handles in the midpoint of each edge. Aligns the Y axis of the prefab with the pivot axis, and the X and Z axes pointing outward. If not set, spheres will be displayed instead

ScaleCorners

Returns list of transforms pointing to the scale handles of the bounding box.

ScaleHandleColliderPadding

Additional padding to apply to the collider on scale handle to make handle easier to hit

ScaleHandlePrefab

Prefab used to display scale handles in corners. If not set, boxes will be displayed instead

ScaleHandleSize

Size of the cube collidable used in scale handles

ScaleHandleSlatePrefab

Prefab used to display scale handles in corners for 2D slate. If not set, boxes will be displayed instead

ScaleMaximum
Obsolete.

Deprecated: Use MinMaxScaleConstraint component instead. Public property for the scale maximum, in the target's local scale. Set this value with SetScaleLimits.

ScaleMinimum
Obsolete.

Deprecated: Use MinMaxScaleConstraint component instead. Public property for the scale minimum, in the target's local scale. Set this value with SetScaleLimits.

ShowRotationHandleForX

Check to show rotation handles for the X axis

ShowRotationHandleForY

Check to show rotation handles for the Y axis

ShowRotationHandleForZ

Check to show rotation handles for the Z axis

ShowScaleHandles

Public property to Set the visibility of the corner cube Scaling handles. This property can be set independent of the Rotate handles.

ShowWireFrame

Show a wireframe around the bounding box when checked. Wireframe parameters below have no effect unless this is checked

Target

The object that the bounding box rig will be modifying.

TargetBounds

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

WireframeEdgeRadius

Radius for wireframe edges

WireframeMaterial

Material used for wireframe display

WireframeShape

Shape used for wireframe display

Methods

CreateRig()

Destroys and re-creates the rig around the bounding box

HighlightWires()

Allows to manually enable wire (edge) highlighting (edges) of the bounding box. This is useful if connected to the Manipulation events of a ObjectManipulator when used in conjunction with this MonoBehavior.

OnSourceDetected(SourceStateEventData)
OnSourceLost(SourceStateEventData)
SetScaleLimits(Single, Single, Boolean)
Obsolete.

Sets the minimum/maximum scale for the bounding box at runtime.

UnhighlightWires()

Explicit Interface Implementations

IMixedRealityFocusChangedHandler.OnBeforeFocusChange(FocusEventData)
IMixedRealityFocusChangedHandler.OnFocusChanged(FocusEventData)
IMixedRealityFocusHandler.OnFocusEnter(FocusEventData)
IMixedRealityFocusHandler.OnFocusExit(FocusEventData)

Applies to