From cb0112e14e6edad17133d407dd8f60a06c028e35 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 15 May 2015 13:21:58 -0700 Subject: [PATCH] remove line pointers from grab and hockey grab --- examples/example/games/grabHockey.js | 19 ++----------------- examples/grab.js | 16 ---------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/examples/example/games/grabHockey.js b/examples/example/games/grabHockey.js index 31597ba32d..5e101e1d48 100644 --- a/examples/example/games/grabHockey.js +++ b/examples/example/games/grabHockey.js @@ -13,7 +13,6 @@ var isGrabbing = false; var grabbedEntity = null; -var lineEntityID = null; var prevMouse = {}; var deltaMouse = { z: 0 @@ -39,9 +38,9 @@ var angularVelocity = { var grabSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/CloseClamp.wav"); var releaseSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/ReleaseClamp.wav"); -var VOLUME = 0.10; +var VOLUME = 0.0; -var DROP_DISTANCE = 5.0; +var DROP_DISTANCE = 0.10; var DROP_COLOR = { red: 200, green: 200, @@ -92,14 +91,6 @@ function mousePressEvent(event) { gravity: {x: 0, y: 0, z: 0} }); - lineEntityID = Entities.addEntity({ - type: "Line", - position: nearLinePoint(targetPosition), - dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition)), - color: { red: 255, green: 255, blue: 255 }, - lifetime: 300 // if someone crashes while moving something, don't leave the line there forever. - }); - Audio.playSound(grabSound, { position: props.position, volume: VOLUME @@ -145,8 +136,6 @@ function mouseReleaseEvent() { }); targetPosition = null; - Entities.deleteEntity(lineEntityID); - Audio.playSound(releaseSound, { position: entityProps.position, volume: VOLUME @@ -193,10 +182,6 @@ function mouseMoveEvent(event) { angularVelocity = Vec3.multiply((theta / dT), axisAngle); } - Entities.editEntity(lineEntityID, { - position: nearLinePoint(targetPosition), - dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition)) - }); } prevMouse.x = event.x; prevMouse.y = event.y; diff --git a/examples/grab.js b/examples/grab.js index 019ec2320f..f1e1b6571c 100644 --- a/examples/grab.js +++ b/examples/grab.js @@ -13,7 +13,6 @@ var isGrabbing = false; var grabbedEntity = null; -var lineEntityID = null; var prevMouse = {}; var deltaMouse = { z: 0 @@ -91,14 +90,6 @@ function mousePressEvent(event) { gravity: {x: 0, y: 0, z: 0} }); - lineEntityID = Entities.addEntity({ - type: "Line", - position: nearLinePoint(targetPosition), - dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition)), - color: { red: 255, green: 255, blue: 255 }, - lifetime: 300 // if someone crashes while moving something, don't leave the line there forever. - }); - Audio.playSound(grabSound, { position: props.position, volume: 0.4 @@ -144,8 +135,6 @@ function mouseReleaseEvent() { }); targetPosition = null; - Entities.deleteEntity(lineEntityID); - Audio.playSound(grabSound, { position: entityProps.position, volume: 0.25 @@ -191,11 +180,6 @@ function mouseMoveEvent(event) { axisAngle = Quat.axis(dQ); angularVelocity = Vec3.multiply((theta / dT), axisAngle); } - - Entities.editEntity(lineEntityID, { - position: nearLinePoint(targetPosition), - dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition)) - }); } prevMouse.x = event.x; prevMouse.y = event.y;