finish purge of RayPick from grab.js

This commit is contained in:
Andrew Meadows 2018-03-01 08:42:08 -08:00
parent 181944d5db
commit b4f941af03

View file

@ -15,7 +15,7 @@
// //
/* global MyAvatar, Entities, Script, Camera, Vec3, Reticle, Overlays, getEntityCustomData, Messages, Quat, Controller, /* global MyAvatar, Entities, Script, Camera, Vec3, Reticle, Overlays, getEntityCustomData, Messages, Quat, Controller,
isInEditMode, HMD entityIsGrabbable, Pointers, PickType RayPick*/ isInEditMode, HMD entityIsGrabbable, Picks, PickType, Pointers*/
(function() { // BEGIN LOCAL_SCOPE (function() { // BEGIN LOCAL_SCOPE
@ -258,14 +258,14 @@ function Grabber() {
this.liftKey = false; // SHIFT this.liftKey = false; // SHIFT
this.rotateKey = false; // CONTROL this.rotateKey = false; // CONTROL
this.mouseRayOverlays = RayPick.createRayPick({ this.mouseRayOverlays = Picks.createPick(PickType.Ray, {
joint: "Mouse", joint: "Mouse",
filter: Picks.PICK_OVERLAYS, filter: Picks.PICK_OVERLAYS,
enabled: true enabled: true
}); });
var tabletItems = getMainTabletIDs(); var tabletItems = getMainTabletIDs();
if (tabletItems.length > 0) { if (tabletItems.length > 0) {
RayPick.setIncludeItems(this.mouseRayOverlays, tabletItems); Picks.setIncludeItems(this.mouseRayOverlays, tabletItems);
} }
var renderStates = [{name: "grabbed", end: beacon}]; var renderStates = [{name: "grabbed", end: beacon}];
this.mouseRayEntities = Pointers.createPointer(PickType.Ray, { this.mouseRayEntities = Pointers.createPointer(PickType.Ray, {
@ -328,7 +328,7 @@ Grabber.prototype.pressEvent = function(event) {
return; return;
} }
var overlayResult = RayPick.getPrevRayPickResult(this.mouseRayOverlays); var overlayResult = Picks.getPrevPickResult(this.mouseRayOverlays);
if (overlayResult.type != Picks.INTERSECTED_NONE) { if (overlayResult.type != Picks.INTERSECTED_NONE) {
return; return;
} }
@ -599,7 +599,7 @@ Grabber.prototype.keyPressEvent = function(event) {
Grabber.prototype.cleanup = function() { Grabber.prototype.cleanup = function() {
Pointers.removePointer(this.mouseRayEntities); Pointers.removePointer(this.mouseRayEntities);
RayPick.removeRayPick(this.mouseRayOverlays); Picks.removePick(this.mouseRayOverlays);
}; };
var grabber = new Grabber(); var grabber = new Grabber();