This example shows how you can make any object interactable with TwoHandManipulatable script. This script allows for an object to be movable, scalable, and rotatable with one or two hands. You may also configure the script on only enable certain manipulations. The script works with both HoloLens' gesture input and immersive headset's motion controller input.
Demo Video: https://gfycat.com/ColossalEnlightenedAntipodesgreenparakeet
The example also includes Bounding Box for the normal mode. In normal mode, Bounding Box gives the visual boundary of the object when you interact with the object. You can find this behavior in the cliff house. (Grab and move, rotate, scale with two motion controllers)
In the Hierarchy panel, you can find multiple objects that have TwoHandManipulatable script under SceneContent. Notice how each example object has a collider on it. The collider defines the 'hittable area' for the manipulatable--grabbing any collidable that is on the script's GameObject or any descendant will activate the script.
Simply assign TwoHandManipulatable script to any GameObject to make it manipulatable. The script has several configurable options:
Bounding Box Prefab: To visualize the object bounding box, drop the BoundingBoxBasic.prefab here. This is optional.
Manipulation Mode: Specify the enabled manipulations.
Constraint On Rotation: If rotation is enabled, only rotate on these axes.
One Handed Movement: Specify whether you can use just one hand to move the object.
TwoHandManipulatable script uses optional BoundingBoxBasic prefab to visualize the borders on manipulation interaction. It shows/hides BoundingBoxBasic in OnManipulationStarted and OnManipulationEnded event. TwoHandManipulatable script can work without BoundingBox visualization. Simply don't assign the BoundingBoxBasic prefab in the Inspector panel.