VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Vector3 AVR.Phys.AVR_Grabbable.getTargetPosition ( )
inlineprivate

Definition at line 277 of file AVR_Grabbable.cs.

277  {
278  if(!isGrabbed) {
279  return transform.position;
280  }
281  else if(AttachedHands.Count == 1) {
282  return AttachedHands[0].getTargetPosition();
283  }
284  else {
285  Vector3 sum = Vector3.zero;
286  foreach (AVR_BasicGrabProvider h in AttachedHands) sum += h.getTargetPosition();
287  return sum/AttachedHands.Count;
288  }
289  }
bool isGrabbed
True if the object is being grabbed, otherwise false.
List< AVR_BasicGrabProvider > AttachedHands
List of hands that are currently grabbing this object.