/// <summary> /// Removes the physics ignore for the steam controllers /// </summary> void RemoveIgnoreAllControllerColliders() { foreach (SteamVR_TrackedObject controller in VRGripper.GetControllers()) { RemoveIgnoreColliders(controller.transform); } }
void OnCollisionEnter(Collision _collision) { if (_collision.rigidbody == null) { return; } controller = _collision.rigidbody.GetComponent <VRGripper> (); // If we have been moved by a vr object... if (controller == null) { return; } // Found gripper beginning actions BeginAction(); }
void OnCollisionExit(Collision _collision) { //Debug.Log ("Attempting Exiting with " + _collision.gameObject.name); if (_collision.rigidbody == null) { return; } //Debug.Log ("Have rigidbody"); VRGripper gripper = _collision.rigidbody.GetComponent <VRGripper> (); // If it is the same gripper... if (controller != gripper) { return; } // lost gripper ending actions EndAction(); }