AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
GrabbableSnapToOrient.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 
6 namespace HoloToolkit.Unity.InputModule.Examples.Grabbables
7 {
12  {
13  protected override void StartGrab(BaseGrabber grabber)
14  {
15  base.StartGrab(grabber);
16  transform.SetParent(grabber.GrabHandle);
17  gameObject.GetComponent<Rigidbody>().isKinematic = true;
18  transform.rotation = transform.parent.rotation;
19  }
20 
21  protected override void EndGrab()
22  {
23  transform.SetParent(null);
24  gameObject.GetComponent<Rigidbody>().isKinematic = false;
25  base.EndGrab();
26  }
27  }
28 }
Transform GrabHandle
If not grab attach point is specified, use the GameObject transform by default
Definition: BaseGrabber.cs:60
override void EndGrab()
Grab end fires off a GrabEnded event, but also cleans up some of the variables associated with an act...
This type of grab uses a parent child relationship and also immediately orients the child&#39;s forward t...
Intended usage: scripts that inherit from this can be attached to the controller, or any object with ...
Definition: BaseGrabber.cs:18
//Intended Usage// Attach a "grabbable_x" script (a script that inherits from this) to any object tha...