From 171ae02b03f61801c43116abee5c70fbde9fb500 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 30 Nov 2015 13:12:39 -0800 Subject: [PATCH 1/3] update to parity with createWand.js --- unpublishedScripts/hiddenEntityReset.js | 31 ++++++++++++++---------- unpublishedScripts/masterReset.js | 32 ++++++++++++++----------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/unpublishedScripts/hiddenEntityReset.js b/unpublishedScripts/hiddenEntityReset.js index cf9eaaa451..83c1d63f1b 100644 --- a/unpublishedScripts/hiddenEntityReset.js +++ b/unpublishedScripts/hiddenEntityReset.js @@ -931,16 +931,18 @@ function createWand(position) { var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx'; - var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/actual_no_top_collision_hull.obj'; - var entity = Entities.addEntity({ + var WAND_COLLISION_SHAPE = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand_collision_hull.obj'; + + var wand = Entities.addEntity({ name: 'Bubble Wand', type: "Model", modelURL: WAND_MODEL, + shapeType: 'compound', position: position, gravity: { x: 0, - y: -9.8, - z: 0 + y: 0, + z: 0, }, dimensions: { x: 0.05, @@ -948,24 +950,27 @@ z: 0.05 }, //must be enabled to be grabbable in the physics engine - shapeType: 'compound', collisionsWillMove: true, compoundShapeURL: WAND_COLLISION_SHAPE, - //Look into why bubble wand is going through table when gravity is enabled - // gravity: {x: 0, y: -3.5, z: 0}, - // velocity: {x: 0, y: -0.01, z:0}, script: wandScriptURL, userData: JSON.stringify({ - resetMe: { - resetMe: true - }, grabbableKey: { - invertSolidWhileHeld: true + resetMe: { + resetMe: true + }, + invertSolidWhileHeld: true, + spatialKey: { + relativePosition: { + x: 0, + y: 0.1, + z: 0 + }, + relativeRotation: Quat.fromPitchYawRollDegrees(0, 0, 90) + } } }) }); - } function createBasketBall(position) { diff --git a/unpublishedScripts/masterReset.js b/unpublishedScripts/masterReset.js index 60b4e7a72f..596cff3d99 100644 --- a/unpublishedScripts/masterReset.js +++ b/unpublishedScripts/masterReset.js @@ -883,7 +883,7 @@ MasterReset = function() { type: "Model", modelURL: MODEL_URL, shapeType: 'compound', - compoundShapeURL:COLLISION_HULL_URL, + compoundShapeURL: COLLISION_HULL_URL, script: pingPongScriptURL, position: position, rotation: rotation, @@ -913,17 +913,18 @@ MasterReset = function() { function createWand(position) { var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx'; - var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/actual_no_top_collision_hull.obj'; + var WAND_COLLISION_SHAPE = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand_collision_hull.obj'; - var entity = Entities.addEntity({ + var wand = Entities.addEntity({ name: 'Bubble Wand', type: "Model", modelURL: WAND_MODEL, + shapeType: 'compound', position: position, gravity: { x: 0, - y: -9.8, - z: 0 + y: 0, + z: 0, }, dimensions: { x: 0.05, @@ -931,24 +932,27 @@ MasterReset = function() { z: 0.05 }, //must be enabled to be grabbable in the physics engine - shapeType: 'compound', collisionsWillMove: true, compoundShapeURL: WAND_COLLISION_SHAPE, - //Look into why bubble wand is going through table when gravity is enabled - // gravity: {x: 0, y: -3.5, z: 0}, - // velocity: {x: 0, y: -0.01, z:0}, script: wandScriptURL, userData: JSON.stringify({ - resetMe: { - resetMe: true - }, grabbableKey: { - invertSolidWhileHeld: true + resetMe: { + resetMe: true + }, + invertSolidWhileHeld: true, + spatialKey: { + relativePosition: { + x: 0, + y: 0.1, + z: 0 + }, + relativeRotation: Quat.fromPitchYawRollDegrees(0, 0, 90) + } } }) }); - } function createBasketBall(position) { From 9b90c19781f5562dc16deb8ce9df1c58f2b3c69c Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 30 Nov 2015 13:24:33 -0800 Subject: [PATCH 2/3] cleanup --- unpublishedScripts/hiddenEntityReset.js | 10 +++++----- unpublishedScripts/masterReset.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/unpublishedScripts/hiddenEntityReset.js b/unpublishedScripts/hiddenEntityReset.js index 83c1d63f1b..e50a658fba 100644 --- a/unpublishedScripts/hiddenEntityReset.js +++ b/unpublishedScripts/hiddenEntityReset.js @@ -930,7 +930,7 @@ } function createWand(position) { - var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx'; + var WAND_MODEL = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand.fbx'; var WAND_COLLISION_SHAPE = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand_collision_hull.obj'; var wand = Entities.addEntity({ @@ -941,7 +941,7 @@ position: position, gravity: { x: 0, - y: 0, + y: -9.8, z: 0, }, dimensions: { @@ -954,10 +954,10 @@ compoundShapeURL: WAND_COLLISION_SHAPE, script: wandScriptURL, userData: JSON.stringify({ + resetMe: { + resetMe: true + }, grabbableKey: { - resetMe: { - resetMe: true - }, invertSolidWhileHeld: true, spatialKey: { relativePosition: { diff --git a/unpublishedScripts/masterReset.js b/unpublishedScripts/masterReset.js index 596cff3d99..108f299ae3 100644 --- a/unpublishedScripts/masterReset.js +++ b/unpublishedScripts/masterReset.js @@ -912,7 +912,7 @@ MasterReset = function() { } function createWand(position) { - var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx'; + var WAND_MODEL = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand.fbx'; var WAND_COLLISION_SHAPE = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand_collision_hull.obj'; var wand = Entities.addEntity({ @@ -923,7 +923,7 @@ MasterReset = function() { position: position, gravity: { x: 0, - y: 0, + y: -9.8, z: 0, }, dimensions: { @@ -936,10 +936,10 @@ MasterReset = function() { compoundShapeURL: WAND_COLLISION_SHAPE, script: wandScriptURL, userData: JSON.stringify({ + resetMe: { + resetMe: true + }, grabbableKey: { - resetMe: { - resetMe: true - }, invertSolidWhileHeld: true, spatialKey: { relativePosition: { From 7c12379adae5763cf3aeda7c646fc10909d5b179 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 30 Nov 2015 17:00:40 -0800 Subject: [PATCH 3/3] fix release hand message --- examples/toybox/bow/bow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/toybox/bow/bow.js b/examples/toybox/bow/bow.js index f38aa64921..14e3ed86ec 100644 --- a/examples/toybox/bow/bow.js +++ b/examples/toybox/bow/bow.js @@ -216,7 +216,7 @@ // print('RELEASE GRAB EVENT') if (this.isGrabbed === true && this.hand === this.initialHand) { - Messages.sendMessage('Hifi-Beam-Disabler', "none") + Messages.sendMessage('Hifi-Hand-Disabler', "none") this.isGrabbed = false; this.stringDrawn = false;