The Holoboard SDK contains an example script that allows you to apply standard interactions of Grab, Rotate, Scale, etc. to any GameObject in no time.
You can find a quick example in the HighLevel_InteractibleExample gameObject in the BasicExample scene.
How To Use
Follow these steps to configure any gameObject to use these standard interactions.
Make sure the object has a 3D Collider of some kind by selecting the game object, and clicking on Add Component and then Box Collider, Sphere Collider, or whichever you prefer.
Add the ARInteractible component by selecting the game object, and clicking on Add Component and then ARInteractible.
Add the HighLevel_ARInteractibleExample script by selecting the game object, and clicking on Add Component and then HighLevel_ARInteractibleExample as shown below.
The HighLevel_ARInteractibleExample has the following properties in the Inspector.
1. Interact Button - This button is used for Interact and Delete interactions.
2. Rotation Button - This button is used to activate/deactive Rotation interaction.
3. Grab Button - This button is used for Grab interaction.
4. Scale Increment Factor - Sets the sensitivity of the trackpad for scaling.
5. Rotation Increment Factor - Sets the sensitivity of the trackpad for rotation.
List Of Interactions
A list of standard interactions and how to trigger them using the controller at runtime is given below. These interactions are only triggered while the user is gazing at the GameObject that has been configured as shown in steps above -
1. Interact - Clicking the Interaction Button while gazing at the GameObject once triggers it.
2. Grab - Press and hold the Grab Button while gazing at the GameObject to grab it. Moving the head while holding the Grab Button moves the GameObject with the head. Releasing the button releases the GameObject at the latest position set by the user's head.
3. Rotate - Press and hold the Rotation Button while gazing at the GameObject and twist the controller along its longest axis to rotate the GameObject. The rotation sensitivity is affected by the Rotation Increment Factor. The rotation will only work as long as the Rotation Button is held down and the user is gazing at the GameObject.
4. Scaling - Swiping horizontally on the Touchpad scales the GameObject while the user is gazing at the GameObject.
5. Move Along Ray - Swiping vertically on the Touchpad moves the GameObject back and forth along the ray from the user's eyes to the GameObject, while the user is gazing at the GameObject.
6. Delete - Double pressing the Interact Button while gazing at the GameObject will delete it from the scene.