grab-point sphere is a child of controller joint, so it doesn't jitter

This commit is contained in:
Seth Alves 2016-08-25 13:31:07 -07:00
parent 39f52b3682
commit 0783629cde

View file

@ -25,8 +25,8 @@ var WANT_DEBUG = false;
var WANT_DEBUG_STATE = false; var WANT_DEBUG_STATE = false;
var WANT_DEBUG_SEARCH_NAME = null; var WANT_DEBUG_SEARCH_NAME = null;
var FORCE_IGNORE_IK = false; var FORCE_IGNORE_IK = true;
var SHOW_GRAB_POINT_SPHERE = false; var SHOW_GRAB_POINT_SPHERE = true;
// //
// these tune time-averaging and "on" value for analog trigger // these tune time-averaging and "on" value for analog trigger
@ -833,12 +833,8 @@ function MyController(hand) {
if (!SHOW_GRAB_POINT_SPHERE) { if (!SHOW_GRAB_POINT_SPHERE) {
return; return;
} }
var controllerLocation = this.getControllerLocation(); if (!this.grabPointSphere) {
if (this.grabPointSphere) { var controllerLocation = this.getControllerLocation();
Overlays.editOverlay(this.grabPointSphere, {
position: controllerLocation.position
});
} else {
this.grabPointSphere = Overlays.addOverlay("sphere", { this.grabPointSphere = Overlays.addOverlay("sphere", {
position: controllerLocation.position, position: controllerLocation.position,
rotation: { x: 0, y: 0, z: 0, w: 1 }, rotation: { x: 0, y: 0, z: 0, w: 1 },
@ -848,7 +844,11 @@ function MyController(hand) {
solid: true, solid: true,
visible: true, visible: true,
ignoreRayIntersection: true, ignoreRayIntersection: true,
drawInFront: false drawInFront: false,
parentID: MyAvatar.sessionUUID,
parentJointIndex: MyAvatar.getJointIndex(this.hand === RIGHT_HAND ?
"Controller.Standard.RightHand" :
"Controller.Standard.LeftHand")
}); });
} }
}; };