try to fix far-trigger

This commit is contained in:
Seth Alves 2016-09-01 11:46:08 -07:00
parent 53ba190ca6
commit a35e527128

View file

@ -2044,7 +2044,7 @@ function MyController(hand) {
var props = Entities.getEntityProperties(this.grabbedEntity, ["localPosition", "parentID", var props = Entities.getEntityProperties(this.grabbedEntity, ["localPosition", "parentID",
"position", "rotation", "dimensions"]); "position", "rotation", "dimensions"]);
if (!props.position) { if (!props.position) {
// server may have reset, taking our equipped entity with it. move back to "off" stte // server may have reset, taking our equipped entity with it. move back to "off" state
this.callEntityMethodOnGrabbed("releaseGrab"); this.callEntityMethodOnGrabbed("releaseGrab");
this.setState(STATE_OFF, "entity has no position property"); this.setState(STATE_OFF, "entity has no position property");
return; return;
@ -2175,10 +2175,9 @@ function MyController(hand) {
return; return;
} }
var handPosition = this.getHandPosition();
var pickRay = { var pickRay = {
origin: handPosition, origin: this.getControllerLocation().position,
direction: Quat.getUp(this.getControllerRotation()) direction: Quat.getUp(this.getControllerLocation().orientation)
}; };
var now = Date.now(); var now = Date.now();