Class ConstraintManager
Manages constraints for a given object and ensures that Scale/Rotation/Translation constraints are executed separately.
Namespace: Microsoft.MixedReality.Toolkit.UI
Assembly: cs.temp.dll.dll
Syntax
public class ConstraintManager : MonoBehaviour
Properties
AutoConstraintSelection
Per default, constraint manager will apply all to this gameobject attached constraint components automatically. If this flag is enabled, only the selected constraint list will be applied.
Declaration
public bool AutoConstraintSelection { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
SelectedConstraints
Manually selected list of transform constraints. Note that this list will only be processed by the manager if AutoConstraintSelection is disabled. Note that this is a read only property. To add new constraints to the list call RegisterConstraint.
Declaration
public List<TransformConstraint> SelectedConstraints { get; }
Property Value
Type | Description |
---|---|
List<Transform |
Methods
AddConstraintToManualSelection(TransformConstraint)
Adds a constraint to the manual selection list. Note that only unique components will be added to the list.
Declaration
public bool AddConstraintToManualSelection(TransformConstraint constraint)
Parameters
Type | Name | Description |
---|---|---|
Transform |
constraint | Constraint to add to the managers manual constraint list. |
Returns
Type | Description |
---|---|
Boolean | Returns true if insertion was successful. If the comopnent was already in the list the insertion will fail. |
ApplyRotationConstraints(ref MixedRealityTransform, Boolean, Boolean)
Declaration
public void ApplyRotationConstraints(ref MixedRealityTransform transform, bool isOneHanded, bool isNear)
Parameters
ApplyScaleConstraints(ref MixedRealityTransform, Boolean, Boolean)
Declaration
public void ApplyScaleConstraints(ref MixedRealityTransform transform, bool isOneHanded, bool isNear)
Parameters
ApplyTranslationConstraints(ref MixedRealityTransform, Boolean, Boolean)
Declaration
public void ApplyTranslationConstraints(ref MixedRealityTransform transform, bool isOneHanded, bool isNear)
Parameters
Awake()
Declaration
protected void Awake()
Initialize(MixedRealityTransform)
Declaration
public void Initialize(MixedRealityTransform worldPose)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
worldPose |
RemoveConstraintFromManualSelection(TransformConstraint)
Removes the given component from the manually selected constraint list.
Declaration
public void RemoveConstraintFromManualSelection(TransformConstraint constraint)
Parameters
Type | Name | Description |
---|---|---|
Transform |
constraint | Constraint to remove. |