Table of contents
1 Introduction
- ObjectManipulator allows intuitive manipulation of objects in 3D space using any input device or form. It performs similar tasks to XRI XRGrabInteractable but provides additional functionality and mixed reality-specific interactions. Although XRGrabInteractable is fully compatible with interactors (and vice versa).
- InMRTK v2, ObjectManipulator itself is handled differently Type input for most complex logic and mathematics. A separate code path must be maintained for each type of interaction, thus reducing flexibility when introducing new types of interactions. In MRTK3, an interactor is responsible for specifying how to convert a specific type of input into an action. ObjectManipulator only listens to these interactors and applies the relevant transformations to the object. Therefore, the ObjectManipulator in MRTK3 is simpler and more efficient in scope Much smaller
2.n Hand operation
- ObjectManipulator supports any number of participating interactors, allowing across one, two, and evenn hands Generalizable interactive behavior of operations. Typically, the geometric centroid of all participating interactors' attachTransforms is used for multi-hand interactions. As an interactive XRI, it is compatible with any type of interactor that submits additional transformations that perform well.
- If you do not want to allow multiple hands, setXRI Selection Mode toSingle obfuscation, which is used to specify whether the interactive object can be toggled. MRTK Selection Mode to avoid conflicts with Multiselect Mode. We set the alias of this property in the inspector to a more specific name
3. Constraints
- ObjectManipulator uses the constraints API to constrain operations. For details, please refer toUnity Hololens2 Development | (9) MRTK3 spatial operation ConstraintManager (constraints)
4. Operation logic injection
- Developers can customize the operational behavior of the ObjectManipulator without subclassing the script or otherwise modifying the script itself. Just write a new ManipulationLogic and use the properties in the inspectorManipulationLogicTypes Specify the type in .
- Similarly, this can be done by writing a new implementationITransformSmoothingLogic and checking it in the inspectorTransformSmoothingLogicType Use attributes in to specify the type to customize the smoothing behavior.
5. Property panel analysis
Attributes | describe |
---|---|
HostTransform | The transformation to operate on. Defaults to the component object. |
AllowedManipulations | What manipulations should be allowed? |
AllowedInteractionTypes | What type of interaction is allowed with this object? |
Multiselect Mode | Is one-handed or multi-handed operation allowed? |
RotationAnchorNear | Rotation behavior of objects when approached with one hand |
RotationAnchorFar | One-handed long-distance rotation behavior of objects |
MoveLerpTime | The input quantity represents the quantity smoothing applied to the motion. Smoothing 0 means no smoothing. Maximum means no change in value. |
RotateLerpTime | Enter a value that represents the amount of smoothing to apply to the rotation. Smoothing 0 means no smoothing. Maximum means no change in value. |
ScaleLerpTime | Enter a value representing the amount of smoothing to apply to the scale. Smoothing 0 means no smoothing. Maximum means no change in value. |
TransformSmoothingLogicType | Concrete type of ITransformSmoothingLogic used for smoothing between transformations |
manipulationLogicTypes | The specific type of operational logic used for the operation |
EnableConstraints | Enable or disable constraint support for this component. When enabled, transformation changes will be post-processed by the linked constraint manager. |
ConstraintsManager | Constraint manager slot to enable constraints when manipulating objects. |
SmoothingNear | Frame rate independent smoothing of near interactions. Note that making a near smooth may be considered "disconnected" from the hand. |
SmoothingFar | Frame rate independent smoothing for long distance interactions. Long range smoothing is enabled by default. |
ManipulationStarted | Triggered when starting to operate the handle. |
ManipulationEnded | Triggered when you finish operating the handle. |