From 2ec8f3f62556840ea0439fe6ae686e86b8cad002 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 25 Oct 2017 11:29:32 -0700 Subject: [PATCH] made non-dynamic entities collisionless during far-grab --- .../controllers/controllerModules/farActionGrabEntity.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/controllerModules/farActionGrabEntity.js b/scripts/system/controllers/controllerModules/farActionGrabEntity.js index ee2db6f6e0..e34855d521 100644 --- a/scripts/system/controllers/controllerModules/farActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/farActionGrabEntity.js @@ -119,6 +119,7 @@ Script.include("/~/system/libraries/controllers.js"); this.actionID = null; // action this script created... this.entityWithContextOverlay = false; this.contextOverlayTimer = false; + this.previousCollisionStatus = false; this.reticleMinX = MARGIN; this.reticleMaxX; this.reticleMinY = MARGIN; @@ -342,7 +343,9 @@ Script.include("/~/system/libraries/controllers.js"); if (this.madeDynamic) { var props = {}; props.dynamic = false; + props.collisionless = this.previousCollisionStatus; props.localVelocity = {x: 0, y: 0, z: 0}; + props.localRotation = {x: 0, y: 0, z: 0}; Entities.editEntity(this.grabbedThingID, props); this.madeDynamic = false; } @@ -507,10 +510,12 @@ Script.include("/~/system/libraries/controllers.js"); if (entityIsGrabbable(targetProps)) { if (!entityIsDistanceGrabbable(targetProps)) { targetProps.dynamic = true; + this.previousCollisionStatus = targetProps.collisionless; + targetProps.collisionless = true; Entities.editEntity(entityID, targetProps); this.madeDynamic = true; } - + if (!this.distanceRotating) { this.grabbedThingID = entityID; this.grabbedDistance = rayPickInfo.distance;