From 49da3c503431f32adecfa0148d876279eecb9ccd Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 29 Sep 2015 13:24:03 -0700 Subject: [PATCH] disable avatar collisions while holding something --- examples/controllers/handControllerGrab.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 41f36c19d5..0b9e609c77 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -244,6 +244,10 @@ function MyController(hand, triggerAction) { }; this.distanceHolding = function() { + + this.previousAvCollision = Menu.isOptionChecked("Enable avatar collisions"); + Menu.setIsOptionChecked("Enable avatar collisions", false); + var handControllerPosition = Controller.getSpatialControlPosition(this.palm); var handRotation = Quat.multiply(MyAvatar.orientation, Controller.getSpatialControlRawRotation(this.palm)); var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity, ["position", "rotation"]); @@ -323,6 +327,10 @@ function MyController(hand, triggerAction) { }; this.nearGrabbing = function() { + + this.previousAvCollision = Menu.isOptionChecked("Enable avatar collisions"); + Menu.setIsOptionChecked("Enable avatar collisions", false); + if (!this.triggerSmoothedSqueezed()) { this.state = STATE_RELEASE; return; @@ -491,6 +499,9 @@ function MyController(hand, triggerAction) { }; this.release = function() { + + Menu.setIsOptionChecked("Enable avatar collisions", this.previousAvCollision); + this.lineOff(); if (this.grabbedEntity !== null && this.actionID !== null) {