From 42a73e280eee8dd412b553ce213aa70fc1a68f58 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 13 Nov 2014 09:29:37 -0800 Subject: [PATCH] remove the concert camera scripts from examples --- examples/concertCamera.js | 72 ---------------------------------- examples/concertCamera_kims.js | 72 ---------------------------------- examples/concertCamera_kyrs.js | 72 ---------------------------------- 3 files changed, 216 deletions(-) delete mode 100644 examples/concertCamera.js delete mode 100644 examples/concertCamera_kims.js delete mode 100644 examples/concertCamera_kyrs.js diff --git a/examples/concertCamera.js b/examples/concertCamera.js deleted file mode 100644 index 7ab7785345..0000000000 --- a/examples/concertCamera.js +++ /dev/null @@ -1,72 +0,0 @@ -// -// concertCamera.js -// -// Created by Philip Rosedale on June 24, 2014 -// Copyright 2014 High Fidelity, Inc. -// -// Move a camera through a series of pre-set locations by pressing number keys -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -var oldMode; -var avatarPosition; - -var cameraNumber = 0; -var freeCamera = false; - -var cameraLocations = [ {x: 7971.9, y: 241.3, z: 7304.1}, {x: 7973.0, y: 241.3, z: 7304.1}, {x: 7975.5, y: 241.3, z: 7304.1}, {x: 7972.3, y: 241.3, z: 7303.3}, {x: 7971.0, y: 241.3, z: 7304.3}, {x: 7973.5, y: 240.7, z: 7302.5} ]; -var cameraLookAts = [ {x: 7971.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7971.3, y: 241.3, z: 7304.2} ]; - -function saveCameraState() { - oldMode = Camera.mode; - avatarPosition = MyAvatar.position; - Camera.setModeShiftPeriod(0.0); - Camera.mode = "independent"; -} - -function restoreCameraState() { - Camera.stopLooking(); - Camera.mode = oldMode; -} - -function update(deltaTime) { - if (freeCamera) { - var delta = Vec3.subtract(MyAvatar.position, avatarPosition); - if (Vec3.length(delta) > 0.05) { - cameraNumber = 0; - freeCamera = false; - restoreCameraState(); - } - } -} - -function keyPressEvent(event) { - - var choice = parseInt(event.text); - - if ((choice > 0) && (choice <= cameraLocations.length)) { - print("camera " + choice); - if (!freeCamera) { - saveCameraState(); - freeCamera = true; - } - Camera.mode = "independent"; - Camera.setPosition(cameraLocations[choice - 1]); - Camera.keepLookingAt(cameraLookAts[choice - 1]); - } - if (event.text == "ESC") { - cameraNumber = 0; - freeCamera = false; - restoreCameraState(); - } - if (event.text == "0") { - // Show camera location in log - var cameraLocation = Camera.getPosition(); - print(cameraLocation.x + ", " + cameraLocation.y + ", " + cameraLocation.z); - } -} - -Script.update.connect(update); -Controller.keyPressEvent.connect(keyPressEvent); diff --git a/examples/concertCamera_kims.js b/examples/concertCamera_kims.js deleted file mode 100644 index ff4fb632de..0000000000 --- a/examples/concertCamera_kims.js +++ /dev/null @@ -1,72 +0,0 @@ -// -// concertCamera.js -// -// Created by Philip Rosedale on June 24, 2014 -// Copyright 2014 High Fidelity, Inc. -// -// Move a camera through a series of pre-set locations by pressing number keys -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -var oldMode; -var avatarPosition; - -var cameraNumber = 0; -var freeCamera = false; - -var cameraLocations = [ {x: 8027.5, y: 237.5, z: 7305.7}, {x: 8027.5, y: 237.5, z: 7306.6}, {x: 8027.5, y: 237.5, z: 7308.0}, {x: 8027.5, y: 237.5, z: 7303.0}, {x: 8030.8, y: 238.6, z: 7311.4}, {x: 8030.9, y: 237.1, z: 7308.0} ]; -var cameraLookAts = [ {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7305.7}, {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7304.0} ]; - -function saveCameraState() { - oldMode = Camera.mode; - avatarPosition = MyAvatar.position; - Camera.setModeShiftPeriod(0.0); - Camera.mode = "independent"; -} - -function restoreCameraState() { - Camera.stopLooking(); - Camera.mode = oldMode; -} - -function update(deltaTime) { - if (freeCamera) { - var delta = Vec3.subtract(MyAvatar.position, avatarPosition); - if (Vec3.length(delta) > 0.05) { - cameraNumber = 0; - freeCamera = false; - restoreCameraState(); - } - } -} - -function keyPressEvent(event) { - - var choice = parseInt(event.text); - - if ((choice > 0) && (choice <= cameraLocations.length)) { - print("camera " + choice); - if (!freeCamera) { - saveCameraState(); - freeCamera = true; - } - Camera.mode = "independent"; - Camera.setPosition(cameraLocations[choice - 1]); - Camera.keepLookingAt(cameraLookAts[choice - 1]); - } - if (event.text == "ESC") { - cameraNumber = 0; - freeCamera = false; - restoreCameraState(); - } - if (event.text == "0") { - // Show camera location in log - var cameraLocation = Camera.getPosition(); - print(cameraLocation.x + ", " + cameraLocation.y + ", " + cameraLocation.z); - } -} - -Script.update.connect(update); -Controller.keyPressEvent.connect(keyPressEvent); diff --git a/examples/concertCamera_kyrs.js b/examples/concertCamera_kyrs.js deleted file mode 100644 index 4c7c893783..0000000000 --- a/examples/concertCamera_kyrs.js +++ /dev/null @@ -1,72 +0,0 @@ -// -// concertCamera.js -// -// Created by Philip Rosedale on June 24, 2014 -// Copyright 2014 High Fidelity, Inc. -// -// Move a camera through a series of pre-set locations by pressing number keys -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -var oldMode; -var avatarPosition; - -var cameraNumber = 0; -var freeCamera = false; - -var cameraLocations = [ {x: 2921.5, y: 251.3, z: 8254.8}, {x: 2921.5, y: 251.3, z: 8254.4}, {x: 2921.5, y: 251.3, z: 8252.2}, {x: 2921.5, y: 251.3, z: 8247.2}, {x: 2921.4, y: 251.3, z: 8255.7} ]; -var cameraLookAts = [ {x: 2921.5, y: 251.3, z: 8255.7}, {x: 2921.5, y: 251.3, z: 8255.7}, {x: 2921.5, y: 251.3, z: 8255.7}, {x: 2921.5, y: 251.3, z: 8255.7}, {x: 2921.4 , y: 251.3, z: 8255.1} ]; - -function saveCameraState() { - oldMode = Camera.mode; - avatarPosition = MyAvatar.position; - Camera.setModeShiftPeriod(0.0); - Camera.mode = "independent"; -} - -function restoreCameraState() { - Camera.stopLooking(); - Camera.mode = oldMode; -} - -function update(deltaTime) { - if (freeCamera) { - var delta = Vec3.subtract(MyAvatar.position, avatarPosition); - if (Vec3.length(delta) > 0.05) { - cameraNumber = 0; - freeCamera = false; - restoreCameraState(); - } - } -} - -function keyPressEvent(event) { - - var choice = parseInt(event.text); - - if ((choice > 0) && (choice <= cameraLocations.length)) { - print("camera " + choice); - if (!freeCamera) { - saveCameraState(); - freeCamera = true; - } - Camera.mode = "independent"; - Camera.setPosition(cameraLocations[choice - 1]); - Camera.keepLookingAt(cameraLookAts[choice - 1]); - } - if (event.text == "ESC") { - cameraNumber = 0; - freeCamera = false; - restoreCameraState(); - } - if (event.text == "0") { - // Show camera location in log - var cameraLocation = Camera.getPosition(); - print(cameraLocation.x + ", " + cameraLocation.y + ", " + cameraLocation.z); - } -} - -Script.update.connect(update); -Controller.keyPressEvent.connect(keyPressEvent);