Class BoundingBox
Implements
IMixedRealitySourceStateHandler
IMixedRealityFocusChangedHandler
IMixedRealityFocusHandler
Assembly: cs.temp.dll.dll
public class BoundingBox : MonoBehaviour, IMixedRealitySourceStateHandler, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler
Fields
debugText
Declaration
public TextMesh debugText
Field Value
Type |
Description |
TextMesh |
|
Declaration
public UnityEvent RotateStarted
Field Value
Type |
Description |
UnityEvent |
|
Declaration
public UnityEvent RotateStopped
Field Value
Type |
Description |
UnityEvent |
|
Declaration
public UnityEvent ScaleStarted
Field Value
Type |
Description |
UnityEvent |
|
Declaration
public UnityEvent ScaleStopped
Field Value
Type |
Description |
UnityEvent |
|
Properties
Declaration
public bool Active { get; set; }
Property Value
Type of activation method for showing/hiding bounding box handles and controls
Declaration
public BoundingBox.BoundingBoxActivationType BoundingBoxActivation { get; set; }
Property Value
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.
Declaration
public BoxCollider BoundsOverride { get; set; }
Property Value
Type |
Description |
BoxCollider |
|
Material used to display the bounding box when grabbed. If set to null no change will occur when grabbed.
Declaration
public Material BoxGrabbedMaterial { get; set; }
Property Value
Type |
Description |
Material |
|
Material used to display the bounding box. If set to null no bounding box will be displayed
Declaration
public Material BoxMaterial { get; set; }
Property Value
Type |
Description |
Material |
|
Extra padding added to the actual Target bounds
Declaration
public Vector3 BoxPadding { get; set; }
Property Value
Defines the volume type and the priority for the bounds calculation
Declaration
public BoundingBox.BoundsCalculationMethod CalculationMethod { get; set; }
Property Value
A Proximity-enabled Handle scales by this amount when a hand moves into the Close Proximity range. Default is 1.5, larger handle size
Declaration
public float CloseScale { get; set; }
Property Value
Check to draw a tether point from the handles to the hand when manipulating.
Declaration
public bool DrawTetherWhenManipulating { get; set; }
Property Value
A Proximity-enabled Handle scales by this amount when a hand moves out of range. Default is 0, invisible handle.
Declaration
public float FarScale { get; set; }
Property Value
Flatten bounds in the specified axis or flatten the smallest one if 'auto' is selected
Declaration
public BoundingBox.FlattenModeType FlattenAxis { get; set; }
Property Value
When an axis is flattened what value to set that axis's scale to for display.
Declaration
public float FlattenAxisDisplayScale { get; set; }
Property Value
Material applied to handles while they are a grabbed
Declaration
public Material HandleGrabbedMaterial { get; set; }
Property Value
Type |
Description |
Material |
|
Material applied to handles when they are not in a grabbed state
Declaration
public Material HandleMaterial { get; set; }
Property Value
Type |
Description |
Material |
|
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 |
|
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
A Proximity-enabled Handle scales by this amount when a hand moves into the Medium Proximity range. Default is 1.0, original handle size.
Declaration
public float MediumScale { get; set; }
Property Value
Determines whether proximity feature (scaling and material toggling) for bounding box handles is activated
Declaration
public bool ProximityEffectActive { get; set; }
Property Value
Additional padding to apply to the collider on rotate handle to make handle easier to hit
Declaration
public Vector3 RotateHandleColliderPadding { get; set; }
Property Value
Returns list of transforms pointing to the rotation handles of the bounding box.
Declaration
public IReadOnlyList<Transform> RotateMidpoints { get; }
Property Value
Type |
Description |
IReadOnlyList<Transform> |
|
Determines the type of collider that will surround the rotation handle prefab.
Declaration
public BoundingBox.RotationHandlePrefabCollider RotationHandlePrefabColliderType { get; set; }
Property Value
Radius of the handle geometry of rotation handles
Declaration
public float RotationHandleSize { get; set; }
Property Value
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
Declaration
public GameObject RotationHandleSlatePrefab { get; set; }
Property Value
Type |
Description |
GameObject |
|
Returns list of transforms pointing to the scale handles of the bounding box.
Declaration
public IReadOnlyList<Transform> ScaleCorners { get; }
Property Value
Type |
Description |
IReadOnlyList<Transform> |
|
Additional padding to apply to the collider on scale handle to make handle easier to hit
Declaration
public Vector3 ScaleHandleColliderPadding { get; set; }
Property Value
Prefab used to display scale handles in corners. If not set, boxes will be displayed instead
Declaration
public GameObject ScaleHandlePrefab { get; set; }
Property Value
Type |
Description |
GameObject |
|
Size of the cube collidable used in scale handles
Declaration
public float ScaleHandleSize { get; set; }
Property Value
Prefab used to display scale handles in corners for 2D slate. If not set, boxes will be displayed instead
Declaration
public GameObject ScaleHandleSlatePrefab { get; set; }
Property Value
Type |
Description |
GameObject |
|
Public property for the scale maximum, in the target's local scale.
Set this value with SetScaleLimits.
Declaration
[Obsolete("Use a TransformScaleHandler.ScaleMinimum as it is the authoritative value for max scale")]
public float ScaleMaximum { get; }
Property Value
Public property for the scale minimum, in the target's local scale.
Set this value with SetScaleLimits.
Declaration
[Obsolete("Use a TransformScaleHandler.ScaleMinimum as it is the authoritative value for min scale")]
public float ScaleMinimum { get; }
Property Value
Check to show rotation handles for the X axis
Declaration
public bool ShowRotationHandleForX { get; set; }
Property Value
Check to show rotation handles for the Y axis
Declaration
public bool ShowRotationHandleForY { get; set; }
Property Value
Check to show rotation handles for the Z axis
Declaration
public bool ShowRotationHandleForZ { get; set; }
Property Value
Public property to Set the visibility of the corner cube Scaling handles.
This property can be set independent of the Rotate handles.
Declaration
public bool ShowScaleHandles { get; set; }
Property Value
Show a wireframe around the bounding box when checked. Wireframe parameters below have no effect unless this is checked
Declaration
public bool ShowWireFrame { get; set; }
Property Value
Declaration
public GameObject Target { get; }
Property Value
Type |
Description |
GameObject |
|
The collider reference tracking the bounds utilized by this component during runtime
Declaration
public BoxCollider TargetBounds { get; }
Property Value
Type |
Description |
BoxCollider |
|
Radius for wireframe edges
Declaration
public float WireframeEdgeRadius { get; set; }
Property Value
Material used for wireframe display
Declaration
public Material WireframeMaterial { get; set; }
Property Value
Type |
Description |
Material |
|
Shape used for wireframe display
Declaration
public BoundingBox.WireframeType WireframeShape { get; set; }
Property Value
Methods
Destroys and re-creates the rig around the bounding box
Declaration
Allows to manually enable wire (edge) highlighting (edges) of the bounding box.
This is useful if connected to the Manipulation events of a
ManipulationHandler
when used in conjunction with this MonoBehavior.
Declaration
public void HighlightWires()
Declaration
public void OnSourceDetected(SourceStateEventData eventData)
Parameters
Type |
Name |
Description |
SourceStateEventData |
eventData |
|
Declaration
public void OnSourceLost(SourceStateEventData eventData)
Parameters
Type |
Name |
Description |
SourceStateEventData |
eventData |
|
Sets the minimum/maximum scale for the bounding box at runtime.
Declaration
[Obsolete("Use a TransformScaleHandler script rather than setting min/max scale on BoundingBox directly")]
public void SetScaleLimits(float min, float max, bool relativeToInitialState = true)
Parameters
Type |
Name |
Description |
Single |
min |
Minimum scale
|
Single |
max |
Maximum scale
|
Boolean |
relativeToInitialState |
If true the values will be multiplied by scale of target at startup. If false they will be in absolute local scale.
|
Declaration
public void UnhighlightWires()
Implements
IMixedRealitySourceStateHandler
IMixedRealityFocusChangedHandler
IMixedRealityFocusHandler