VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
override void AVR.Phys.AVR_AdvancedOffsetGrabProvider.makeGrab ( GrabLocation  location)
inlinevirtual

Perform a grab on with parameters given in a GrabLocation struct

Reimplemented from AVR.Phys.AVR_BasicGrabProvider.

Definition at line 42 of file AVR_AdvancedOffsetGrabProvider.cs.

43  {
44  base.makeGrab(location);
45  if (grabbedObject != null)
46  {
48  if(handVisual!=null) handVisual.glove_transform.position += grabLocation.location - grabPoint.position;
49 
50  virtualGrabPoint.position = grabbedObject.transform.position; //The target position is equal to the object position == dont move the object directly on-grab
51  virtualGrabPoint.rotation = grabbedObject.transform.rotation;
52  }
53 
54  // pos_offset is equal to the local position of virtualGrabPoint == difference to base.getTargetPosition()
55  pos_offset = virtualGrabPoint.localPosition;
56  rot_offset = virtualGrabPoint.localRotation;
57 
59  }
60  }
GrabbableObjectType objectType
Type that describes the objects behaviour when grabbed.
AVR_Grabbable grabbedObject
Object that is currently being grabbed. Null if no object is being grabbed