Merge pull request #5930 from ericrius1/grabFix

Setting hand data for close grab of non physical objects
This commit is contained in:
James B. Pollack 2015-09-29 13:17:21 -07:00
commit 3bbc809710

View file

@ -54,7 +54,11 @@ var RELEASE_VELOCITY_MULTIPLIER = 1.5; // affects throwing things
var RIGHT_HAND = 1;
var LEFT_HAND = 0;
var ZERO_VEC = { x: 0, y: 0, z: 0};
var ZERO_VEC = {
x: 0,
y: 0,
z: 0
};
var NULL_ACTION_ID = "{00000000-0000-0000-000000000000}";
var MSEC_PER_SEC = 1000.0;
@ -391,6 +395,11 @@ function MyController(hand, triggerAction) {
this.state = STATE_RELEASE;
return;
}
if (this.hand === RIGHT_HAND) {
Entities.callEntityMethod(this.grabbedEntity, "setRightHand");
} else {
Entities.callEntityMethod(this.grabbedEntity, "setLeftHand");
}
Entities.callEntityMethod(this.grabbedEntity, "startNearGrabNonColliding");
this.state = STATE_CONTINUE_NEAR_GRABBING_NON_COLLIDING;
};