From 4afdd0242bfaf907b4dbdf4a6c707e1ca2aebd24 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 18 Dec 2015 16:44:20 -0800 Subject: [PATCH] cleanup --- .../light_modifier/lightModifierTestScene.js | 52 ++----------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/examples/light_modifier/lightModifierTestScene.js b/examples/light_modifier/lightModifierTestScene.js index 8df83b09bf..58956850f2 100644 --- a/examples/light_modifier/lightModifierTestScene.js +++ b/examples/light_modifier/lightModifierTestScene.js @@ -10,19 +10,17 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var PARENT_SCRIPT_URL = Script.resolvePath('lightParent.js?'+Math.random(0-100)); +var PARENT_SCRIPT_URL = Script.resolvePath('lightParent.js?' + Math.random(0 - 100)); var basePosition, avatarRot; avatarRot = Quat.fromPitchYawRollDegrees(0, MyAvatar.bodyYaw, 0.0); basePosition = Vec3.sum(MyAvatar.position, Vec3.multiply(0, Quat.getUp(avatarRot))); -var light, block; +var light; function createLight() { - var blockProperties = Entities.getEntityProperties(block, ["position", "rotation"]); - var position = basePosition; + var position = basePosition; position.y += 2; - var lightTransform = evalLightWorldTransform(position,avatarRot); - // var lightTransform = evalLightWorldTransform(blockProperties.position, blockProperties.rotation); + var lightTransform = evalLightWorldTransform(position, avatarRot); var lightProperties = { name: 'Hifi-Spotlight', type: "Light", @@ -32,7 +30,6 @@ function createLight() { y: 2, z: 8 }, - // parentID: block, color: { red: 255, green: 0, @@ -48,45 +45,6 @@ function createLight() { light = Entities.addEntity(lightProperties); - var message = { - light: { - id: light, - type: 'spotlight', - initialProperties: lightProperties - } - }; - -// Messages.sendMessage('Hifi-Light-Mod-Receiver', JSON.stringify(message)); - -} - -function createBlock() { - var position = basePosition; - position.y += 3; - var blockProperties = { - name: 'Hifi-Spotlight-Block', - type: 'Box', - dimensions: { - x: 1, - y: 1, - z: 1 - }, - collisionsWillMove: true, - color: { - red: 0, - green: 0, - blue: 255 - }, - position: position, - script:PARENT_SCRIPT_URL, - userData: JSON.stringify({ - handControllerKey: { - disableReleaseVelocity: true - } - }) - }; - - block = Entities.addEntity(blockProperties); } function evalLightWorldTransform(modelPos, modelRot) { @@ -107,11 +65,9 @@ function evalLightWorldTransform(modelPos, modelRot) { } function cleanup() { - //Entities.deleteEntity(block); Entities.deleteEntity(light); } Script.scriptEnding.connect(cleanup); -//createBlock(); createLight(); \ No newline at end of file