disable avatar collisions while holding something

This commit is contained in:
Seth Alves 2015-09-29 13:24:03 -07:00
parent 64ad3c9e0e
commit 49da3c5034

View file

@ -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) {