diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index 8d1eca84d7..0def701739 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -19,7 +19,7 @@ macro(GENERATE_INSTALLERS) set(CPACK_PACKAGE_NAME ${_DISPLAY_NAME}) set(CPACK_PACKAGE_VENDOR "High Fidelity") set(CPACK_PACKAGE_VERSION ${BUILD_VERSION}) - set(CPACK_PACKAGE_FILE_NAME "HighFidelity-Alpha-${BUILD_VERSION}") + set(CPACK_PACKAGE_FILE_NAME "HighFidelity-Beta-${BUILD_VERSION}") set(CPACK_NSIS_DISPLAY_NAME ${_DISPLAY_NAME}) set(CPACK_NSIS_PACKAGE_NAME ${_DISPLAY_NAME}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${_DISPLAY_NAME}) diff --git a/examples/clap.js b/examples/clap.js deleted file mode 100644 index 9b21075ae7..0000000000 --- a/examples/clap.js +++ /dev/null @@ -1,148 +0,0 @@ -// -// clap.js -// examples -// -// Copyright 2014 High Fidelity, Inc. -// -// This sample script watches your hydra hands and makes clapping sound when they come close together fast, -// and also watches for the 'shift' key and claps when that key is pressed. Clapping multiple times by pressing -// the shift key again makes the animation and sound match your pace of clapping. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; - -var clapAnimation = HIFI_PUBLIC_BUCKET + "animations/ClapAnimations/ClapHands_Standing.fbx"; -var ANIMATION_FRAMES_PER_CLAP = 10.0; -var startEndFrames = []; -startEndFrames.push({ start: 0, end: 10}); -startEndFrames.push({ start: 10, end: 20}); -startEndFrames.push({ start: 20, end: 30}); -startEndFrames.push({ start: 30, end: 40}); -startEndFrames.push({ start: 41, end: 51}); -startEndFrames.push({ start: 53, end: 0}); - -var lastClapFrame = 0; -var lastAnimFrame = 0; - -var claps = []; -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap1Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap2Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap3Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap4Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap5Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap6Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap7Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap8Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap9Rvb.wav")); -claps.push(SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap10Rvb.wav")); -var numberOfSounds = claps.length; - -var clappingNow = false; -var collectedClicks = 0; - -var clickStartTime, clickEndTime; -var clickClappingNow = false; -var CLAP_START_RATE = 15.0; -var clapRate = CLAP_START_RATE; -var startedTimer = false; - -function maybePlaySound(deltaTime) { - // Set the location and other info for the sound to play - - var animationDetails = MyAvatar.getAnimationDetails(clapAnimation); - - var frame = Math.floor(animationDetails.frameIndex); - - if (frame != lastAnimFrame) { - lastAnimFrame = frame; - } - - for (var i = 0; i < startEndFrames.length; i++) { - if (frame == startEndFrames[i].start && (frame != lastClapFrame)) { - playClap(1.0, Camera.getPosition()); - lastClapFrame = frame; - } - } - - var palm1Position = MyAvatar.getLeftPalmPosition(); - var palm2Position = MyAvatar.getRightPalmPosition(); - var distanceBetween = Vec3.length(Vec3.subtract(palm1Position, palm2Position)); - - var palm1Velocity = Controller.getPoseValue(Controller.Standard.LeftHand).velocity; - var palm2Velocity = Controller.getPoseValue(Controller.Standard.RightHand).velocity; - var closingVelocity = Vec3.length(Vec3.subtract(palm1Velocity, palm2Velocity)); - - const CLAP_SPEED = 0.7; - const CLAP_DISTANCE = 0.15; - - if ((closingVelocity > CLAP_SPEED) && (distanceBetween < CLAP_DISTANCE) && !clappingNow) { - var volume = closingVelocity / 2.0; - if (volume > 1.0) volume = 1.0; - playClap(volume, palm1Position); - clappingNow = true; - } else if (clappingNow && (distanceBetween > CLAP_DISTANCE * 1.2)) { - clappingNow = false; - } -} - -function playClap(volume, position) { - var clip = Math.floor(Math.random() * numberOfSounds); - Audio.playSound(claps[clip], { - position: position, - volume: volume - }); -} - -var FASTEST_CLAP_INTERVAL = 150.0; -var SLOWEST_CLAP_INTERVAL = 750.0; - -Controller.keyPressEvent.connect(function(event) { - if(event.text == "SHIFT") { - if (!clickClappingNow) { - clickClappingNow = true; - clickStartTime = new Date(); - lastClapFrame = 0; - } else { - // start or adjust clapping speed based on the duration between clicks - clickEndTime = new Date(); - var milliseconds = Math.max(clickEndTime - clickStartTime, FASTEST_CLAP_INTERVAL); - clickStartTime = new Date(); - if (milliseconds < SLOWEST_CLAP_INTERVAL) { - clapRate = ANIMATION_FRAMES_PER_CLAP * (1000.0 / milliseconds); - playClap(1.0, Camera.getPosition()); - MyAvatar.stopAnimation(clapAnimation); - MyAvatar.startAnimation(clapAnimation, clapRate, 1.0, true, false); - } - collectedClicks = collectedClicks + 1; - } - } -}); - -var CLAP_END_WAIT_MSECS = 300; -Controller.keyReleaseEvent.connect(function(event) { - if (event.text == "SHIFT") { - collectedClicks = 0; - if (!startedTimer) { - collectedClicks = 0; - Script.setTimeout(stopClapping, CLAP_END_WAIT_MSECS); - startedTimer = true; - } - } -}); - -function stopClapping() { - if (collectedClicks == 0) { - startedTimer = false; - MyAvatar.stopAnimation(clapAnimation); - clapRate = CLAP_START_RATE; - clickClappingNow = false; - } else { - startedTimer = false; - } -} - -// Connect a call back that happens every frame -Script.update.connect(maybePlaySound); \ No newline at end of file diff --git a/examples/cows/cowEntityScript.js b/examples/cows/cowEntityScript.js deleted file mode 100644 index 1150be6b36..0000000000 --- a/examples/cows/cowEntityScript.js +++ /dev/null @@ -1,68 +0,0 @@ - -// cowEntityScript.js -// examples/cows -// -// Created by Eric Levin on 3/25/16 -// Copyright 2016 High Fidelity, Inc. -// -// This entity script handles the logic for untipping a cow after it collides with something -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - - - -(function() { - Script.include("../libraries/utils.js"); - - var _this = this; - _this.COLLISION_COOLDOWN_TIME = 5000; - - - this.preload = function(entityID) { - print("EBL Preload!!"); - _this.entityID = entityID; - _this.mooSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/moo.wav") - _this.mooSoundOptions = {volume: 0.7, loop: false}; - _this.timeSinceLastCollision = 0; - _this.shouldUntipCow = true; - } - - this.collisionWithEntity = function(myID, otherID, collisionInfo) { - if(_this.shouldUntipCow) { - Script.setTimeout(function() { - _this.untipCow(); - _this.shouldUntipCow = true; - }, _this.COLLISION_COOLDOWN_TIME); - } - - _this.shouldUntipCow = false; - - } - - this.untipCow = function() { - // keep yaw but reset pitch and roll - var cowProps = Entities.getEntityProperties(_this.entityID, ["rotation", "position"]); - var eulerRotation = Quat.safeEulerAngles(cowProps.rotation); - eulerRotation.x = 0; - eulerRotation.z = 0; - var newRotation = Quat.fromVec3Degrees(eulerRotation); - Entities.editEntity(_this.entityID, { - rotation: newRotation, - velocity: {x: 0, y: 0, z: 0}, - angularVelocity: {x: 0, y: 0, z:0} - }); - - - _this.mooSoundOptions.position = cowProps.position; - if (!_this.soundInjector) { - _this.soundInjector = Audio.playSound(_this.mooSound, _this.mooSoundOptions); - } else { - _this.soundInjector.setOptions(_this.mooSoundOptions); - _this.soundInjector.restart(); - } - } - - -}); diff --git a/examples/cows/cowSpawner.js b/examples/cows/cowSpawner.js deleted file mode 100644 index 7ff59b2e38..0000000000 --- a/examples/cows/cowSpawner.js +++ /dev/null @@ -1,53 +0,0 @@ - -// cowSpawner.js -// examples/cows -// -// Created by Eric Levin on 3/25/16 -// Copyright 2016 High Fidelity, Inc. -// -// This spawns a cow which will untip itself -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - - var orientation = MyAvatar.orientation; - orientation = Quat.safeEulerAngles(orientation); - orientation.x = 0; - orientation = Quat.fromVec3Degrees(orientation); - var center = Vec3.sum(MyAvatar.getHeadPosition(), Vec3.multiply(2, Quat.getFront(orientation))); - - - var SCRIPT_URL = Script.resolvePath("cowEntityScript.js?"); - var cow = Entities.addEntity({ - type: "Model", - modelURL: "http://hifi-content.s3.amazonaws.com/DomainContent/production/cow/newMooCow.fbx", - name: "playa_model_throwinCow", - position: center, - animation: { - currentFrame: 278, - running: true, - url: "http://hifi-content.s3.amazonaws.com/DomainContent/Junkyard/Playa/newMooCow.fbx" - }, - dimensions: { - x: 0.739, - y: 1.613, - z: 2.529 - }, - dynamic: true, - gravity: { - x: 0, - y: -5, - z: 0 - }, - shapeType: "box", - script: SCRIPT_URL, - userData: "{\"grabbableKey\":{\"grabbable\":true}}" - }); - - - function cleanup() { - Entities.deleteEntity(cow); - } - - Script.scriptEnding.connect(cleanup); diff --git a/examples/defaultScripts.js b/examples/defaultScripts.js deleted file mode 100644 index a4c8c36169..0000000000 --- a/examples/defaultScripts.js +++ /dev/null @@ -1,22 +0,0 @@ -// -// defaultScripts.js -// examples -// -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -Script.load("away.js"); -Script.load("progress.js"); -Script.load("edit.js"); -Script.load("examples.js"); -Script.load("selectAudioDevice.js"); -Script.load("notifications.js"); -Script.load("controllers/handControllerGrab.js"); -Script.load("controllers/squeezeHands.js"); -Script.load("grab.js"); -Script.load("directory.js"); -Script.load("dialTone.js"); -Script.load("depthReticle.js"); diff --git a/examples/example/games/exterminatorGame/pistol.js b/examples/example/games/exterminatorGame/pistol.js deleted file mode 100644 index 2cccf95986..0000000000 --- a/examples/example/games/exterminatorGame/pistol.js +++ /dev/null @@ -1,477 +0,0 @@ -// -// pistol.js -// examples -// -// Created by Eric Levin on 11/12/2015 -// Copyright 2013 High Fidelity, Inc. -// -// This is an example script that turns the hydra controllers and mouse into a entity gun. -// It reads the controller, watches for trigger pulls, and adds a force to any entity it hits - -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - - -Script.include("../../../libraries/utils.js"); -Script.include("../../../libraries/constants.js"); - -var GUN_FORCE =20; - -Messages.sendMessage('Hifi-Hand-Disabler', "both"); - -var gameName = "Kill All The Rats!" -// var HOST = "localhost:5000" -var HOST = "desolate-bastion-1742.herokuapp.com"; -var socketClient = new WebSocket("ws://" + HOST); -var username = GlobalServices.username; -var currentScore = 0; - -function score() { - currentScore++; - socketClient.send(JSON.stringify({ - username: username, - score: currentScore, - gameName: gameName - })) -} - - -HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; -var fireSound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/Guns/GUN-SHOT2.raw"); -var LASER_LENGTH = 100; -var LASER_WIDTH = 2; -var POSE_CONTROLS = [Controller.Standard.LeftHand, Controller.Standard.RightHand]; -var TRIGGER_CONTROLS = [Controller.Standard.LT, Controller.Standard.RT]; -var MIN_THROWER_DELAY = 1000; -var MAX_THROWER_DELAY = 1000; -var RELOAD_INTERVAL = 5; -var GUN_MODEL = HIFI_PUBLIC_BUCKET + "cozza13/gun/m1911-handgun+1.fbx?v=4"; -var BULLET_VELOCITY = 10.0; -var GUN_OFFSETS = [{ - x: 0.04, - y: 0.26, - z: 0.04 -}, { - x: 0.04, - y: 0.26, - z: 0.04 -}]; - -var GUN_ORIENTATIONS = [Quat.fromPitchYawRollDegrees(0, 90, 90), Quat.fromPitchYawRollDegrees(0, -90, 270)]; - -//x -> y -//y -> z -// z -> x -var BARREL_OFFSETS = [ { - x: -0.12, - y: 0.12, - z: 0.04 -}, { - x: 0.12, - y: 0.12, - z: 0.04 -} ]; - - - -var pointers = []; - -pointers.push(Overlays.addOverlay("line3d", { - start: ZERO_VECTOR, - end: ZERO_VECTOR, - color: COLORS.RED, - alpha: 1, - visible: true, - lineWidth: LASER_WIDTH -})); - -pointers.push(Overlays.addOverlay("line3d", { - start: ZERO_VECTOR, - end: ZERO_VECTOR, - color: COLORS.RED, - alpha: 1, - visible: true, - lineWidth: LASER_WIDTH -})); - -var mapping = Controller.newMapping(); -var validPoses = [false, false]; -var barrelVectors = [0, 0]; -var barrelTips = [0, 0]; - - -// If enabled, anything can be shot, otherwise, an entity needs to have "isShootable" set in its userData -var shootAnything = true; - - -function update(deltaTime) { - // FIXME we should also expose MyAvatar.handPoses[2], MyAvatar.tipPoses[2] - var tipPoses = [MyAvatar.leftHandTipPose, MyAvatar.rightHandTipPose]; - - for (var side = 0; side < 2; side++) { - // First check if the controller is valid - var controllerPose = Controller.getPoseValue(POSE_CONTROLS[side]); - validPoses[side] = controllerPose.valid; - // Need to adjust the laser - var tipPose = tipPoses[side]; - var handRotation = tipPoses[side].rotation; - var barrelOffset = Vec3.multiplyQbyV(handRotation, BARREL_OFFSETS[side]); - barrelTips[side] = Vec3.sum(tipPose.translation, barrelOffset); - barrelVectors[side] = Vec3.multiplyQbyV(handRotation, { - x: 0, - y: 1, - z: 0 - }); - - var laserTip = Vec3.sum(Vec3.multiply(LASER_LENGTH, barrelVectors[side]), barrelTips[side]); - // Update Lasers - Overlays.editOverlay(pointers[side], { - start: barrelTips[side], - end: laserTip, - alpha: 1, - }); - - } -} - - - -function displayPointer(side) { - Overlays.editOverlay(pointers[side], { - visible: true - }); -} - -function hidePointer(side) { - Overlays.editOverlay(pointers[side], { - visible: false - }); -} - -function fire(side, value) { - if (value == 0) { - return; - } - Audio.playSound(fireSound, { - position: barrelTips[side], - volume: 0.5 - }); - - var shotDirection = Vec3.normalize(barrelVectors[side]); - var pickRay = { - origin: barrelTips[side], - direction: shotDirection - }; - createMuzzleFlash(barrelTips[side]); - - var intersection = Entities.findRayIntersectionBlocking(pickRay, true); - if (intersection.intersects) { - Script.setTimeout(function() { - createEntityHitEffect(intersection.intersection); - if (shootAnything && intersection.properties.dynamic === 1) { - // Any dynamic entity can be shot - Entities.editEntity(intersection.entityID, { - velocity: Vec3.multiply(shotDirection, GUN_FORCE) - }); - } - - if (intersection.properties.name === "rat") { - score(); - createBloodSplatter(intersection.intersection); - Entities.deleteEntity(intersection.entityID); - - } - //Attempt to call entity method's shot method - var forceDirection = JSON.stringify({ - forceDirection: shotDirection - }); - Entities.callEntityMethod(intersection.entityID, 'onShot', [forceDirection]); - - }, 0); - - } -} - - -function scriptEnding() { - Messages.sendMessage('Hifi-Hand-Disabler', 'none'); - mapping.disable(); - for (var i = 0; i < pointers.length; ++i) { - Overlays.deleteOverlay(pointers[i]); - } - MyAvatar.detachOne(GUN_MODEL); - MyAvatar.detachOne(GUN_MODEL); - clearPose(); -} - -MyAvatar.attach(GUN_MODEL, "LeftHand", GUN_OFFSETS[0], GUN_ORIENTATIONS[0], 0.40); -MyAvatar.attach(GUN_MODEL, "RightHand", GUN_OFFSETS[1], GUN_ORIENTATIONS[1], 0.40); - -function showPointer(side) { - Overlays.editOverlay(pointers[side], { - visible: true - }); -} - - - -mapping.from(Controller.Standard.LT).hysteresis(0.0, 0.5).to(function(value) { - fire(0, value); -}); - - -mapping.from(Controller.Standard.RT).hysteresis(0.0, 0.5).to(function(value) { - fire(1, value); -}); -mapping.enable(); - -Script.scriptEnding.connect(scriptEnding); -Script.update.connect(update); - - -function createEntityHitEffect(position) { - var flash = Entities.addEntity({ - type: "ParticleEffect", - position: position, - lifetime: 4, - "name": "Flash Emitter", - "color": { - red: 228, - green: 128, - blue: 12 - }, - "maxParticles": 1000, - "lifespan": 0.15, - "emitRate": 1000, - "emitSpeed": 1, - "speedSpread": 0, - "emitOrientation": { - "x": -0.4, - "y": 1, - "z": -0.2, - "w": 0.7071068286895752 - }, - "emitDimensions": { - "x": 0, - "y": 0, - "z": 0 - }, - "polarStart": 0, - "polarFinish": Math.PI, - "azimuthStart": -3.1415927410125732, - "azimuthFinish": 2, - "emitAcceleration": { - "x": 0, - "y": 0, - "z": 0 - }, - "accelerationSpread": { - "x": 0, - "y": 0, - "z": 0 - }, - "particleRadius": 0.03, - "radiusSpread": 0.02, - "radiusStart": 0.02, - "radiusFinish": 0.03, - "colorSpread": { - red: 100, - green: 100, - blue: 20 - }, - "alpha": 1, - "alphaSpread": 0, - "alphaStart": 0, - "alphaFinish": 0, - "additiveBlending": true, - "textures": "http://ericrius1.github.io/PartiArt/assets/star.png" - }); - - Script.setTimeout(function() { - Entities.editEntity(flash, { - isEmitting: false - }); - }, 100); - -} - - -function createBloodSplatter(position) { - var splatter = Entities.addEntity({ - type: "ParticleEffect", - position: position, - lifetime: 4, - "name": "Blood Splatter", - "color": { - red: 230, - green: 2, - blue: 30 - }, - "maxParticles": 1000, - "lifespan": 0.3, - "emitRate": 1000, - "emitSpeed": 0.5, - "speedSpread": 0, - "emitOrientation": { - "x": -0.4, - "y": 1, - "z": -0.2, - "w": 0.7071068286895752 - }, - "emitDimensions": { - "x": 0, - "y": 0, - "z": 0 - }, - "polarStart": 0, - "polarFinish": Math.PI, - "azimuthStart": -3.1415927410125732, - "azimuthFinish": 2, - "emitAcceleration": { - "x": 0, - "y": -5, - "z": 0 - }, - "accelerationSpread": { - "x": 0, - "y": 0, - "z": 0 - }, - "particleRadius": 0.05, - "radiusSpread": 0.03, - "radiusStart": 0.05, - "radiusFinish": 0.05, - "colorSpread": { - red: 40, - green: 0, - blue: 30 - }, - "alpha": 1, - "alphaSpread": 0, - "alphaStart": 0, - "alphaFinish": 0, - "textures": "http://ericrius1.github.io/PartiArt/assets/star.png" - }); - - Script.setTimeout(function() { - Entities.editEntity(splatter, { - isEmitting: false - }); - }, 100) - -} - - -function createMuzzleFlash(position) { - var smoke = Entities.addEntity({ - type: "ParticleEffect", - position: position, - lifetime: 1, - "name": "Smoke Hit Emitter", - "maxParticles": 1000, - "lifespan": 4, - "emitRate": 20, - emitSpeed: 0, - "speedSpread": 0, - "emitDimensions": { - "x": 0, - "y": 0, - "z": 0 - }, - "polarStart": 0, - "polarFinish": 0, - "azimuthStart": -3.1415927410125732, - "azimuthFinish": 3.14, - "emitAcceleration": { - "x": 0, - "y": 0.5, - "z": 0 - }, - "accelerationSpread": { - "x": .2, - "y": 0, - "z": .2 - }, - "radiusSpread": .04, - "particleRadius": 0.07, - "radiusStart": 0.07, - "radiusFinish": 0.07, - "alpha": 0.7, - "alphaSpread": 0, - "alphaStart": 0, - "alphaFinish": 0, - "additiveBlending": 0, - "textures": "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png" - }); - Script.setTimeout(function() { - Entities.editEntity(smoke, { - isEmitting: false - }); - }, 100); - - var flash = Entities.addEntity({ - type: "ParticleEffect", - position: position, - lifetime: 4, - "name": "Muzzle Flash", - "color": { - red: 228, - green: 128, - blue: 12 - }, - "maxParticles": 1000, - "lifespan": 0.1, - "emitRate": 1000, - "emitSpeed": 0.5, - "speedSpread": 0, - "emitOrientation": { - "x": -0.4, - "y": 1, - "z": -0.2, - "w": 0.7071068286895752 - }, - "emitDimensions": { - "x": 0, - "y": 0, - "z": 0 - }, - "polarStart": 0, - "polarFinish": Math.PI, - "azimuthStart": -3.1415927410125732, - "azimuthFinish": 2, - "emitAcceleration": { - "x": 0, - "y": 0, - "z": 0 - }, - "accelerationSpread": { - "x": 0, - "y": 0, - "z": 0 - }, - "particleRadius": 0.05, - "radiusSpread": 0.01, - "radiusStart": 0.05, - "radiusFinish": 0.05, - "colorSpread": { - red: 100, - green: 100, - blue: 20 - }, - "alpha": 1, - "alphaSpread": 0, - "alphaStart": 0, - "alphaFinish": 0, - "additiveBlending": true, - "textures": "http://ericrius1.github.io/PartiArt/assets/star.png" - }); - - Script.setTimeout(function() { - Entities.editEntity(flash, { - isEmitting: false - }); - }, 100) - - -} diff --git a/examples/example/games/exterminatorGame/pistolScriptSpawner.js b/examples/example/games/exterminatorGame/pistolScriptSpawner.js deleted file mode 100644 index 2a5a72096f..0000000000 --- a/examples/example/games/exterminatorGame/pistolScriptSpawner.js +++ /dev/null @@ -1,37 +0,0 @@ -// -// Rat.js -// examples/toybox/entityScripts -// -// Created by Eric Levin on11/11/15. -// Copyright 2015 High Fidelity, Inc. -// - -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -/*global print, MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, Audio, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt */ - - -(function() { - var scriptURL = Script.resolvePath('pistol.js'); - var _this; - PistolScriptSpawner = function() { - _this = this; - this.forceMultiplier = 1; - }; - - PistolScriptSpawner.prototype = { - - enterEntity: function() { - - Script.load(scriptURL); - }, - - preload: function(entityID) { - this.entityID = entityID; - }, - - }; - - // entity scripts always need to return a newly constructed object of our type - return new PistolScriptSpawner(); -}); \ No newline at end of file diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index fcade5980c..800cadf72f 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -243,7 +243,7 @@ else (APPLE) "${PROJECT_SOURCE_DIR}/resources" $/resources COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${CMAKE_SOURCE_DIR}/examples" + "${CMAKE_SOURCE_DIR}/scripts" $/scripts ) @@ -269,7 +269,7 @@ endif (APPLE) if (SCRIPTS_INSTALL_DIR) # setup install of scripts beside interface executable install( - DIRECTORY "${CMAKE_SOURCE_DIR}/examples/" + DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/" DESTINATION ${SCRIPTS_INSTALL_DIR}/scripts COMPONENT ${CLIENT_COMPONENT} ) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index a357cd879d..614f7bd9fe 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -916,7 +916,8 @@ void MyAvatar::updateLookAtTargetAvatar() { avatar->setIsLookAtTarget(false); if (!avatar->isMyAvatar() && avatar->isInitialized() && (distanceTo < GREATEST_LOOKING_AT_DISTANCE * getUniformScale())) { - float angleTo = glm::angle(lookForward, glm::normalize(avatar->getHead()->getEyePosition() - getHead()->getEyePosition())); + float radius = glm::length(avatar->getHead()->getEyePosition() - avatar->getHead()->getRightEyePosition()); + float angleTo = coneSphereAngle(getHead()->getEyePosition(), lookForward, avatar->getHead()->getEyePosition(), radius); if (angleTo < (smallestAngleTo * (isCurrentTarget ? KEEP_LOOKING_AT_CURRENT_ANGLE_FACTOR : 1.0f))) { _lookAtTargetAvatar = avatarPointer; _targetAvatarPosition = avatarPointer->getPosition(); diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 7955b20728..f3a8d3110c 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -518,6 +518,7 @@ void RenderableModelEntityItem::update(const quint64& now) { if (!_dimensionsInitialized && _model && _model->isActive()) { if (_model->isLoaded()) { EntityItemProperties properties; + properties.setLastEdited(usecTimestampNow()); // we must set the edit time since we're editing it auto extents = _model->getMeshExtents(); properties.setDimensions(extents.maximum - extents.minimum); qCDebug(entitiesrenderer) << "Autoresizing:" << (!getName().isEmpty() ? getName() : getModelURL()); diff --git a/libraries/model/src/model/Material.cpp b/libraries/model/src/model/Material.cpp index 802650df93..1ea407122f 100755 --- a/libraries/model/src/model/Material.cpp +++ b/libraries/model/src/model/Material.cpp @@ -18,13 +18,15 @@ using namespace gpu; Material::Material() : _key(0), _schemaBuffer(), + _texMapArrayBuffer(), _textureMaps() { // created from nothing: create the Buffer to store the properties Schema schema; _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema)); - + TexMapArraySchema TexMapArraySchema; + _texMapArrayBuffer = gpu::BufferView(std::make_shared(sizeof(TexMapArraySchema), (const gpu::Byte*) &TexMapArraySchema)); } Material::Material(const Material& material) : @@ -35,6 +37,10 @@ Material::Material(const Material& material) : Schema schema; _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema)); _schemaBuffer.edit() = material._schemaBuffer.get(); + + TexMapArraySchema texMapArraySchema; + _texMapArrayBuffer = gpu::BufferView(std::make_shared(sizeof(TexMapArraySchema), (const gpu::Byte*) &texMapArraySchema)); + _texMapArrayBuffer.edit() = material._texMapArrayBuffer.get(); } Material& Material::operator= (const Material& material) { @@ -46,6 +52,10 @@ Material& Material::operator= (const Material& material) { _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema)); _schemaBuffer.edit() = material._schemaBuffer.get(); + TexMapArraySchema texMapArraySchema; + _texMapArrayBuffer = gpu::BufferView(std::make_shared(sizeof(TexMapArraySchema), (const gpu::Byte*) &texMapArraySchema)); + _texMapArrayBuffer.edit() = material._texMapArrayBuffer.get(); + return (*this); } @@ -101,6 +111,15 @@ void Material::setTextureMap(MapChannel channel, const TextureMapPointer& textur if (channel == MaterialKey::ALBEDO_MAP) { resetOpacityMap(); + + // update the texcoord0 with albedo + _texMapArrayBuffer.edit()._texcoordTransforms[0] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); + } + + if (channel == MaterialKey::LIGHTMAP_MAP) { + // update the texcoord1 with lightmap + _texMapArrayBuffer.edit()._texcoordTransforms[1] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); + _texMapArrayBuffer.edit()._lightmapParams = (textureMap ? glm::vec4(textureMap->getLightmapOffsetScale(), 0.0, 0.0) : glm::vec4(0.0, 1.0, 0.0, 0.0)); } _schemaBuffer.edit()._key = (uint32)_key._flags.to_ulong(); diff --git a/libraries/model/src/model/Material.h b/libraries/model/src/model/Material.h index c500e9ec10..4cfb2120ee 100755 --- a/libraries/model/src/model/Material.h +++ b/libraries/model/src/model/Material.h @@ -298,9 +298,21 @@ public: // conversion from legacy material properties to PBR equivalent static float shininessToRoughness(float shininess) { return 1.0f - shininess / 100.0f; } + // Texture Map Array Schema + static const int NUM_TEXCOORD_TRANSFORMS{ 2 }; + class TexMapArraySchema { + public: + glm::mat4 _texcoordTransforms[NUM_TEXCOORD_TRANSFORMS]; + glm::vec4 _lightmapParams{ 0.0, 1.0, 0.0, 0.0 }; + TexMapArraySchema() {} + }; + + const UniformBufferView& getTexMapArrayBuffer() const { return _texMapArrayBuffer; } private: mutable MaterialKey _key; mutable UniformBufferView _schemaBuffer; + mutable UniformBufferView _texMapArrayBuffer; + TextureMaps _textureMaps; }; typedef std::shared_ptr< Material > MaterialPointer; diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index 5a429ff7c4..04c9df9bc5 100755 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -129,10 +129,29 @@ vec3 evalLightmappedColor(mat4 invViewMat, float shadowAttenuation, float obscur <@func declareEvalGlobalLightColor()@> -<$declareEvalSkyboxGlobalColor()$> +<$declareSkyboxMap()$> +<$declareAmbientFresnel()$> -vec3 evalGlobalLightColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, float metallic, vec3 emissive, float roughness) { - return evalSkyboxGlobalColor(invViewMat, shadowAttenuation, obscurance, position, normal, albedo, metallic, emissive, roughness); +vec3 evalSkyboxGlobalColorAlpha(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, float metallic, vec3 emissive, float roughness, float opacity) { + <$prepareGlobalLight()$> + + // Diffuse from ambient + color += (1 - metallic) * albedo * evalSphericalLight(getLightAmbientSphere(light), fragNormal).xyz * obscurance * getLightAmbientIntensity(light); + + // Specular highlight from ambient + vec3 direction = -reflect(fragEyeDir, fragNormal); + + float levels = getLightAmbientMapNumMips(light); + float lod = min(floor((roughness) * levels), levels); + vec4 skyboxLight = evalSkyboxLight(direction, lod); + vec3 ambientFresnel = fresnelSchlickAmbient(fresnel, fragEyeDir, fragNormal, 1 - roughness); + color += ambientFresnel * skyboxLight.rgb * obscurance * getLightAmbientIntensity(light) / opacity; + + return color; +} + +vec3 evalGlobalLightColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, float metallic, vec3 emissive, float roughness, float opacity) { + return evalSkyboxGlobalColorAlpha(invViewMat, shadowAttenuation, obscurance, position, normal, albedo, metallic, emissive, roughness, opacity); } <@endfunc@> diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp index 82a92f572e..550baa6946 100644 --- a/libraries/render-utils/src/GeometryCache.cpp +++ b/libraries/render-utils/src/GeometryCache.cpp @@ -506,9 +506,9 @@ GeometryCache::GeometryCache() : std::make_shared(getSimplePipeline(), nullptr, [](const render::ShapePipeline&, gpu::Batch& batch) { // Set the defaults needed for a simple program - batch.setResourceTexture(render::ShapePipeline::Slot::ALBEDO_MAP, + batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get()->getWhiteTexture()); - batch.setResourceTexture(render::ShapePipeline::Slot::NORMAL_FITTING_MAP, + batch.setResourceTexture(render::ShapePipeline::Slot::MAP::NORMAL_FITTING, DependencyManager::get()->getNormalFittingTexture()); } ); @@ -1736,11 +1736,11 @@ void GeometryCache::bindSimpleProgram(gpu::Batch& batch, bool textured, bool cul // If not textured, set a default albedo map if (!textured) { - batch.setResourceTexture(render::ShapePipeline::Slot::ALBEDO_MAP, + batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get()->getWhiteTexture()); } // Set a default normal map - batch.setResourceTexture(render::ShapePipeline::Slot::NORMAL_FITTING_MAP, + batch.setResourceTexture(render::ShapePipeline::Slot::MAP::NORMAL_FITTING, DependencyManager::get()->getNormalFittingTexture()); } @@ -1758,7 +1758,7 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool culled _emissiveShader = gpu::Shader::createProgram(VS, PSEmissive); gpu::Shader::BindingSet slotBindings; - slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), render::ShapePipeline::Slot::NORMAL_FITTING_MAP)); + slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), render::ShapePipeline::Slot::MAP::NORMAL_FITTING)); gpu::Shader::makeProgram(*_simpleShader, slotBindings); gpu::Shader::makeProgram(*_emissiveShader, slotBindings); }); diff --git a/libraries/render-utils/src/MaterialTextures.slh b/libraries/render-utils/src/MaterialTextures.slh index 34bb7c429b..512b7a533c 100644 --- a/libraries/render-utils/src/MaterialTextures.slh +++ b/libraries/render-utils/src/MaterialTextures.slh @@ -11,6 +11,39 @@ <@if not MODEL_MATERIAL_TEXTURES_SLH@> <@def MODEL_MATERIAL_TEXTURES_SLH@> + +<@func declareMaterialTexMapArrayBuffer()@> + +const int MAX_TEXCOORDS = 2; + +struct TexMapArray { + mat4 _texcoordTransforms[MAX_TEXCOORDS]; + vec4 _lightmapParams; +}; + +uniform texMapArrayBuffer { + TexMapArray _texMapArray; +}; + +TexMapArray getTexMapArray() { + return _texMapArray; +} + +<@func evalTexMapArrayTexcoord0(texMapArray, inTexcoord0, outTexcoord0)@> +{ + <$outTexcoord0$> = (<$texMapArray$>._texcoordTransforms[0] * vec4(<$inTexcoord0$>.st, 0.0, 1.0)).st; +} +<@endfunc@> + +<@func evalTexMapArrayTexcoord1(texMapArray, inTexcoord1, outTexcoord1)@> +{ + <$outTexcoord1$> = (<$texMapArray$>._texcoordTransforms[1] * vec4(<$inTexcoord1$>.st, 0.0, 1.0)).st; +} +<@endfunc@> + +<@endfunc@> + + <@func declareMaterialTextures(withAlbedo, withRoughness, withNormal, withMetallic, withEmissive, withOcclusion)@> <@if withAlbedo@> @@ -80,9 +113,12 @@ float fetchOcclusionMap(vec2 uv) { <@func declareMaterialLightmap()@> + +<$declareMaterialTexMapArrayBuffer()$> + uniform sampler2D emissiveMap; -uniform vec2 emissiveParams; vec3 fetchLightmapMap(vec2 uv) { + vec2 emissiveParams = getTexMapArray()._lightmapParams.xy; return (vec3(emissiveParams.x) + emissiveParams.y * texture(emissiveMap, uv).rgb); } <@endfunc@> diff --git a/libraries/render-utils/src/MeshPartPayload.cpp b/libraries/render-utils/src/MeshPartPayload.cpp index a273d92112..03c1ac9eda 100644 --- a/libraries/render-utils/src/MeshPartPayload.cpp +++ b/libraries/render-utils/src/MeshPartPayload.cpp @@ -138,82 +138,78 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat auto textureCache = DependencyManager::get(); - batch.setUniformBuffer(ShapePipeline::Slot::MATERIAL_GPU, _drawMaterial->getSchemaBuffer()); + batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::MATERIAL, _drawMaterial->getSchemaBuffer()); + batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::TEXMAPARRAY, _drawMaterial->getTexMapArrayBuffer()); auto materialKey = _drawMaterial->getKey(); auto textureMaps = _drawMaterial->getTextureMaps(); - glm::mat4 texcoordTransform[2]; // Albedo if (materialKey.isAlbedoMap()) { auto albedoMap = textureMaps[model::MaterialKey::ALBEDO_MAP]; if (albedoMap && albedoMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::ALBEDO_MAP, albedoMap->getTextureView()); - - if (!albedoMap->getTextureTransform().isIdentity()) { - albedoMap->getTextureTransform().getMatrix(texcoordTransform[0]); - } + batch.setResourceTexture(ShapePipeline::Slot::ALBEDO, albedoMap->getTextureView()); } else { - batch.setResourceTexture(ShapePipeline::Slot::ALBEDO_MAP, textureCache->getGrayTexture()); + batch.setResourceTexture(ShapePipeline::Slot::ALBEDO, textureCache->getGrayTexture()); } } else { - batch.setResourceTexture(ShapePipeline::Slot::ALBEDO_MAP, textureCache->getWhiteTexture()); + batch.setResourceTexture(ShapePipeline::Slot::ALBEDO, textureCache->getWhiteTexture()); } // Roughness map if (materialKey.isRoughnessMap()) { auto roughnessMap = textureMaps[model::MaterialKey::ROUGHNESS_MAP]; if (roughnessMap && roughnessMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::ROUGHNESS_MAP, roughnessMap->getTextureView()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::ROUGHNESS, roughnessMap->getTextureView()); // texcoord are assumed to be the same has albedo } else { - batch.setResourceTexture(ShapePipeline::Slot::ROUGHNESS_MAP, textureCache->getWhiteTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::ROUGHNESS, textureCache->getWhiteTexture()); } } else { - batch.setResourceTexture(ShapePipeline::Slot::ROUGHNESS_MAP, textureCache->getWhiteTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::ROUGHNESS, textureCache->getWhiteTexture()); } // Normal map if (materialKey.isNormalMap()) { auto normalMap = textureMaps[model::MaterialKey::NORMAL_MAP]; if (normalMap && normalMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::NORMAL_MAP, normalMap->getTextureView()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::NORMAL, normalMap->getTextureView()); // texcoord are assumed to be the same has albedo } else { - batch.setResourceTexture(ShapePipeline::Slot::NORMAL_MAP, textureCache->getBlueTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::NORMAL, textureCache->getBlueTexture()); } } else { - batch.setResourceTexture(ShapePipeline::Slot::NORMAL_MAP, nullptr); + batch.setResourceTexture(ShapePipeline::Slot::MAP::NORMAL, nullptr); } // Metallic map if (materialKey.isMetallicMap()) { auto specularMap = textureMaps[model::MaterialKey::METALLIC_MAP]; if (specularMap && specularMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::METALLIC_MAP, specularMap->getTextureView()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::METALLIC, specularMap->getTextureView()); // texcoord are assumed to be the same has albedo } else { - batch.setResourceTexture(ShapePipeline::Slot::METALLIC_MAP, textureCache->getBlackTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::METALLIC, textureCache->getBlackTexture()); } } else { - batch.setResourceTexture(ShapePipeline::Slot::METALLIC_MAP, nullptr); + batch.setResourceTexture(ShapePipeline::Slot::MAP::METALLIC, nullptr); } // Occlusion map if (materialKey.isOcclusionMap()) { auto specularMap = textureMaps[model::MaterialKey::OCCLUSION_MAP]; if (specularMap && specularMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::OCCLUSION_MAP, specularMap->getTextureView()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::OCCLUSION, specularMap->getTextureView()); // texcoord are assumed to be the same has albedo } else { - batch.setResourceTexture(ShapePipeline::Slot::OCCLUSION_MAP, textureCache->getWhiteTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::OCCLUSION, textureCache->getWhiteTexture()); } } else { - batch.setResourceTexture(ShapePipeline::Slot::OCCLUSION_MAP, nullptr); + batch.setResourceTexture(ShapePipeline::Slot::MAP::OCCLUSION, nullptr); } // Emissive / Lightmap @@ -221,33 +217,20 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat auto lightmapMap = textureMaps[model::MaterialKey::LIGHTMAP_MAP]; if (lightmapMap && lightmapMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, lightmapMap->getTextureView()); - - auto lightmapOffsetScale = lightmapMap->getLightmapOffsetScale(); - batch._glUniform2f(locations->emissiveParams, lightmapOffsetScale.x, lightmapOffsetScale.y); - - if (!lightmapMap->getTextureTransform().isIdentity()) { - lightmapMap->getTextureTransform().getMatrix(texcoordTransform[1]); - } + batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, lightmapMap->getTextureView()); } else { - batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, textureCache->getGrayTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, textureCache->getGrayTexture()); } } else if (materialKey.isEmissiveMap()) { auto emissiveMap = textureMaps[model::MaterialKey::EMISSIVE_MAP]; if (emissiveMap && emissiveMap->isDefined()) { - batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, emissiveMap->getTextureView()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, emissiveMap->getTextureView()); } else { - batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, textureCache->getBlackTexture()); + batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, textureCache->getBlackTexture()); } } else { - batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, nullptr); - } - - // Texcoord transforms ? - if (locations->texcoordMatrices >= 0) { - batch._glUniformMatrix4fv(locations->texcoordMatrices, 2, false, (const float*)&texcoordTransform); - // batch._glUniformMatrix4fv(locations->texcoordMatrices, (materialKey.isLightmapMap() ? 2 : 1), false, (const float*)&texcoordTransform); + batch.setResourceTexture(ShapePipeline::Slot::MAP::EMISSIVE_LIGHTMAP, nullptr); } } @@ -491,9 +474,9 @@ void ModelMeshPartPayload::bindTransform(gpu::Batch& batch, const ShapePipeline: Transform transform; if (state.clusterBuffer) { if (canCauterize && _model->getCauterizeBones()) { - batch.setUniformBuffer(ShapePipeline::Slot::SKINNING_GPU, state.cauterizedClusterBuffer); + batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::SKINNING, state.cauterizedClusterBuffer); } else { - batch.setUniformBuffer(ShapePipeline::Slot::SKINNING_GPU, state.clusterBuffer); + batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::SKINNING, state.clusterBuffer); } } else { if (canCauterize && _model->getCauterizeBones()) { diff --git a/libraries/render-utils/src/RenderPipelines.cpp b/libraries/render-utils/src/RenderPipelines.cpp index 4452872108..ada5a66c39 100644 --- a/libraries/render-utils/src/RenderPipelines.cpp +++ b/libraries/render-utils/src/RenderPipelines.cpp @@ -75,20 +75,16 @@ gpu::BufferView getDefaultMaterialBuffer() { void batchSetter(const ShapePipeline& pipeline, gpu::Batch& batch) { // Set a default albedo map - batch.setResourceTexture(render::ShapePipeline::Slot::ALBEDO_MAP, + batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get()->getWhiteTexture()); // Set a default normal map - batch.setResourceTexture(render::ShapePipeline::Slot::NORMAL_FITTING_MAP, + batch.setResourceTexture(render::ShapePipeline::Slot::MAP::NORMAL_FITTING, DependencyManager::get()->getNormalFittingTexture()); - // Set default coordinates - if (pipeline.locations->texcoordMatrices >= 0) { - static const glm::mat4 TEX_COORDS[2]; - batch._glUniformMatrix4fv(pipeline.locations->texcoordMatrices, 2, false, (const float*)&TEX_COORDS); - } + // Set a default material if (pipeline.locations->materialBufferUnit >= 0) { static const gpu::BufferView OPAQUE_SCHEMA_BUFFER = getDefaultMaterialBuffer(); - batch.setUniformBuffer(ShapePipeline::Slot::MATERIAL_GPU, OPAQUE_SCHEMA_BUFFER); + batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::MATERIAL, OPAQUE_SCHEMA_BUFFER); } } diff --git a/libraries/render-utils/src/Skinning.slh b/libraries/render-utils/src/Skinning.slh index 63992c35ad..687dab536b 100644 --- a/libraries/render-utils/src/Skinning.slh +++ b/libraries/render-utils/src/Skinning.slh @@ -11,7 +11,6 @@ <@if not SKINNING_SLH@> <@def SKINNING_SLH@> -const int MAX_TEXCOORDS = 2; const int MAX_CLUSTERS = 128; const int INDICES_PER_VERTEX = 4; diff --git a/libraries/render-utils/src/model.slv b/libraries/render-utils/src/model.slv index 0507f1c6c5..f1989dcf76 100755 --- a/libraries/render-utils/src/model.slv +++ b/libraries/render-utils/src/model.slv @@ -16,8 +16,8 @@ <@include gpu/Transform.slh@> <$declareStandardTransform()$> -const int MAX_TEXCOORDS = 2; -uniform mat4 texcoordMatrices[MAX_TEXCOORDS]; +<@include MaterialTextures.slh@> +<$declareMaterialTexMapArrayBuffer()$> out vec3 _color; out float _alpha; @@ -29,7 +29,8 @@ void main(void) { _color = colorToLinearRGB(inColor.xyz); _alpha = inColor.w; - _texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.st, 0.0, 1.0)).st; + TexMapArray texMapArray = getTexMapArray(); + <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> // standard transform TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/model_lightmap.slf b/libraries/render-utils/src/model_lightmap.slf index 46d81d39e1..3afbbfd405 100755 --- a/libraries/render-utils/src/model_lightmap.slf +++ b/libraries/render-utils/src/model_lightmap.slf @@ -30,7 +30,7 @@ void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); <$fetchMaterialTextures(matKey, _texCoord0, albedo, roughness)$> - <$fetchMaterialLightmap(_texCoord1, emissive)$> + <$fetchMaterialLightmap(_texCoord1, lightmapVal)$> packDeferredFragmentLightmap( @@ -40,5 +40,5 @@ void main(void) { getMaterialRoughness(mat) * roughness, getMaterialMetallic(mat), getMaterialFresnel(mat), - (vec3(emissiveParams.x) + emissiveParams.y * emissive.rgb)); + lightmapVal); } diff --git a/libraries/render-utils/src/model_lightmap.slv b/libraries/render-utils/src/model_lightmap.slv index 8696b70373..f73b6a02a7 100755 --- a/libraries/render-utils/src/model_lightmap.slv +++ b/libraries/render-utils/src/model_lightmap.slv @@ -17,9 +17,8 @@ <@include gpu/Transform.slh@> <$declareStandardTransform()$> -const int MAX_TEXCOORDS = 2; - -uniform mat4 texcoordMatrices[MAX_TEXCOORDS]; +<@include MaterialTextures.slh@> +<$declareMaterialTexMapArrayBuffer()$> out vec4 _position; out vec2 _texCoord0; @@ -32,8 +31,9 @@ void main(void) { _color = colorToLinearRGB(inColor.xyz); // and the texture coordinates - _texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.st, 0.0, 1.0)).st; - _texCoord1 = (texcoordMatrices[1] * vec4(inTexCoord1.st, 0.0, 1.0)).st; + TexMapArray texMapArray = getTexMapArray(); + <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + <$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord1)$> // standard transform TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/model_lightmap_normal_map.slv b/libraries/render-utils/src/model_lightmap_normal_map.slv index eb8f80656d..cb333f50e3 100755 --- a/libraries/render-utils/src/model_lightmap_normal_map.slv +++ b/libraries/render-utils/src/model_lightmap_normal_map.slv @@ -17,9 +17,8 @@ <@include gpu/Transform.slh@> <$declareStandardTransform()$> -const int MAX_TEXCOORDS = 2; - -uniform mat4 texcoordMatrices[MAX_TEXCOORDS]; +<@include MaterialTextures.slh@> +<$declareMaterialTexMapArrayBuffer()$> out vec4 _position; out vec2 _texCoord0; @@ -32,9 +31,9 @@ void main(void) { // pass along the color in linear space _color = colorToLinearRGB(inColor.xyz); - // and the texture coordinates - _texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.st, 0.0, 1.0)).st; - _texCoord1 = (texcoordMatrices[1] * vec4(inTexCoord1.st, 0.0, 1.0)).st; + TexMapArray texMapArray = getTexMapArray(); + <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + <$evalTexMapArrayTexcoord1(texMapArray, inTexCoord1, _texCoord1)$> // standard transform TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/model_normal_map.slv b/libraries/render-utils/src/model_normal_map.slv index 4f45902dae..ded37923c2 100755 --- a/libraries/render-utils/src/model_normal_map.slv +++ b/libraries/render-utils/src/model_normal_map.slv @@ -17,9 +17,8 @@ <@include gpu/Transform.slh@> <$declareStandardTransform()$> -const int MAX_TEXCOORDS = 2; - -uniform mat4 texcoordMatrices[MAX_TEXCOORDS]; +<@include MaterialTextures.slh@> +<$declareMaterialTexMapArrayBuffer()$> out vec4 _position; out vec2 _texCoord0; @@ -33,8 +32,8 @@ void main(void) { _color = colorToLinearRGB(inColor.rgb); _alpha = inColor.a; - // and the texture coordinates - _texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.xy, 0.0, 1.0)).st; + TexMapArray texMapArray = getTexMapArray(); + <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> // standard transform TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/model_translucent.slf b/libraries/render-utils/src/model_translucent.slf index f70d922a67..2bd49345ee 100755 --- a/libraries/render-utils/src/model_translucent.slf +++ b/libraries/render-utils/src/model_translucent.slf @@ -59,7 +59,7 @@ void main(void) { TransformCamera cam = getTransformCamera(); - _fragColor = vec4(evalSkyboxGlobalColor( + _fragColor = vec4(evalGlobalLightColor( cam._viewInverse, 1.0, 1.0, @@ -68,6 +68,6 @@ void main(void) { albedo, metallic, emissive, - roughness), + roughness, opacity), opacity); } diff --git a/libraries/render-utils/src/skin_model.slv b/libraries/render-utils/src/skin_model.slv index e5d1857d44..c8501b8ddf 100755 --- a/libraries/render-utils/src/skin_model.slv +++ b/libraries/render-utils/src/skin_model.slv @@ -19,7 +19,8 @@ <@include Skinning.slh@> -uniform mat4 texcoordMatrices[MAX_TEXCOORDS]; +<@include MaterialTextures.slh@> +<$declareMaterialTexMapArrayBuffer()$> out vec4 _position; out vec2 _texCoord0; @@ -37,9 +38,9 @@ void main(void) { _color = colorToLinearRGB(inColor.rgb); _alpha = inColor.a; - // and the texture coordinates - _texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.st, 0.0, 1.0)).st; - + TexMapArray texMapArray = getTexMapArray(); + <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + // standard transform TransformCamera cam = getTransformCamera(); TransformObject obj = getTransformObject(); diff --git a/libraries/render-utils/src/skin_model_normal_map.slv b/libraries/render-utils/src/skin_model_normal_map.slv index 5348ad5234..db4b206405 100755 --- a/libraries/render-utils/src/skin_model_normal_map.slv +++ b/libraries/render-utils/src/skin_model_normal_map.slv @@ -19,7 +19,8 @@ <@include Skinning.slh@> -uniform mat4 texcoordMatrices[MAX_TEXCOORDS]; +<@include MaterialTextures.slh@> +<$declareMaterialTexMapArrayBuffer()$> out vec4 _position; out vec2 _texCoord0; @@ -39,9 +40,9 @@ void main(void) { _color = colorToLinearRGB(inColor.rgb); _alpha = inColor.a; - // and the texture coordinates - _texCoord0 = (texcoordMatrices[0] * vec4(inTexCoord0.st, 0.0, 1.0)).st; - + TexMapArray texMapArray = getTexMapArray(); + <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0); interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0); diff --git a/libraries/render/src/render/ShapePipeline.cpp b/libraries/render/src/render/ShapePipeline.cpp index 766d899465..a16847fddf 100644 --- a/libraries/render/src/render/ShapePipeline.cpp +++ b/libraries/render/src/render/ShapePipeline.cpp @@ -51,23 +51,22 @@ void ShapePlumber::addPipeline(const Key& key, const gpu::ShaderPointer& program void ShapePlumber::addPipeline(const Filter& filter, const gpu::ShaderPointer& program, const gpu::StatePointer& state, BatchSetter batchSetter) { gpu::Shader::BindingSet slotBindings; - slotBindings.insert(gpu::Shader::Binding(std::string("skinClusterBuffer"), Slot::SKINNING_GPU)); - slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), Slot::MATERIAL_GPU)); - slotBindings.insert(gpu::Shader::Binding(std::string("albedoMap"), Slot::ALBEDO_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("roughnessMap"), Slot::ROUGHNESS_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("normalMap"), Slot::NORMAL_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("metallicMap"), Slot::METALLIC_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("emissiveMap"), Slot::EMISSIVE_LIGHTMAP_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("occlusionMap"), Slot::OCCLUSION_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("lightBuffer"), Slot::LIGHT_BUFFER)); - slotBindings.insert(gpu::Shader::Binding(std::string("skyboxMap"), Slot::LIGHT_AMBIENT_MAP)); - slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), Slot::NORMAL_FITTING_MAP)); + slotBindings.insert(gpu::Shader::Binding(std::string("skinClusterBuffer"), Slot::BUFFER::SKINNING)); + slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), Slot::BUFFER::MATERIAL)); + slotBindings.insert(gpu::Shader::Binding(std::string("texMapArrayBuffer"), Slot::BUFFER::TEXMAPARRAY)); + slotBindings.insert(gpu::Shader::Binding(std::string("albedoMap"), Slot::MAP::ALBEDO)); + slotBindings.insert(gpu::Shader::Binding(std::string("roughnessMap"), Slot::MAP::ROUGHNESS)); + slotBindings.insert(gpu::Shader::Binding(std::string("normalMap"), Slot::MAP::NORMAL)); + slotBindings.insert(gpu::Shader::Binding(std::string("metallicMap"), Slot::MAP::METALLIC)); + slotBindings.insert(gpu::Shader::Binding(std::string("emissiveMap"), Slot::MAP::EMISSIVE_LIGHTMAP)); + slotBindings.insert(gpu::Shader::Binding(std::string("occlusionMap"), Slot::MAP::OCCLUSION)); + slotBindings.insert(gpu::Shader::Binding(std::string("lightBuffer"), Slot::BUFFER::LIGHT)); + slotBindings.insert(gpu::Shader::Binding(std::string("skyboxMap"), Slot::MAP::LIGHT_AMBIENT)); + slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), Slot::NORMAL_FITTING)); gpu::Shader::makeProgram(*program, slotBindings); auto locations = std::make_shared(); - locations->texcoordMatrices = program->getUniforms().findLocation("texcoordMatrices"); - locations->emissiveParams = program->getUniforms().findLocation("emissiveParams"); locations->normalFittingMapUnit = program->getTextures().findLocation("normalFittingMap"); locations->albedoTextureUnit = program->getTextures().findLocation("albedoMap"); locations->roughnessTextureUnit = program->getTextures().findLocation("roughnessMap"); @@ -77,8 +76,9 @@ void ShapePlumber::addPipeline(const Filter& filter, const gpu::ShaderPointer& p locations->occlusionTextureUnit = program->getTextures().findLocation("occlusionMap"); locations->skinClusterBufferUnit = program->getBuffers().findLocation("skinClusterBuffer"); locations->materialBufferUnit = program->getBuffers().findLocation("materialBuffer"); + locations->texMapArrayBufferUnit = program->getBuffers().findLocation("texMapArrayBuffer"); locations->lightBufferUnit = program->getBuffers().findLocation("lightBuffer"); - locations->lightAmbientMapUnit = program->getBuffers().findLocation("skyboxMap"); + locations->lightAmbientMapUnit = program->getTextures().findLocation("skyboxMap"); ShapeKey key{filter._flags}; auto gpuPipeline = gpu::Pipeline::create(program, state); diff --git a/libraries/render/src/render/ShapePipeline.h b/libraries/render/src/render/ShapePipeline.h index 876e056a9a..af1b05f5c0 100644 --- a/libraries/render/src/render/ShapePipeline.h +++ b/libraries/render/src/render/ShapePipeline.h @@ -193,33 +193,38 @@ class ShapePipeline { public: class Slot { public: - static const int SKINNING_GPU = 2; - static const int MATERIAL_GPU = 3; - static const int ALBEDO_MAP = 0; - static const int NORMAL_MAP = 1; - static const int METALLIC_MAP = 2; - static const int EMISSIVE_LIGHTMAP_MAP = 3; - static const int ROUGHNESS_MAP = 4; - static const int OCCLUSION_MAP = 5; + enum BUFFER { + SKINNING = 2, + MATERIAL, + TEXMAPARRAY, + LIGHT + }; - static const int LIGHT_BUFFER = 4; - static const int LIGHT_AMBIENT_MAP = 6; - static const int NORMAL_FITTING_MAP = 10; + enum MAP { + ALBEDO = 0, + NORMAL, + METALLIC, + EMISSIVE_LIGHTMAP, + ROUGHNESS, + OCCLUSION, + LIGHT_AMBIENT, + + NORMAL_FITTING = 10, + }; }; class Locations { public: - int texcoordMatrices; int albedoTextureUnit; int normalTextureUnit; int roughnessTextureUnit; int metallicTextureUnit; int emissiveTextureUnit; int occlusionTextureUnit; - int emissiveParams; int normalFittingMapUnit; int skinClusterBufferUnit; int materialBufferUnit; + int texMapArrayBufferUnit; int lightBufferUnit; int lightAmbientMapUnit; }; diff --git a/libraries/shared/src/GPUIdent.cpp b/libraries/shared/src/GPUIdent.cpp index 917020d223..19838964a4 100644 --- a/libraries/shared/src/GPUIdent.cpp +++ b/libraries/shared/src/GPUIdent.cpp @@ -147,7 +147,7 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer) _isValid = true; } - hr = spEnumInst->Next(WBEM_INFINITE, 1, &spInstance, &uNumOfInstances); + hr = spEnumInst->Next(WBEM_INFINITE, 1, &spInstance.p, &uNumOfInstances); } #endif return this; diff --git a/libraries/shared/src/GeometryUtil.cpp b/libraries/shared/src/GeometryUtil.cpp index 96c4d3bdea..92fe138021 100644 --- a/libraries/shared/src/GeometryUtil.cpp +++ b/libraries/shared/src/GeometryUtil.cpp @@ -564,3 +564,17 @@ void swingTwistDecomposition(const glm::quat& rotation, // rotation = swing * twist --> swing = rotation * invTwist swing = rotation * glm::inverse(twist); } + +// calculate the minimum angle between a point and a sphere. +float coneSphereAngle(const glm::vec3& coneCenter, const glm::vec3& coneDirection, const glm::vec3& sphereCenter, float sphereRadius) { + glm::vec3 d = sphereCenter - coneCenter; + float dLen = glm::length(d); + + // theta is the angle between the coneDirection normal and the center of the sphere. + float theta = acosf(glm::dot(d, coneDirection) / dLen); + + // phi is the deflection angle from the center of the sphere to a point tangent to the sphere. + float phi = atanf(sphereRadius / dLen); + + return glm::max(0.0f, theta - phi); +} diff --git a/libraries/shared/src/GeometryUtil.h b/libraries/shared/src/GeometryUtil.h index 7224aaacff..a66b16b0fd 100644 --- a/libraries/shared/src/GeometryUtil.h +++ b/libraries/shared/src/GeometryUtil.h @@ -110,6 +110,8 @@ bool doLineSegmentsIntersect(glm::vec2 r1p1, glm::vec2 r1p2, glm::vec2 r2p1, glm bool isOnSegment(float xi, float yi, float xj, float yj, float xk, float yk); int computeDirection(float xi, float yi, float xj, float yj, float xk, float yk); +// calculate the angle between a point on a sphere that is closest to the cone. +float coneSphereAngle(const glm::vec3& coneCenter, const glm::vec3& coneDirection, const glm::vec3& sphereCenter, float sphereRadius); typedef glm::vec2 LineSegment2[2]; diff --git a/examples/FlockOfFish.js b/script-archive/FlockOfFish.js similarity index 100% rename from examples/FlockOfFish.js rename to script-archive/FlockOfFish.js diff --git a/examples/FlockOfbirds.js b/script-archive/FlockOfbirds.js similarity index 100% rename from examples/FlockOfbirds.js rename to script-archive/FlockOfbirds.js diff --git a/examples/acScripts/AgentPoolController.js b/script-archive/acScripts/AgentPoolController.js similarity index 100% rename from examples/acScripts/AgentPoolController.js rename to script-archive/acScripts/AgentPoolController.js diff --git a/examples/acScripts/ControlACs.js b/script-archive/acScripts/ControlACs.js similarity index 100% rename from examples/acScripts/ControlACs.js rename to script-archive/acScripts/ControlACs.js diff --git a/examples/acScripts/ControlledAC.js b/script-archive/acScripts/ControlledAC.js similarity index 100% rename from examples/acScripts/ControlledAC.js rename to script-archive/acScripts/ControlledAC.js diff --git a/examples/acScripts/PlayRecordingOnAC.js b/script-archive/acScripts/PlayRecordingOnAC.js similarity index 100% rename from examples/acScripts/PlayRecordingOnAC.js rename to script-archive/acScripts/PlayRecordingOnAC.js diff --git a/examples/acScripts/ambiance.js b/script-archive/acScripts/ambiance.js similarity index 100% rename from examples/acScripts/ambiance.js rename to script-archive/acScripts/ambiance.js diff --git a/examples/acScripts/animatedAvatarAgent.js b/script-archive/acScripts/animatedAvatarAgent.js similarity index 100% rename from examples/acScripts/animatedAvatarAgent.js rename to script-archive/acScripts/animatedAvatarAgent.js diff --git a/examples/acScripts/botProceduralWayPoints.js b/script-archive/acScripts/botProceduralWayPoints.js similarity index 100% rename from examples/acScripts/botProceduralWayPoints.js rename to script-archive/acScripts/botProceduralWayPoints.js diff --git a/examples/acScripts/bot_randomExpression.js b/script-archive/acScripts/bot_randomExpression.js similarity index 100% rename from examples/acScripts/bot_randomExpression.js rename to script-archive/acScripts/bot_randomExpression.js diff --git a/examples/acScripts/entitySpawnerAC.js b/script-archive/acScripts/entitySpawnerAC.js similarity index 100% rename from examples/acScripts/entitySpawnerAC.js rename to script-archive/acScripts/entitySpawnerAC.js diff --git a/examples/acScripts/playbackAgents.js b/script-archive/acScripts/playbackAgents.js similarity index 100% rename from examples/acScripts/playbackAgents.js rename to script-archive/acScripts/playbackAgents.js diff --git a/examples/acScripts/playbackMaster.js b/script-archive/acScripts/playbackMaster.js similarity index 100% rename from examples/acScripts/playbackMaster.js rename to script-archive/acScripts/playbackMaster.js diff --git a/examples/acScripts/proceduralAnimationAPI.js b/script-archive/acScripts/proceduralAnimationAPI.js similarity index 100% rename from examples/acScripts/proceduralAnimationAPI.js rename to script-archive/acScripts/proceduralAnimationAPI.js diff --git a/examples/acScripts/rain.js b/script-archive/acScripts/rain.js similarity index 100% rename from examples/acScripts/rain.js rename to script-archive/acScripts/rain.js diff --git a/examples/acScripts/triggeredRecordingOnAC.js b/script-archive/acScripts/triggeredRecordingOnAC.js similarity index 100% rename from examples/acScripts/triggeredRecordingOnAC.js rename to script-archive/acScripts/triggeredRecordingOnAC.js diff --git a/examples/afk.js b/script-archive/afk.js similarity index 100% rename from examples/afk.js rename to script-archive/afk.js diff --git a/examples/airship/airship.js b/script-archive/airship/airship.js similarity index 100% rename from examples/airship/airship.js rename to script-archive/airship/airship.js diff --git a/examples/airship/makeAirship.js b/script-archive/airship/makeAirship.js similarity index 100% rename from examples/airship/makeAirship.js rename to script-archive/airship/makeAirship.js diff --git a/examples/animationPerfTest.js b/script-archive/animationPerfTest.js similarity index 100% rename from examples/animationPerfTest.js rename to script-archive/animationPerfTest.js diff --git a/examples/audioExamples/acAudioSearching/ACAudioSearchAndInject.js b/script-archive/audioExamples/acAudioSearching/ACAudioSearchAndInject.js similarity index 100% rename from examples/audioExamples/acAudioSearching/ACAudioSearchAndInject.js rename to script-archive/audioExamples/acAudioSearching/ACAudioSearchAndInject.js diff --git a/examples/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js b/script-archive/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js similarity index 100% rename from examples/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js rename to script-archive/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js diff --git a/examples/audioExamples/injectorLoadTest.js b/script-archive/audioExamples/injectorLoadTest.js similarity index 100% rename from examples/audioExamples/injectorLoadTest.js rename to script-archive/audioExamples/injectorLoadTest.js diff --git a/examples/avatarMover/avatarMover.js b/script-archive/avatarMover/avatarMover.js similarity index 100% rename from examples/avatarMover/avatarMover.js rename to script-archive/avatarMover/avatarMover.js diff --git a/examples/avatarMover/avatarMoverSpawner.js b/script-archive/avatarMover/avatarMoverSpawner.js similarity index 100% rename from examples/avatarMover/avatarMoverSpawner.js rename to script-archive/avatarMover/avatarMoverSpawner.js diff --git a/examples/avatarSelector.js b/script-archive/avatarSelector.js similarity index 100% rename from examples/avatarSelector.js rename to script-archive/avatarSelector.js diff --git a/examples/baseball/assets.json b/script-archive/baseball/assets.json similarity index 100% rename from examples/baseball/assets.json rename to script-archive/baseball/assets.json diff --git a/examples/baseball/baseballCrowd.js b/script-archive/baseball/baseballCrowd.js similarity index 100% rename from examples/baseball/baseballCrowd.js rename to script-archive/baseball/baseballCrowd.js diff --git a/examples/baseball/bat.js b/script-archive/baseball/bat.js similarity index 100% rename from examples/baseball/bat.js rename to script-archive/baseball/bat.js diff --git a/examples/baseball/createBatButton.js b/script-archive/baseball/createBatButton.js similarity index 100% rename from examples/baseball/createBatButton.js rename to script-archive/baseball/createBatButton.js diff --git a/examples/baseball/firework.js b/script-archive/baseball/firework.js similarity index 100% rename from examples/baseball/firework.js rename to script-archive/baseball/firework.js diff --git a/examples/baseball/line.js b/script-archive/baseball/line.js similarity index 100% rename from examples/baseball/line.js rename to script-archive/baseball/line.js diff --git a/examples/baseball/pitching.js b/script-archive/baseball/pitching.js similarity index 100% rename from examples/baseball/pitching.js rename to script-archive/baseball/pitching.js diff --git a/examples/baseball/utils.js b/script-archive/baseball/utils.js similarity index 100% rename from examples/baseball/utils.js rename to script-archive/baseball/utils.js diff --git a/examples/blockWorld.js b/script-archive/blockWorld.js similarity index 100% rename from examples/blockWorld.js rename to script-archive/blockWorld.js diff --git a/examples/blocks.js b/script-archive/blocks.js similarity index 100% rename from examples/blocks.js rename to script-archive/blocks.js diff --git a/examples/breakdanceCore.js b/script-archive/breakdanceCore.js similarity index 100% rename from examples/breakdanceCore.js rename to script-archive/breakdanceCore.js diff --git a/examples/breakdanceToy.js b/script-archive/breakdanceToy.js similarity index 100% rename from examples/breakdanceToy.js rename to script-archive/breakdanceToy.js diff --git a/examples/controlPanel.js b/script-archive/controlPanel.js similarity index 100% rename from examples/controlPanel.js rename to script-archive/controlPanel.js diff --git a/examples/controllers/RealSense/realsenseHands.js b/script-archive/controllers/RealSense/realsenseHands.js similarity index 100% rename from examples/controllers/RealSense/realsenseHands.js rename to script-archive/controllers/RealSense/realsenseHands.js diff --git a/examples/controllers/Spacemouse/spacemouseExample.js b/script-archive/controllers/Spacemouse/spacemouseExample.js similarity index 100% rename from examples/controllers/Spacemouse/spacemouseExample.js rename to script-archive/controllers/Spacemouse/spacemouseExample.js diff --git a/examples/controllers/controllerMappings.js b/script-archive/controllers/controllerMappings.js similarity index 100% rename from examples/controllers/controllerMappings.js rename to script-archive/controllers/controllerMappings.js diff --git a/examples/controllers/gamepad/gamepad.js b/script-archive/controllers/gamepad/gamepad.js similarity index 100% rename from examples/controllers/gamepad/gamepad.js rename to script-archive/controllers/gamepad/gamepad.js diff --git a/examples/controllers/getHUDLookAtPositionTest.js b/script-archive/controllers/getHUDLookAtPositionTest.js similarity index 100% rename from examples/controllers/getHUDLookAtPositionTest.js rename to script-archive/controllers/getHUDLookAtPositionTest.js diff --git a/examples/controllers/handPosesDebug.js b/script-archive/controllers/handPosesDebug.js similarity index 100% rename from examples/controllers/handPosesDebug.js rename to script-archive/controllers/handPosesDebug.js diff --git a/examples/controllers/hydra/airGuitar.js b/script-archive/controllers/hydra/airGuitar.js similarity index 100% rename from examples/controllers/hydra/airGuitar.js rename to script-archive/controllers/hydra/airGuitar.js diff --git a/examples/controllers/hydra/drumStick.js b/script-archive/controllers/hydra/drumStick.js similarity index 100% rename from examples/controllers/hydra/drumStick.js rename to script-archive/controllers/hydra/drumStick.js diff --git a/examples/controllers/hydra/frisbee.js b/script-archive/controllers/hydra/frisbee.js similarity index 100% rename from examples/controllers/hydra/frisbee.js rename to script-archive/controllers/hydra/frisbee.js diff --git a/examples/controllers/hydra/gun.js b/script-archive/controllers/hydra/gun.js similarity index 100% rename from examples/controllers/hydra/gun.js rename to script-archive/controllers/hydra/gun.js diff --git a/examples/controllers/hydra/laserPointer.js b/script-archive/controllers/hydra/laserPointer.js similarity index 100% rename from examples/controllers/hydra/laserPointer.js rename to script-archive/controllers/hydra/laserPointer.js diff --git a/examples/controllers/hydra/paddleBall.js b/script-archive/controllers/hydra/paddleBall.js similarity index 100% rename from examples/controllers/hydra/paddleBall.js rename to script-archive/controllers/hydra/paddleBall.js diff --git a/examples/controllers/hydra/toyball.js b/script-archive/controllers/hydra/toyball.js similarity index 100% rename from examples/controllers/hydra/toyball.js rename to script-archive/controllers/hydra/toyball.js diff --git a/examples/controllers/leap/laserPointer.js b/script-archive/controllers/leap/laserPointer.js similarity index 100% rename from examples/controllers/leap/laserPointer.js rename to script-archive/controllers/leap/laserPointer.js diff --git a/examples/controllers/leap/leapHands.js b/script-archive/controllers/leap/leapHands.js similarity index 100% rename from examples/controllers/leap/leapHands.js rename to script-archive/controllers/leap/leapHands.js diff --git a/examples/controllers/leap/leapOfFaith.js b/script-archive/controllers/leap/leapOfFaith.js similarity index 100% rename from examples/controllers/leap/leapOfFaith.js rename to script-archive/controllers/leap/leapOfFaith.js diff --git a/examples/controllers/neuron/neuronAvatar.js b/script-archive/controllers/neuron/neuronAvatar.js similarity index 100% rename from examples/controllers/neuron/neuronAvatar.js rename to script-archive/controllers/neuron/neuronAvatar.js diff --git a/examples/controllers/oculus/goTo.js b/script-archive/controllers/oculus/goTo.js similarity index 100% rename from examples/controllers/oculus/goTo.js rename to script-archive/controllers/oculus/goTo.js diff --git a/examples/controllers/oculus/virtualKeyboardTextEntityExample.js b/script-archive/controllers/oculus/virtualKeyboardTextEntityExample.js similarity index 100% rename from examples/controllers/oculus/virtualKeyboardTextEntityExample.js rename to script-archive/controllers/oculus/virtualKeyboardTextEntityExample.js diff --git a/examples/controllers/philipsVersion.js b/script-archive/controllers/philipsVersion.js similarity index 100% rename from examples/controllers/philipsVersion.js rename to script-archive/controllers/philipsVersion.js diff --git a/examples/controllers/proceduralHandPoseExample.js b/script-archive/controllers/proceduralHandPoseExample.js similarity index 100% rename from examples/controllers/proceduralHandPoseExample.js rename to script-archive/controllers/proceduralHandPoseExample.js diff --git a/examples/controllers/reticleHandAngularVelocityTest.js b/script-archive/controllers/reticleHandAngularVelocityTest.js similarity index 100% rename from examples/controllers/reticleHandAngularVelocityTest.js rename to script-archive/controllers/reticleHandAngularVelocityTest.js diff --git a/examples/controllers/reticleTests.js b/script-archive/controllers/reticleTests.js similarity index 100% rename from examples/controllers/reticleTests.js rename to script-archive/controllers/reticleTests.js diff --git a/examples/controllers/rightClickExample.js b/script-archive/controllers/rightClickExample.js similarity index 100% rename from examples/controllers/rightClickExample.js rename to script-archive/controllers/rightClickExample.js diff --git a/examples/controllers/toybox.js b/script-archive/controllers/toybox.js similarity index 100% rename from examples/controllers/toybox.js rename to script-archive/controllers/toybox.js diff --git a/examples/cubePerfTest.js b/script-archive/cubePerfTest.js similarity index 100% rename from examples/cubePerfTest.js rename to script-archive/cubePerfTest.js diff --git a/examples/dancing_bot.js b/script-archive/dancing_bot.js similarity index 100% rename from examples/dancing_bot.js rename to script-archive/dancing_bot.js diff --git a/examples/data_visualization/earthquakes_live.js b/script-archive/data_visualization/earthquakes_live.js similarity index 100% rename from examples/data_visualization/earthquakes_live.js rename to script-archive/data_visualization/earthquakes_live.js diff --git a/examples/data_visualization/photo_sphere.js b/script-archive/data_visualization/photo_sphere.js similarity index 100% rename from examples/data_visualization/photo_sphere.js rename to script-archive/data_visualization/photo_sphere.js diff --git a/examples/debug-actions.js b/script-archive/debug-actions.js similarity index 100% rename from examples/debug-actions.js rename to script-archive/debug-actions.js diff --git a/examples/dressing_room/createPlatformWithLights.js b/script-archive/dressing_room/createPlatformWithLights.js similarity index 100% rename from examples/dressing_room/createPlatformWithLights.js rename to script-archive/dressing_room/createPlatformWithLights.js diff --git a/examples/dressing_room/createTableWithItems.js b/script-archive/dressing_room/createTableWithItems.js similarity index 100% rename from examples/dressing_room/createTableWithItems.js rename to script-archive/dressing_room/createTableWithItems.js diff --git a/examples/dressing_room/doppelganger.js b/script-archive/dressing_room/doppelganger.js similarity index 100% rename from examples/dressing_room/doppelganger.js rename to script-archive/dressing_room/doppelganger.js diff --git a/examples/dressing_room/freezeToggler.js b/script-archive/dressing_room/freezeToggler.js similarity index 100% rename from examples/dressing_room/freezeToggler.js rename to script-archive/dressing_room/freezeToggler.js diff --git a/examples/dressing_room/loadingAreaEntity.js b/script-archive/dressing_room/loadingAreaEntity.js similarity index 100% rename from examples/dressing_room/loadingAreaEntity.js rename to script-archive/dressing_room/loadingAreaEntity.js diff --git a/examples/dressing_room/mirroredEntity.js b/script-archive/dressing_room/mirroredEntity.js similarity index 100% rename from examples/dressing_room/mirroredEntity.js rename to script-archive/dressing_room/mirroredEntity.js diff --git a/examples/dressing_room/setupDressingRoom.js b/script-archive/dressing_room/setupDressingRoom.js similarity index 100% rename from examples/dressing_room/setupDressingRoom.js rename to script-archive/dressing_room/setupDressingRoom.js diff --git a/examples/dressing_room/wearablesManager.js b/script-archive/dressing_room/wearablesManager.js similarity index 100% rename from examples/dressing_room/wearablesManager.js rename to script-archive/dressing_room/wearablesManager.js diff --git a/examples/dropStuffNearMe.js b/script-archive/dropStuffNearMe.js similarity index 100% rename from examples/dropStuffNearMe.js rename to script-archive/dropStuffNearMe.js diff --git a/examples/drylake/createAvatarDetector.js b/script-archive/drylake/createAvatarDetector.js similarity index 100% rename from examples/drylake/createAvatarDetector.js rename to script-archive/drylake/createAvatarDetector.js diff --git a/examples/drylake/explodeHelicopter.js b/script-archive/drylake/explodeHelicopter.js similarity index 100% rename from examples/drylake/explodeHelicopter.js rename to script-archive/drylake/explodeHelicopter.js diff --git a/examples/drylake/helicopter.js b/script-archive/drylake/helicopter.js similarity index 100% rename from examples/drylake/helicopter.js rename to script-archive/drylake/helicopter.js diff --git a/examples/drylake/ratCreator.js b/script-archive/drylake/ratCreator.js similarity index 100% rename from examples/drylake/ratCreator.js rename to script-archive/drylake/ratCreator.js diff --git a/examples/drylake/ratSteer.js b/script-archive/drylake/ratSteer.js similarity index 100% rename from examples/drylake/ratSteer.js rename to script-archive/drylake/ratSteer.js diff --git a/examples/entityScripts/alternativeLightController.js b/script-archive/entityScripts/alternativeLightController.js similarity index 100% rename from examples/entityScripts/alternativeLightController.js rename to script-archive/entityScripts/alternativeLightController.js diff --git a/examples/entityScripts/boombox.js b/script-archive/entityScripts/boombox.js similarity index 100% rename from examples/entityScripts/boombox.js rename to script-archive/entityScripts/boombox.js diff --git a/examples/entityScripts/breakdanceEntity.js b/script-archive/entityScripts/breakdanceEntity.js similarity index 100% rename from examples/entityScripts/breakdanceEntity.js rename to script-archive/entityScripts/breakdanceEntity.js diff --git a/examples/entityScripts/changeColorOnCollision.js b/script-archive/entityScripts/changeColorOnCollision.js similarity index 100% rename from examples/entityScripts/changeColorOnCollision.js rename to script-archive/entityScripts/changeColorOnCollision.js diff --git a/examples/entityScripts/changeColorOnEnterLeave.js b/script-archive/entityScripts/changeColorOnEnterLeave.js similarity index 100% rename from examples/entityScripts/changeColorOnEnterLeave.js rename to script-archive/entityScripts/changeColorOnEnterLeave.js diff --git a/examples/entityScripts/changeColorOnHover.js b/script-archive/entityScripts/changeColorOnHover.js similarity index 100% rename from examples/entityScripts/changeColorOnHover.js rename to script-archive/entityScripts/changeColorOnHover.js diff --git a/examples/entityScripts/changeColorOnHoverClass.js b/script-archive/entityScripts/changeColorOnHoverClass.js similarity index 100% rename from examples/entityScripts/changeColorOnHoverClass.js rename to script-archive/entityScripts/changeColorOnHoverClass.js diff --git a/examples/entityScripts/changeColorOnTouch.js b/script-archive/entityScripts/changeColorOnTouch.js similarity index 100% rename from examples/entityScripts/changeColorOnTouch.js rename to script-archive/entityScripts/changeColorOnTouch.js diff --git a/examples/entityScripts/chessPiece.js b/script-archive/entityScripts/chessPiece.js similarity index 100% rename from examples/entityScripts/chessPiece.js rename to script-archive/entityScripts/chessPiece.js diff --git a/examples/entityScripts/crazylegsOnClick.js b/script-archive/entityScripts/crazylegsOnClick.js similarity index 100% rename from examples/entityScripts/crazylegsOnClick.js rename to script-archive/entityScripts/crazylegsOnClick.js diff --git a/examples/entityScripts/createParamsEntity.js b/script-archive/entityScripts/createParamsEntity.js similarity index 100% rename from examples/entityScripts/createParamsEntity.js rename to script-archive/entityScripts/createParamsEntity.js diff --git a/examples/entityScripts/createRecorder.js b/script-archive/entityScripts/createRecorder.js similarity index 100% rename from examples/entityScripts/createRecorder.js rename to script-archive/entityScripts/createRecorder.js diff --git a/examples/entityScripts/detectGrabExample.js b/script-archive/entityScripts/detectGrabExample.js similarity index 100% rename from examples/entityScripts/detectGrabExample.js rename to script-archive/entityScripts/detectGrabExample.js diff --git a/examples/entityScripts/detectTouchExample.js b/script-archive/entityScripts/detectTouchExample.js similarity index 100% rename from examples/entityScripts/detectTouchExample.js rename to script-archive/entityScripts/detectTouchExample.js diff --git a/examples/entityScripts/inspect.js b/script-archive/entityScripts/inspect.js similarity index 100% rename from examples/entityScripts/inspect.js rename to script-archive/entityScripts/inspect.js diff --git a/examples/entityScripts/lightController.js b/script-archive/entityScripts/lightController.js similarity index 100% rename from examples/entityScripts/lightController.js rename to script-archive/entityScripts/lightController.js diff --git a/examples/entityScripts/lightningEntity.js b/script-archive/entityScripts/lightningEntity.js similarity index 100% rename from examples/entityScripts/lightningEntity.js rename to script-archive/entityScripts/lightningEntity.js diff --git a/examples/entityScripts/messagesReceiverEntityExample.js b/script-archive/entityScripts/messagesReceiverEntityExample.js similarity index 100% rename from examples/entityScripts/messagesReceiverEntityExample.js rename to script-archive/entityScripts/messagesReceiverEntityExample.js diff --git a/examples/entityScripts/movable.js b/script-archive/entityScripts/movable.js similarity index 100% rename from examples/entityScripts/movable.js rename to script-archive/entityScripts/movable.js diff --git a/examples/entityScripts/paramsEntity.js b/script-archive/entityScripts/paramsEntity.js similarity index 100% rename from examples/entityScripts/paramsEntity.js rename to script-archive/entityScripts/paramsEntity.js diff --git a/examples/entityScripts/playSoundOnClick.js b/script-archive/entityScripts/playSoundOnClick.js similarity index 100% rename from examples/entityScripts/playSoundOnClick.js rename to script-archive/entityScripts/playSoundOnClick.js diff --git a/examples/entityScripts/playSoundOnEnterOrLeave.js b/script-archive/entityScripts/playSoundOnEnterOrLeave.js similarity index 100% rename from examples/entityScripts/playSoundOnEnterOrLeave.js rename to script-archive/entityScripts/playSoundOnEnterOrLeave.js diff --git a/examples/entityScripts/portal.js b/script-archive/entityScripts/portal.js similarity index 100% rename from examples/entityScripts/portal.js rename to script-archive/entityScripts/portal.js diff --git a/examples/entityScripts/recordingEntityScript.js b/script-archive/entityScripts/recordingEntityScript.js similarity index 100% rename from examples/entityScripts/recordingEntityScript.js rename to script-archive/entityScripts/recordingEntityScript.js diff --git a/examples/entityScripts/recordingMaster.js b/script-archive/entityScripts/recordingMaster.js similarity index 100% rename from examples/entityScripts/recordingMaster.js rename to script-archive/entityScripts/recordingMaster.js diff --git a/examples/entityScripts/sitOnEntity.js b/script-archive/entityScripts/sitOnEntity.js similarity index 100% rename from examples/entityScripts/sitOnEntity.js rename to script-archive/entityScripts/sitOnEntity.js diff --git a/examples/entityScripts/teleportOnClick.js b/script-archive/entityScripts/teleportOnClick.js similarity index 100% rename from examples/entityScripts/teleportOnClick.js rename to script-archive/entityScripts/teleportOnClick.js diff --git a/examples/entityScripts/virtualBaton/batonSimpleEntityScript.js b/script-archive/entityScripts/virtualBaton/batonSimpleEntityScript.js similarity index 100% rename from examples/entityScripts/virtualBaton/batonSimpleEntityScript.js rename to script-archive/entityScripts/virtualBaton/batonSimpleEntityScript.js diff --git a/examples/entityScripts/virtualBaton/batonSimpleEntitySpawner.js b/script-archive/entityScripts/virtualBaton/batonSimpleEntitySpawner.js similarity index 100% rename from examples/entityScripts/virtualBaton/batonSimpleEntitySpawner.js rename to script-archive/entityScripts/virtualBaton/batonSimpleEntitySpawner.js diff --git a/examples/example/assetsExample.js b/script-archive/example/assetsExample.js similarity index 100% rename from examples/example/assetsExample.js rename to script-archive/example/assetsExample.js diff --git a/examples/example/audio/audioBall.js b/script-archive/example/audio/audioBall.js similarity index 100% rename from examples/example/audio/audioBall.js rename to script-archive/example/audio/audioBall.js diff --git a/examples/example/audio/audioDeviceExample.js b/script-archive/example/audio/audioDeviceExample.js similarity index 100% rename from examples/example/audio/audioDeviceExample.js rename to script-archive/example/audio/audioDeviceExample.js diff --git a/examples/example/audio/audioMuteExample.js b/script-archive/example/audio/audioMuteExample.js similarity index 100% rename from examples/example/audio/audioMuteExample.js rename to script-archive/example/audio/audioMuteExample.js diff --git a/examples/example/audio/audioReverbOn.js b/script-archive/example/audio/audioReverbOn.js similarity index 100% rename from examples/example/audio/audioReverbOn.js rename to script-archive/example/audio/audioReverbOn.js diff --git a/examples/example/audio/birdSongs.js b/script-archive/example/audio/birdSongs.js similarity index 100% rename from examples/example/audio/birdSongs.js rename to script-archive/example/audio/birdSongs.js diff --git a/examples/example/audio/jsstreamplayer.js b/script-archive/example/audio/jsstreamplayer.js similarity index 100% rename from examples/example/audio/jsstreamplayer.js rename to script-archive/example/audio/jsstreamplayer.js diff --git a/examples/example/audio/largeHall.js b/script-archive/example/audio/largeHall.js similarity index 100% rename from examples/example/audio/largeHall.js rename to script-archive/example/audio/largeHall.js diff --git a/examples/example/audio/radio.js b/script-archive/example/audio/radio.js similarity index 100% rename from examples/example/audio/radio.js rename to script-archive/example/audio/radio.js diff --git a/examples/example/audio/smallRoom.js b/script-archive/example/audio/smallRoom.js similarity index 100% rename from examples/example/audio/smallRoom.js rename to script-archive/example/audio/smallRoom.js diff --git a/examples/example/audio/speechControl.js b/script-archive/example/audio/speechControl.js similarity index 100% rename from examples/example/audio/speechControl.js rename to script-archive/example/audio/speechControl.js diff --git a/examples/example/avatarcontrol/cameraExample.js b/script-archive/example/avatarcontrol/cameraExample.js similarity index 100% rename from examples/example/avatarcontrol/cameraExample.js rename to script-archive/example/avatarcontrol/cameraExample.js diff --git a/examples/example/avatarcontrol/controllerExample.js b/script-archive/example/avatarcontrol/controllerExample.js similarity index 100% rename from examples/example/avatarcontrol/controllerExample.js rename to script-archive/example/avatarcontrol/controllerExample.js diff --git a/examples/example/avatarcontrol/graspHands.js b/script-archive/example/avatarcontrol/graspHands.js similarity index 100% rename from examples/example/avatarcontrol/graspHands.js rename to script-archive/example/avatarcontrol/graspHands.js diff --git a/examples/example/avatarcontrol/guidedTour.js b/script-archive/example/avatarcontrol/guidedTour.js similarity index 100% rename from examples/example/avatarcontrol/guidedTour.js rename to script-archive/example/avatarcontrol/guidedTour.js diff --git a/examples/example/avatarcontrol/handControlledHead.js b/script-archive/example/avatarcontrol/handControlledHead.js similarity index 100% rename from examples/example/avatarcontrol/handControlledHead.js rename to script-archive/example/avatarcontrol/handControlledHead.js diff --git a/examples/example/avatarcontrol/hideAvatarExample.js b/script-archive/example/avatarcontrol/hideAvatarExample.js similarity index 100% rename from examples/example/avatarcontrol/hideAvatarExample.js rename to script-archive/example/avatarcontrol/hideAvatarExample.js diff --git a/examples/example/avatarcontrol/lookAtExample.js b/script-archive/example/avatarcontrol/lookAtExample.js similarity index 100% rename from examples/example/avatarcontrol/lookAtExample.js rename to script-archive/example/avatarcontrol/lookAtExample.js diff --git a/examples/example/avatarcontrol/multipleCursorsExample.js b/script-archive/example/avatarcontrol/multipleCursorsExample.js similarity index 100% rename from examples/example/avatarcontrol/multipleCursorsExample.js rename to script-archive/example/avatarcontrol/multipleCursorsExample.js diff --git a/examples/example/avatarcontrol/multitouchExample.js b/script-archive/example/avatarcontrol/multitouchExample.js similarity index 100% rename from examples/example/avatarcontrol/multitouchExample.js rename to script-archive/example/avatarcontrol/multitouchExample.js diff --git a/examples/example/brownianFun.js b/script-archive/example/brownianFun.js similarity index 100% rename from examples/example/brownianFun.js rename to script-archive/example/brownianFun.js diff --git a/examples/example/downloadInfoExample.js b/script-archive/example/downloadInfoExample.js similarity index 100% rename from examples/example/downloadInfoExample.js rename to script-archive/example/downloadInfoExample.js diff --git a/examples/example/dynamicLandscape.js b/script-archive/example/dynamicLandscape.js similarity index 100% rename from examples/example/dynamicLandscape.js rename to script-archive/example/dynamicLandscape.js diff --git a/examples/example/entities/ZZZ-MOVE-TO_DOCS-animationStateExample.js b/script-archive/example/entities/ZZZ-MOVE-TO_DOCS-animationStateExample.js similarity index 100% rename from examples/example/entities/ZZZ-MOVE-TO_DOCS-animationStateExample.js rename to script-archive/example/entities/ZZZ-MOVE-TO_DOCS-animationStateExample.js diff --git a/examples/example/entities/animatedModelExample.js b/script-archive/example/entities/animatedModelExample.js similarity index 100% rename from examples/example/entities/animatedModelExample.js rename to script-archive/example/entities/animatedModelExample.js diff --git a/examples/example/entities/collidingEntities.js b/script-archive/example/entities/collidingEntities.js similarity index 100% rename from examples/example/entities/collidingEntities.js rename to script-archive/example/entities/collidingEntities.js diff --git a/examples/example/entities/editEntityExample.js b/script-archive/example/entities/editEntityExample.js similarity index 100% rename from examples/example/entities/editEntityExample.js rename to script-archive/example/entities/editEntityExample.js diff --git a/examples/example/entities/editModelExample.js b/script-archive/example/entities/editModelExample.js similarity index 100% rename from examples/example/entities/editModelExample.js rename to script-archive/example/entities/editModelExample.js diff --git a/examples/example/entities/entityModelExample.js b/script-archive/example/entities/entityModelExample.js similarity index 100% rename from examples/example/entities/entityModelExample.js rename to script-archive/example/entities/entityModelExample.js diff --git a/examples/example/entities/findEntitiesExample.js b/script-archive/example/entities/findEntitiesExample.js similarity index 100% rename from examples/example/entities/findEntitiesExample.js rename to script-archive/example/entities/findEntitiesExample.js diff --git a/examples/example/entities/flockingBirds.js b/script-archive/example/entities/flockingBirds.js similarity index 100% rename from examples/example/entities/flockingBirds.js rename to script-archive/example/entities/flockingBirds.js diff --git a/examples/example/entities/fullDomainZoneEntityExample.js b/script-archive/example/entities/fullDomainZoneEntityExample.js similarity index 100% rename from examples/example/entities/fullDomainZoneEntityExample.js rename to script-archive/example/entities/fullDomainZoneEntityExample.js diff --git a/examples/example/entities/jsstreamplayerdomain-zone-entity.js b/script-archive/example/entities/jsstreamplayerdomain-zone-entity.js similarity index 100% rename from examples/example/entities/jsstreamplayerdomain-zone-entity.js rename to script-archive/example/entities/jsstreamplayerdomain-zone-entity.js diff --git a/examples/example/entities/lightExample.js b/script-archive/example/entities/lightExample.js similarity index 100% rename from examples/example/entities/lightExample.js rename to script-archive/example/entities/lightExample.js diff --git a/examples/example/entities/makeHouses.js b/script-archive/example/entities/makeHouses.js similarity index 100% rename from examples/example/entities/makeHouses.js rename to script-archive/example/entities/makeHouses.js diff --git a/examples/example/entities/particlesTest.js b/script-archive/example/entities/particlesTest.js similarity index 100% rename from examples/example/entities/particlesTest.js rename to script-archive/example/entities/particlesTest.js diff --git a/examples/example/entities/platform.js b/script-archive/example/entities/platform.js similarity index 100% rename from examples/example/entities/platform.js rename to script-archive/example/entities/platform.js diff --git a/examples/example/entities/rideAlongWithAnEntityExample.js b/script-archive/example/entities/rideAlongWithAnEntityExample.js similarity index 100% rename from examples/example/entities/rideAlongWithAnEntityExample.js rename to script-archive/example/entities/rideAlongWithAnEntityExample.js diff --git a/examples/example/entities/spotlightExample.js b/script-archive/example/entities/spotlightExample.js similarity index 100% rename from examples/example/entities/spotlightExample.js rename to script-archive/example/entities/spotlightExample.js diff --git a/examples/example/entities/zoneEntityExample.js b/script-archive/example/entities/zoneEntityExample.js similarity index 100% rename from examples/example/entities/zoneEntityExample.js rename to script-archive/example/entities/zoneEntityExample.js diff --git a/examples/example/entities/zoneSkyboxExample.js b/script-archive/example/entities/zoneSkyboxExample.js similarity index 100% rename from examples/example/entities/zoneSkyboxExample.js rename to script-archive/example/entities/zoneSkyboxExample.js diff --git a/examples/example/entityCollisionExample.js b/script-archive/example/entityCollisionExample.js similarity index 100% rename from examples/example/entityCollisionExample.js rename to script-archive/example/entityCollisionExample.js diff --git a/examples/example/games/airHockey.js b/script-archive/example/games/airHockey.js similarity index 100% rename from examples/example/games/airHockey.js rename to script-archive/example/games/airHockey.js diff --git a/examples/example/games/billiards.js b/script-archive/example/games/billiards.js similarity index 100% rename from examples/example/games/billiards.js rename to script-archive/example/games/billiards.js diff --git a/examples/example/games/cleanupChessboards.js b/script-archive/example/games/cleanupChessboards.js similarity index 100% rename from examples/example/games/cleanupChessboards.js rename to script-archive/example/games/cleanupChessboards.js diff --git a/examples/example/games/clonedOverlaysExample.js b/script-archive/example/games/clonedOverlaysExample.js similarity index 100% rename from examples/example/games/clonedOverlaysExample.js rename to script-archive/example/games/clonedOverlaysExample.js diff --git a/examples/example/games/color_busters/colorBusterWand.js b/script-archive/example/games/color_busters/colorBusterWand.js similarity index 100% rename from examples/example/games/color_busters/colorBusterWand.js rename to script-archive/example/games/color_busters/colorBusterWand.js diff --git a/examples/example/games/color_busters/createColorBusterCubes.js b/script-archive/example/games/color_busters/createColorBusterCubes.js similarity index 100% rename from examples/example/games/color_busters/createColorBusterCubes.js rename to script-archive/example/games/color_busters/createColorBusterCubes.js diff --git a/examples/example/games/color_busters/createColorBusterWand.js b/script-archive/example/games/color_busters/createColorBusterWand.js similarity index 100% rename from examples/example/games/color_busters/createColorBusterWand.js rename to script-archive/example/games/color_busters/createColorBusterWand.js diff --git a/examples/example/games/exterminatorGame/gameServer/.gitignore b/script-archive/example/games/exterminatorGame/gameServer/.gitignore similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/.gitignore rename to script-archive/example/games/exterminatorGame/gameServer/.gitignore diff --git a/examples/example/games/exterminatorGame/gameServer/Procfile b/script-archive/example/games/exterminatorGame/gameServer/Procfile similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/Procfile rename to script-archive/example/games/exterminatorGame/gameServer/Procfile diff --git a/examples/example/games/exterminatorGame/gameServer/README.txt b/script-archive/example/games/exterminatorGame/gameServer/README.txt similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/README.txt rename to script-archive/example/games/exterminatorGame/gameServer/README.txt diff --git a/examples/example/games/exterminatorGame/gameServer/app.js b/script-archive/example/games/exterminatorGame/gameServer/app.js similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/app.js rename to script-archive/example/games/exterminatorGame/gameServer/app.js diff --git a/examples/example/games/exterminatorGame/gameServer/client/app.jsx b/script-archive/example/games/exterminatorGame/gameServer/client/app.jsx similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/client/app.jsx rename to script-archive/example/games/exterminatorGame/gameServer/client/app.jsx diff --git a/examples/example/games/exterminatorGame/gameServer/gulpfile.js b/script-archive/example/games/exterminatorGame/gameServer/gulpfile.js similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/gulpfile.js rename to script-archive/example/games/exterminatorGame/gameServer/gulpfile.js diff --git a/examples/example/games/exterminatorGame/gameServer/package.json b/script-archive/example/games/exterminatorGame/gameServer/package.json similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/package.json rename to script-archive/example/games/exterminatorGame/gameServer/package.json diff --git a/examples/example/games/exterminatorGame/gameServer/public/css/style.css b/script-archive/example/games/exterminatorGame/gameServer/public/css/style.css similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/public/css/style.css rename to script-archive/example/games/exterminatorGame/gameServer/public/css/style.css diff --git a/examples/example/games/exterminatorGame/gameServer/public/index.html b/script-archive/example/games/exterminatorGame/gameServer/public/index.html similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/public/index.html rename to script-archive/example/games/exterminatorGame/gameServer/public/index.html diff --git a/examples/example/games/exterminatorGame/gameServer/public/js/app.js b/script-archive/example/games/exterminatorGame/gameServer/public/js/app.js similarity index 100% rename from examples/example/games/exterminatorGame/gameServer/public/js/app.js rename to script-archive/example/games/exterminatorGame/gameServer/public/js/app.js diff --git a/examples/example/games/exterminatorGame/pistolScriptSpawnerSpawner.js b/script-archive/example/games/exterminatorGame/pistolScriptSpawnerSpawner.js similarity index 100% rename from examples/example/games/exterminatorGame/pistolScriptSpawnerSpawner.js rename to script-archive/example/games/exterminatorGame/pistolScriptSpawnerSpawner.js diff --git a/examples/example/games/grabHockey.js b/script-archive/example/games/grabHockey.js similarity index 100% rename from examples/example/games/grabHockey.js rename to script-archive/example/games/grabHockey.js diff --git a/examples/example/games/hitEffect.js b/script-archive/example/games/hitEffect.js similarity index 100% rename from examples/example/games/hitEffect.js rename to script-archive/example/games/hitEffect.js diff --git a/examples/example/games/hydraGrabHockey.js b/script-archive/example/games/hydraGrabHockey.js similarity index 100% rename from examples/example/games/hydraGrabHockey.js rename to script-archive/example/games/hydraGrabHockey.js diff --git a/examples/example/games/make-dummy.js b/script-archive/example/games/make-dummy.js similarity index 100% rename from examples/example/games/make-dummy.js rename to script-archive/example/games/make-dummy.js diff --git a/examples/example/games/planky.js b/script-archive/example/games/planky.js similarity index 100% rename from examples/example/games/planky.js rename to script-archive/example/games/planky.js diff --git a/examples/example/games/playChess.js b/script-archive/example/games/playChess.js similarity index 100% rename from examples/example/games/playChess.js rename to script-archive/example/games/playChess.js diff --git a/examples/example/games/satellite.js b/script-archive/example/games/satellite.js similarity index 100% rename from examples/example/games/satellite.js rename to script-archive/example/games/satellite.js diff --git a/examples/example/games/spaceInvadersExample.js b/script-archive/example/games/spaceInvadersExample.js similarity index 100% rename from examples/example/games/spaceInvadersExample.js rename to script-archive/example/games/spaceInvadersExample.js diff --git a/examples/example/games/sword.js b/script-archive/example/games/sword.js similarity index 100% rename from examples/example/games/sword.js rename to script-archive/example/games/sword.js diff --git a/examples/example/globalCollisionsExample.js b/script-archive/example/globalCollisionsExample.js similarity index 100% rename from examples/example/globalCollisionsExample.js rename to script-archive/example/globalCollisionsExample.js diff --git a/examples/example/hmd/colorCube.fs b/script-archive/example/hmd/colorCube.fs similarity index 100% rename from examples/example/hmd/colorCube.fs rename to script-archive/example/hmd/colorCube.fs diff --git a/examples/example/hmd/colorCube.js b/script-archive/example/hmd/colorCube.js similarity index 100% rename from examples/example/hmd/colorCube.js rename to script-archive/example/hmd/colorCube.js diff --git a/examples/example/hmd/ipdScalingTest.js b/script-archive/example/hmd/ipdScalingTest.js similarity index 100% rename from examples/example/hmd/ipdScalingTest.js rename to script-archive/example/hmd/ipdScalingTest.js diff --git a/examples/example/hmd/pickerTest.js b/script-archive/example/hmd/pickerTest.js similarity index 100% rename from examples/example/hmd/pickerTest.js rename to script-archive/example/hmd/pickerTest.js diff --git a/examples/example/lineExample.js b/script-archive/example/lineExample.js similarity index 100% rename from examples/example/lineExample.js rename to script-archive/example/lineExample.js diff --git a/examples/example/messages/messagesExample.js b/script-archive/example/messages/messagesExample.js similarity index 100% rename from examples/example/messages/messagesExample.js rename to script-archive/example/messages/messagesExample.js diff --git a/examples/example/messages/messagesReceiverExample.js b/script-archive/example/messages/messagesReceiverExample.js similarity index 100% rename from examples/example/messages/messagesReceiverExample.js rename to script-archive/example/messages/messagesReceiverExample.js diff --git a/examples/example/messages/messagesTestReceive.js b/script-archive/example/messages/messagesTestReceive.js similarity index 100% rename from examples/example/messages/messagesTestReceive.js rename to script-archive/example/messages/messagesTestReceive.js diff --git a/examples/example/messages/messagesTestSend.js b/script-archive/example/messages/messagesTestSend.js similarity index 100% rename from examples/example/messages/messagesTestSend.js rename to script-archive/example/messages/messagesTestSend.js diff --git a/examples/example/misc/collectHifiStats.js b/script-archive/example/misc/collectHifiStats.js similarity index 100% rename from examples/example/misc/collectHifiStats.js rename to script-archive/example/misc/collectHifiStats.js diff --git a/examples/example/misc/listAllScripts.js b/script-archive/example/misc/listAllScripts.js similarity index 100% rename from examples/example/misc/listAllScripts.js rename to script-archive/example/misc/listAllScripts.js diff --git a/examples/example/misc/statsExample.js b/script-archive/example/misc/statsExample.js similarity index 100% rename from examples/example/misc/statsExample.js rename to script-archive/example/misc/statsExample.js diff --git a/examples/example/misc/sunLightExample.js b/script-archive/example/misc/sunLightExample.js similarity index 100% rename from examples/example/misc/sunLightExample.js rename to script-archive/example/misc/sunLightExample.js diff --git a/examples/example/painting/hydraPaint.js b/script-archive/example/painting/hydraPaint.js similarity index 100% rename from examples/example/painting/hydraPaint.js rename to script-archive/example/painting/hydraPaint.js diff --git a/examples/example/painting/mousePaint.js b/script-archive/example/painting/mousePaint.js similarity index 100% rename from examples/example/painting/mousePaint.js rename to script-archive/example/painting/mousePaint.js diff --git a/examples/example/planets-ui.js b/script-archive/example/planets-ui.js similarity index 100% rename from examples/example/planets-ui.js rename to script-archive/example/planets-ui.js diff --git a/examples/example/scripts/controllerScriptingExamples.js b/script-archive/example/scripts/controllerScriptingExamples.js similarity index 100% rename from examples/example/scripts/controllerScriptingExamples.js rename to script-archive/example/scripts/controllerScriptingExamples.js diff --git a/examples/example/scripts/includeExample.js b/script-archive/example/scripts/includeExample.js similarity index 100% rename from examples/example/scripts/includeExample.js rename to script-archive/example/scripts/includeExample.js diff --git a/examples/example/scripts/locationExample.js b/script-archive/example/scripts/locationExample.js similarity index 100% rename from examples/example/scripts/locationExample.js rename to script-archive/example/scripts/locationExample.js diff --git a/examples/example/scripts/rayPickExample.js b/script-archive/example/scripts/rayPickExample.js similarity index 100% rename from examples/example/scripts/rayPickExample.js rename to script-archive/example/scripts/rayPickExample.js diff --git a/examples/example/scripts/settingsExample.js b/script-archive/example/scripts/settingsExample.js similarity index 100% rename from examples/example/scripts/settingsExample.js rename to script-archive/example/scripts/settingsExample.js diff --git a/examples/example/scripts/streetAreaExample.js b/script-archive/example/scripts/streetAreaExample.js similarity index 100% rename from examples/example/scripts/streetAreaExample.js rename to script-archive/example/scripts/streetAreaExample.js diff --git a/examples/example/scripts/timer.js b/script-archive/example/scripts/timer.js similarity index 100% rename from examples/example/scripts/timer.js rename to script-archive/example/scripts/timer.js diff --git a/examples/example/securityCamera.js b/script-archive/example/securityCamera.js similarity index 100% rename from examples/example/securityCamera.js rename to script-archive/example/securityCamera.js diff --git a/examples/example/solarsystem.js b/script-archive/example/solarsystem.js similarity index 100% rename from examples/example/solarsystem.js rename to script-archive/example/solarsystem.js diff --git a/examples/example/soundToys.js b/script-archive/example/soundToys.js similarity index 100% rename from examples/example/soundToys.js rename to script-archive/example/soundToys.js diff --git a/examples/example/tests/test-includes/a.js b/script-archive/example/tests/test-includes/a.js similarity index 100% rename from examples/example/tests/test-includes/a.js rename to script-archive/example/tests/test-includes/a.js diff --git a/examples/example/tests/test-includes/b.js b/script-archive/example/tests/test-includes/b.js similarity index 100% rename from examples/example/tests/test-includes/b.js rename to script-archive/example/tests/test-includes/b.js diff --git a/examples/example/tests/test-includes/start.js b/script-archive/example/tests/test-includes/start.js similarity index 100% rename from examples/example/tests/test-includes/start.js rename to script-archive/example/tests/test-includes/start.js diff --git a/examples/example/ui/LODManagerExample.js b/script-archive/example/ui/LODManagerExample.js similarity index 100% rename from examples/example/ui/LODManagerExample.js rename to script-archive/example/ui/LODManagerExample.js diff --git a/examples/example/ui/MyEnergyBar.js b/script-archive/example/ui/MyEnergyBar.js similarity index 100% rename from examples/example/ui/MyEnergyBar.js rename to script-archive/example/ui/MyEnergyBar.js diff --git a/examples/example/ui/dialogExample.js b/script-archive/example/ui/dialogExample.js similarity index 100% rename from examples/example/ui/dialogExample.js rename to script-archive/example/ui/dialogExample.js diff --git a/examples/example/ui/energyBar.js b/script-archive/example/ui/energyBar.js similarity index 100% rename from examples/example/ui/energyBar.js rename to script-archive/example/ui/energyBar.js diff --git a/examples/example/ui/fileBrowserExample.js b/script-archive/example/ui/fileBrowserExample.js similarity index 100% rename from examples/example/ui/fileBrowserExample.js rename to script-archive/example/ui/fileBrowserExample.js diff --git a/examples/example/ui/menuExample.js b/script-archive/example/ui/menuExample.js similarity index 100% rename from examples/example/ui/menuExample.js rename to script-archive/example/ui/menuExample.js diff --git a/examples/example/ui/overlayPanelExample.js b/script-archive/example/ui/overlayPanelExample.js similarity index 100% rename from examples/example/ui/overlayPanelExample.js rename to script-archive/example/ui/overlayPanelExample.js diff --git a/examples/example/ui/overlaysExample.js b/script-archive/example/ui/overlaysExample.js similarity index 100% rename from examples/example/ui/overlaysExample.js rename to script-archive/example/ui/overlaysExample.js diff --git a/examples/example/ui/textInputOverlayExample.js b/script-archive/example/ui/textInputOverlayExample.js similarity index 100% rename from examples/example/ui/textInputOverlayExample.js rename to script-archive/example/ui/textInputOverlayExample.js diff --git a/examples/example/ui/windowExample.js b/script-archive/example/ui/windowExample.js similarity index 100% rename from examples/example/ui/windowExample.js rename to script-archive/example/ui/windowExample.js diff --git a/examples/example/widgets-example.js b/script-archive/example/widgets-example.js similarity index 100% rename from examples/example/widgets-example.js rename to script-archive/example/widgets-example.js diff --git a/examples/faceBlendCoefficients.js b/script-archive/faceBlendCoefficients.js similarity index 100% rename from examples/faceBlendCoefficients.js rename to script-archive/faceBlendCoefficients.js diff --git a/examples/fireflies/firefly.js b/script-archive/fireflies/firefly.js similarity index 100% rename from examples/fireflies/firefly.js rename to script-archive/fireflies/firefly.js diff --git a/examples/fireflies/makeFireflies.js b/script-archive/fireflies/makeFireflies.js similarity index 100% rename from examples/fireflies/makeFireflies.js rename to script-archive/fireflies/makeFireflies.js diff --git a/examples/fireworks.js b/script-archive/fireworks.js similarity index 100% rename from examples/fireworks.js rename to script-archive/fireworks.js diff --git a/examples/flowArts/arcBall/arcBall.js b/script-archive/flowArts/arcBall/arcBall.js similarity index 100% rename from examples/flowArts/arcBall/arcBall.js rename to script-archive/flowArts/arcBall/arcBall.js diff --git a/examples/flowArts/arcBall/arcBallEntityScript.js b/script-archive/flowArts/arcBall/arcBallEntityScript.js similarity index 100% rename from examples/flowArts/arcBall/arcBallEntityScript.js rename to script-archive/flowArts/arcBall/arcBallEntityScript.js diff --git a/examples/flowArts/flowArtsHutSpawner.js b/script-archive/flowArts/flowArtsHutSpawner.js similarity index 100% rename from examples/flowArts/flowArtsHutSpawner.js rename to script-archive/flowArts/flowArtsHutSpawner.js diff --git a/examples/flowArts/lightBall/lightBall.js b/script-archive/flowArts/lightBall/lightBall.js similarity index 100% rename from examples/flowArts/lightBall/lightBall.js rename to script-archive/flowArts/lightBall/lightBall.js diff --git a/examples/flowArts/lightSaber/lightSaber.js b/script-archive/flowArts/lightSaber/lightSaber.js similarity index 100% rename from examples/flowArts/lightSaber/lightSaber.js rename to script-archive/flowArts/lightSaber/lightSaber.js diff --git a/examples/flowArts/lightSaber/lightSaberEntityScript.js b/script-archive/flowArts/lightSaber/lightSaberEntityScript.js similarity index 100% rename from examples/flowArts/lightSaber/lightSaberEntityScript.js rename to script-archive/flowArts/lightSaber/lightSaberEntityScript.js diff --git a/examples/flowArts/lightTrails.js b/script-archive/flowArts/lightTrails.js similarity index 100% rename from examples/flowArts/lightTrails.js rename to script-archive/flowArts/lightTrails.js diff --git a/examples/flowArts/raveStick/raveStick.js b/script-archive/flowArts/raveStick/raveStick.js similarity index 100% rename from examples/flowArts/raveStick/raveStick.js rename to script-archive/flowArts/raveStick/raveStick.js diff --git a/examples/flowArts/raveStick/raveStickEntityScript.js b/script-archive/flowArts/raveStick/raveStickEntityScript.js similarity index 100% rename from examples/flowArts/raveStick/raveStickEntityScript.js rename to script-archive/flowArts/raveStick/raveStickEntityScript.js diff --git a/examples/golfclub/golfClub.js b/script-archive/golfclub/golfClub.js similarity index 100% rename from examples/golfclub/golfClub.js rename to script-archive/golfclub/golfClub.js diff --git a/examples/golfclub/golfClub.json b/script-archive/golfclub/golfClub.json similarity index 100% rename from examples/golfclub/golfClub.json rename to script-archive/golfclub/golfClub.json diff --git a/examples/gracefulControls.js b/script-archive/gracefulControls.js similarity index 100% rename from examples/gracefulControls.js rename to script-archive/gracefulControls.js diff --git a/examples/grenade.js b/script-archive/grenade.js similarity index 100% rename from examples/grenade.js rename to script-archive/grenade.js diff --git a/examples/gridTest.js b/script-archive/gridTest.js similarity index 100% rename from examples/gridTest.js rename to script-archive/gridTest.js diff --git a/examples/growth.js b/script-archive/growth.js similarity index 100% rename from examples/growth.js rename to script-archive/growth.js diff --git a/examples/harmonicOscillator.js b/script-archive/harmonicOscillator.js similarity index 100% rename from examples/harmonicOscillator.js rename to script-archive/harmonicOscillator.js diff --git a/examples/headMove.js b/script-archive/headMove.js similarity index 100% rename from examples/headMove.js rename to script-archive/headMove.js diff --git a/examples/homeContent/whiteboardV2/eraserEntityScript.js b/script-archive/homeContent/whiteboardV2/eraserEntityScript.js similarity index 100% rename from examples/homeContent/whiteboardV2/eraserEntityScript.js rename to script-archive/homeContent/whiteboardV2/eraserEntityScript.js diff --git a/examples/homeContent/whiteboardV2/markerEntityScript.js b/script-archive/homeContent/whiteboardV2/markerEntityScript.js similarity index 100% rename from examples/homeContent/whiteboardV2/markerEntityScript.js rename to script-archive/homeContent/whiteboardV2/markerEntityScript.js diff --git a/examples/homeContent/whiteboardV2/whiteboardSpawner.js b/script-archive/homeContent/whiteboardV2/whiteboardSpawner.js similarity index 100% rename from examples/homeContent/whiteboardV2/whiteboardSpawner.js rename to script-archive/homeContent/whiteboardV2/whiteboardSpawner.js diff --git a/examples/hotPlaces.js b/script-archive/hotPlaces.js similarity index 100% rename from examples/hotPlaces.js rename to script-archive/hotPlaces.js diff --git a/examples/html/jsstreamplayer.html b/script-archive/html/jsstreamplayer.html similarity index 100% rename from examples/html/jsstreamplayer.html rename to script-archive/html/jsstreamplayer.html diff --git a/examples/html/magBalls/addMode.html b/script-archive/html/magBalls/addMode.html similarity index 100% rename from examples/html/magBalls/addMode.html rename to script-archive/html/magBalls/addMode.html diff --git a/examples/html/magBalls/deleteMode.html b/script-archive/html/magBalls/deleteMode.html similarity index 100% rename from examples/html/magBalls/deleteMode.html rename to script-archive/html/magBalls/deleteMode.html diff --git a/examples/html/magBalls/magBalls.css b/script-archive/html/magBalls/magBalls.css similarity index 100% rename from examples/html/magBalls/magBalls.css rename to script-archive/html/magBalls/magBalls.css diff --git a/examples/html/magBalls/moveMode.html b/script-archive/html/magBalls/moveMode.html similarity index 100% rename from examples/html/magBalls/moveMode.html rename to script-archive/html/magBalls/moveMode.html diff --git a/examples/html/plankySettings.html b/script-archive/html/plankySettings.html similarity index 100% rename from examples/html/plankySettings.html rename to script-archive/html/plankySettings.html diff --git a/examples/html/qmlWebTest.html b/script-archive/html/qmlWebTest.html similarity index 100% rename from examples/html/qmlWebTest.html rename to script-archive/html/qmlWebTest.html diff --git a/examples/html/spinButtons.js b/script-archive/html/spinButtons.js similarity index 100% rename from examples/html/spinButtons.js rename to script-archive/html/spinButtons.js diff --git a/examples/html/style.css b/script-archive/html/style.css similarity index 100% rename from examples/html/style.css rename to script-archive/html/style.css diff --git a/examples/html/walkSettings.html b/script-archive/html/walkSettings.html similarity index 100% rename from examples/html/walkSettings.html rename to script-archive/html/walkSettings.html diff --git a/examples/html/walkStyle.css b/script-archive/html/walkStyle.css similarity index 100% rename from examples/html/walkStyle.css rename to script-archive/html/walkStyle.css diff --git a/examples/inspect.js b/script-archive/inspect.js similarity index 100% rename from examples/inspect.js rename to script-archive/inspect.js diff --git a/examples/junkyard/junkyardClientReset.js b/script-archive/junkyard/junkyardClientReset.js similarity index 100% rename from examples/junkyard/junkyardClientReset.js rename to script-archive/junkyard/junkyardClientReset.js diff --git a/examples/junkyard/junkyardResetEntityScript.js b/script-archive/junkyard/junkyardResetEntityScript.js similarity index 100% rename from examples/junkyard/junkyardResetEntityScript.js rename to script-archive/junkyard/junkyardResetEntityScript.js diff --git a/examples/junkyard/junkyardResetEntitySpawner.js b/script-archive/junkyard/junkyardResetEntitySpawner.js similarity index 100% rename from examples/junkyard/junkyardResetEntitySpawner.js rename to script-archive/junkyard/junkyardResetEntitySpawner.js diff --git a/examples/kneel.js b/script-archive/kneel.js similarity index 100% rename from examples/kneel.js rename to script-archive/kneel.js diff --git a/examples/leaves.js b/script-archive/leaves.js similarity index 100% rename from examples/leaves.js rename to script-archive/leaves.js diff --git a/examples/libraries/avatarRelativeOverlays.js b/script-archive/libraries/avatarRelativeOverlays.js similarity index 100% rename from examples/libraries/avatarRelativeOverlays.js rename to script-archive/libraries/avatarRelativeOverlays.js diff --git a/examples/libraries/constants.js b/script-archive/libraries/constants.js similarity index 100% rename from examples/libraries/constants.js rename to script-archive/libraries/constants.js diff --git a/examples/libraries/easyStar.js b/script-archive/libraries/easyStar.js similarity index 100% rename from examples/libraries/easyStar.js rename to script-archive/libraries/easyStar.js diff --git a/examples/libraries/easyStarExample.js b/script-archive/libraries/easyStarExample.js similarity index 100% rename from examples/libraries/easyStarExample.js rename to script-archive/libraries/easyStarExample.js diff --git a/examples/libraries/fjs.js b/script-archive/libraries/fjs.js similarity index 100% rename from examples/libraries/fjs.js rename to script-archive/libraries/fjs.js diff --git a/examples/libraries/fjsExample.js b/script-archive/libraries/fjsExample.js similarity index 100% rename from examples/libraries/fjsExample.js rename to script-archive/libraries/fjsExample.js diff --git a/examples/libraries/highlighter.js b/script-archive/libraries/highlighter.js similarity index 100% rename from examples/libraries/highlighter.js rename to script-archive/libraries/highlighter.js diff --git a/examples/libraries/htmlColors.js b/script-archive/libraries/htmlColors.js similarity index 100% rename from examples/libraries/htmlColors.js rename to script-archive/libraries/htmlColors.js diff --git a/examples/libraries/httpMultiPart.js b/script-archive/libraries/httpMultiPart.js similarity index 100% rename from examples/libraries/httpMultiPart.js rename to script-archive/libraries/httpMultiPart.js diff --git a/examples/libraries/line.js b/script-archive/libraries/line.js similarity index 100% rename from examples/libraries/line.js rename to script-archive/libraries/line.js diff --git a/examples/libraries/omniTool.js b/script-archive/libraries/omniTool.js similarity index 100% rename from examples/libraries/omniTool.js rename to script-archive/libraries/omniTool.js diff --git a/examples/libraries/omniTool/models/invisibleWand.js b/script-archive/libraries/omniTool/models/invisibleWand.js similarity index 100% rename from examples/libraries/omniTool/models/invisibleWand.js rename to script-archive/libraries/omniTool/models/invisibleWand.js diff --git a/examples/libraries/omniTool/models/modelBase.js b/script-archive/libraries/omniTool/models/modelBase.js similarity index 100% rename from examples/libraries/omniTool/models/modelBase.js rename to script-archive/libraries/omniTool/models/modelBase.js diff --git a/examples/libraries/omniTool/models/wand.js b/script-archive/libraries/omniTool/models/wand.js similarity index 100% rename from examples/libraries/omniTool/models/wand.js rename to script-archive/libraries/omniTool/models/wand.js diff --git a/examples/libraries/omniTool/modules/breakdanceOmniToolModule.js b/script-archive/libraries/omniTool/modules/breakdanceOmniToolModule.js similarity index 100% rename from examples/libraries/omniTool/modules/breakdanceOmniToolModule.js rename to script-archive/libraries/omniTool/modules/breakdanceOmniToolModule.js diff --git a/examples/libraries/omniTool/modules/test.js b/script-archive/libraries/omniTool/modules/test.js similarity index 100% rename from examples/libraries/omniTool/modules/test.js rename to script-archive/libraries/omniTool/modules/test.js diff --git a/examples/libraries/overlayManager.js b/script-archive/libraries/overlayManager.js similarity index 100% rename from examples/libraries/overlayManager.js rename to script-archive/libraries/overlayManager.js diff --git a/examples/libraries/promise.js b/script-archive/libraries/promise.js similarity index 100% rename from examples/libraries/promise.js rename to script-archive/libraries/promise.js diff --git a/examples/libraries/promiseExample.js b/script-archive/libraries/promiseExample.js similarity index 100% rename from examples/libraries/promiseExample.js rename to script-archive/libraries/promiseExample.js diff --git a/examples/libraries/tinyColor.js b/script-archive/libraries/tinyColor.js similarity index 100% rename from examples/libraries/tinyColor.js rename to script-archive/libraries/tinyColor.js diff --git a/examples/libraries/tween.js b/script-archive/libraries/tween.js similarity index 100% rename from examples/libraries/tween.js rename to script-archive/libraries/tween.js diff --git a/examples/libraries/uiwidgets.js b/script-archive/libraries/uiwidgets.js similarity index 100% rename from examples/libraries/uiwidgets.js rename to script-archive/libraries/uiwidgets.js diff --git a/examples/libraries/unitTest.js b/script-archive/libraries/unitTest.js similarity index 100% rename from examples/libraries/unitTest.js rename to script-archive/libraries/unitTest.js diff --git a/examples/libraries/usertiming.js b/script-archive/libraries/usertiming.js similarity index 100% rename from examples/libraries/usertiming.js rename to script-archive/libraries/usertiming.js diff --git a/examples/libraries/usertimingExample.js b/script-archive/libraries/usertimingExample.js similarity index 100% rename from examples/libraries/usertimingExample.js rename to script-archive/libraries/usertimingExample.js diff --git a/examples/libraries/virtualKeyboard.js b/script-archive/libraries/virtualKeyboard.js similarity index 100% rename from examples/libraries/virtualKeyboard.js rename to script-archive/libraries/virtualKeyboard.js diff --git a/examples/libraries/walkApi.js b/script-archive/libraries/walkApi.js similarity index 100% rename from examples/libraries/walkApi.js rename to script-archive/libraries/walkApi.js diff --git a/examples/libraries/walkConstants.js b/script-archive/libraries/walkConstants.js similarity index 100% rename from examples/libraries/walkConstants.js rename to script-archive/libraries/walkConstants.js diff --git a/examples/libraries/walkFilters.js b/script-archive/libraries/walkFilters.js similarity index 100% rename from examples/libraries/walkFilters.js rename to script-archive/libraries/walkFilters.js diff --git a/examples/libraries/walkSettings.js b/script-archive/libraries/walkSettings.js similarity index 100% rename from examples/libraries/walkSettings.js rename to script-archive/libraries/walkSettings.js diff --git a/examples/light_modifier/README.md b/script-archive/light_modifier/README.md similarity index 100% rename from examples/light_modifier/README.md rename to script-archive/light_modifier/README.md diff --git a/examples/light_modifier/closeButton.js b/script-archive/light_modifier/closeButton.js similarity index 100% rename from examples/light_modifier/closeButton.js rename to script-archive/light_modifier/closeButton.js diff --git a/examples/light_modifier/lightLoader.js b/script-archive/light_modifier/lightLoader.js similarity index 100% rename from examples/light_modifier/lightLoader.js rename to script-archive/light_modifier/lightLoader.js diff --git a/examples/light_modifier/lightModifier.js b/script-archive/light_modifier/lightModifier.js similarity index 100% rename from examples/light_modifier/lightModifier.js rename to script-archive/light_modifier/lightModifier.js diff --git a/examples/light_modifier/lightModifierTestScene.js b/script-archive/light_modifier/lightModifierTestScene.js similarity index 100% rename from examples/light_modifier/lightModifierTestScene.js rename to script-archive/light_modifier/lightModifierTestScene.js diff --git a/examples/light_modifier/lightParent.js b/script-archive/light_modifier/lightParent.js similarity index 100% rename from examples/light_modifier/lightParent.js rename to script-archive/light_modifier/lightParent.js diff --git a/examples/light_modifier/slider.js b/script-archive/light_modifier/slider.js similarity index 100% rename from examples/light_modifier/slider.js rename to script-archive/light_modifier/slider.js diff --git a/examples/light_modifier/visiblePanel.js b/script-archive/light_modifier/visiblePanel.js similarity index 100% rename from examples/light_modifier/visiblePanel.js rename to script-archive/light_modifier/visiblePanel.js diff --git a/examples/lineRider.js b/script-archive/lineRider.js similarity index 100% rename from examples/lineRider.js rename to script-archive/lineRider.js diff --git a/examples/lobby.js b/script-archive/lobby.js similarity index 100% rename from examples/lobby.js rename to script-archive/lobby.js diff --git a/examples/lotsoBlocks.js b/script-archive/lotsoBlocks.js similarity index 100% rename from examples/lotsoBlocks.js rename to script-archive/lotsoBlocks.js diff --git a/examples/magBalls.js b/script-archive/magBalls.js similarity index 100% rename from examples/magBalls.js rename to script-archive/magBalls.js diff --git a/examples/magBalls/constants.js b/script-archive/magBalls/constants.js similarity index 100% rename from examples/magBalls/constants.js rename to script-archive/magBalls/constants.js diff --git a/examples/magBalls/debugUtils.js b/script-archive/magBalls/debugUtils.js similarity index 100% rename from examples/magBalls/debugUtils.js rename to script-archive/magBalls/debugUtils.js diff --git a/examples/magBalls/edgeSpring.js b/script-archive/magBalls/edgeSpring.js similarity index 100% rename from examples/magBalls/edgeSpring.js rename to script-archive/magBalls/edgeSpring.js diff --git a/examples/magBalls/graph.js b/script-archive/magBalls/graph.js similarity index 100% rename from examples/magBalls/graph.js rename to script-archive/magBalls/graph.js diff --git a/examples/magBalls/magBalls.js b/script-archive/magBalls/magBalls.js similarity index 100% rename from examples/magBalls/magBalls.js rename to script-archive/magBalls/magBalls.js diff --git a/examples/marketplace/S3Server/Procfile b/script-archive/marketplace/S3Server/Procfile similarity index 100% rename from examples/marketplace/S3Server/Procfile rename to script-archive/marketplace/S3Server/Procfile diff --git a/examples/marketplace/S3Server/index.js b/script-archive/marketplace/S3Server/index.js similarity index 100% rename from examples/marketplace/S3Server/index.js rename to script-archive/marketplace/S3Server/index.js diff --git a/examples/marketplace/S3Server/package.json b/script-archive/marketplace/S3Server/package.json similarity index 100% rename from examples/marketplace/S3Server/package.json rename to script-archive/marketplace/S3Server/package.json diff --git a/examples/marketplace/dynamicLoader.js b/script-archive/marketplace/dynamicLoader.js similarity index 100% rename from examples/marketplace/dynamicLoader.js rename to script-archive/marketplace/dynamicLoader.js diff --git a/examples/mouseLook.js b/script-archive/mouseLook.js similarity index 100% rename from examples/mouseLook.js rename to script-archive/mouseLook.js diff --git a/examples/move.js b/script-archive/move.js similarity index 100% rename from examples/move.js rename to script-archive/move.js diff --git a/examples/moving-platform.js b/script-archive/moving-platform.js similarity index 100% rename from examples/moving-platform.js rename to script-archive/moving-platform.js diff --git a/examples/painting/closePaint.js b/script-archive/painting/closePaint.js similarity index 100% rename from examples/painting/closePaint.js rename to script-archive/painting/closePaint.js diff --git a/examples/painting/paint.js b/script-archive/painting/paint.js similarity index 100% rename from examples/painting/paint.js rename to script-archive/painting/paint.js diff --git a/examples/painting/whiteboard/blackInk.fs b/script-archive/painting/whiteboard/blackInk.fs similarity index 100% rename from examples/painting/whiteboard/blackInk.fs rename to script-archive/painting/whiteboard/blackInk.fs diff --git a/examples/painting/whiteboard/colorIndicatorEntityScript.js b/script-archive/painting/whiteboard/colorIndicatorEntityScript.js similarity index 100% rename from examples/painting/whiteboard/colorIndicatorEntityScript.js rename to script-archive/painting/whiteboard/colorIndicatorEntityScript.js diff --git a/examples/painting/whiteboard/colorSelectorEntityScript.js b/script-archive/painting/whiteboard/colorSelectorEntityScript.js similarity index 100% rename from examples/painting/whiteboard/colorSelectorEntityScript.js rename to script-archive/painting/whiteboard/colorSelectorEntityScript.js diff --git a/examples/painting/whiteboard/eraseBoardEntityScript.js b/script-archive/painting/whiteboard/eraseBoardEntityScript.js similarity index 100% rename from examples/painting/whiteboard/eraseBoardEntityScript.js rename to script-archive/painting/whiteboard/eraseBoardEntityScript.js diff --git a/examples/painting/whiteboard/whiteboardEntityScript.js b/script-archive/painting/whiteboard/whiteboardEntityScript.js similarity index 100% rename from examples/painting/whiteboard/whiteboardEntityScript.js rename to script-archive/painting/whiteboard/whiteboardEntityScript.js diff --git a/examples/painting/whiteboard/whiteboardSpawner.js b/script-archive/painting/whiteboard/whiteboardSpawner.js similarity index 100% rename from examples/painting/whiteboard/whiteboardSpawner.js rename to script-archive/painting/whiteboard/whiteboardSpawner.js diff --git a/examples/particleDance.js b/script-archive/particleDance.js similarity index 100% rename from examples/particleDance.js rename to script-archive/particleDance.js diff --git a/examples/particles.js b/script-archive/particles.js similarity index 100% rename from examples/particles.js rename to script-archive/particles.js diff --git a/examples/planets.js b/script-archive/planets.js similarity index 100% rename from examples/planets.js rename to script-archive/planets.js diff --git a/examples/playTestSound.js b/script-archive/playTestSound.js similarity index 100% rename from examples/playTestSound.js rename to script-archive/playTestSound.js diff --git a/examples/playa/fireworks/fireworksLaunchButtonEntityScript.js b/script-archive/playa/fireworks/fireworksLaunchButtonEntityScript.js similarity index 100% rename from examples/playa/fireworks/fireworksLaunchButtonEntityScript.js rename to script-archive/playa/fireworks/fireworksLaunchButtonEntityScript.js diff --git a/examples/playa/fireworks/fireworksLaunchButtonSpawner.js b/script-archive/playa/fireworks/fireworksLaunchButtonSpawner.js similarity index 100% rename from examples/playa/fireworks/fireworksLaunchButtonSpawner.js rename to script-archive/playa/fireworks/fireworksLaunchButtonSpawner.js diff --git a/examples/playa/playaSpawner.js b/script-archive/playa/playaSpawner.js similarity index 100% rename from examples/playa/playaSpawner.js rename to script-archive/playa/playaSpawner.js diff --git a/examples/pointer.js b/script-archive/pointer.js similarity index 100% rename from examples/pointer.js rename to script-archive/pointer.js diff --git a/examples/popcorn.js b/script-archive/popcorn.js similarity index 100% rename from examples/popcorn.js rename to script-archive/popcorn.js diff --git a/examples/rayPickingFilterExample.js b/script-archive/rayPickingFilterExample.js similarity index 100% rename from examples/rayPickingFilterExample.js rename to script-archive/rayPickingFilterExample.js diff --git a/examples/shaders/example.fs b/script-archive/shaders/example.fs similarity index 100% rename from examples/shaders/example.fs rename to script-archive/shaders/example.fs diff --git a/examples/shaders/exampleFloor.fs b/script-archive/shaders/exampleFloor.fs similarity index 100% rename from examples/shaders/exampleFloor.fs rename to script-archive/shaders/exampleFloor.fs diff --git a/examples/shaders/exampleSkyboxUserDataV2.json b/script-archive/shaders/exampleSkyboxUserDataV2.json similarity index 100% rename from examples/shaders/exampleSkyboxUserDataV2.json rename to script-archive/shaders/exampleSkyboxUserDataV2.json diff --git a/examples/shaders/exampleSphere.fs b/script-archive/shaders/exampleSphere.fs similarity index 100% rename from examples/shaders/exampleSphere.fs rename to script-archive/shaders/exampleSphere.fs diff --git a/examples/shaders/exampleSphereDisco.fs b/script-archive/shaders/exampleSphereDisco.fs similarity index 100% rename from examples/shaders/exampleSphereDisco.fs rename to script-archive/shaders/exampleSphereDisco.fs diff --git a/examples/shaders/exampleUserDataV2.json b/script-archive/shaders/exampleUserDataV2.json similarity index 100% rename from examples/shaders/exampleUserDataV2.json rename to script-archive/shaders/exampleUserDataV2.json diff --git a/examples/shaders/exampleV2.fs b/script-archive/shaders/exampleV2.fs similarity index 100% rename from examples/shaders/exampleV2.fs rename to script-archive/shaders/exampleV2.fs diff --git a/examples/shaders/grid.fs b/script-archive/shaders/grid.fs similarity index 100% rename from examples/shaders/grid.fs rename to script-archive/shaders/grid.fs diff --git a/examples/shaders/hex.fs b/script-archive/shaders/hex.fs similarity index 100% rename from examples/shaders/hex.fs rename to script-archive/shaders/hex.fs diff --git a/examples/shaders/noise.fs b/script-archive/shaders/noise.fs similarity index 100% rename from examples/shaders/noise.fs rename to script-archive/shaders/noise.fs diff --git a/examples/shaders/rainyDayNightSkybox.fs b/script-archive/shaders/rainyDayNightSkybox.fs similarity index 100% rename from examples/shaders/rainyDayNightSkybox.fs rename to script-archive/shaders/rainyDayNightSkybox.fs diff --git a/examples/shaders/scratch.fs b/script-archive/shaders/scratch.fs similarity index 100% rename from examples/shaders/scratch.fs rename to script-archive/shaders/scratch.fs diff --git a/examples/shaders/shadertoyWrapper.fs b/script-archive/shaders/shadertoyWrapper.fs similarity index 100% rename from examples/shaders/shadertoyWrapper.fs rename to script-archive/shaders/shadertoyWrapper.fs diff --git a/examples/shaders/shadertoys/clock.fs b/script-archive/shaders/shadertoys/clock.fs similarity index 100% rename from examples/shaders/shadertoys/clock.fs rename to script-archive/shaders/shadertoys/clock.fs diff --git a/examples/shaders/shadertoys/relentless.fs b/script-archive/shaders/shadertoys/relentless.fs similarity index 100% rename from examples/shaders/shadertoys/relentless.fs rename to script-archive/shaders/shadertoys/relentless.fs diff --git a/examples/shaders/shadertoys/relentlessSkybox.fs b/script-archive/shaders/shadertoys/relentlessSkybox.fs similarity index 100% rename from examples/shaders/shadertoys/relentlessSkybox.fs rename to script-archive/shaders/shadertoys/relentlessSkybox.fs diff --git a/examples/shaders/shadertoys/topologica.fs b/script-archive/shaders/shadertoys/topologica.fs similarity index 100% rename from examples/shaders/shadertoys/topologica.fs rename to script-archive/shaders/shadertoys/topologica.fs diff --git a/examples/shaders/test.fs b/script-archive/shaders/test.fs similarity index 100% rename from examples/shaders/test.fs rename to script-archive/shaders/test.fs diff --git a/examples/sit.js b/script-archive/sit.js similarity index 100% rename from examples/sit.js rename to script-archive/sit.js diff --git a/examples/stick-hydra.js b/script-archive/stick-hydra.js similarity index 100% rename from examples/stick-hydra.js rename to script-archive/stick-hydra.js diff --git a/examples/stick.js b/script-archive/stick.js similarity index 100% rename from examples/stick.js rename to script-archive/stick.js diff --git a/examples/tPose.js b/script-archive/tPose.js similarity index 100% rename from examples/tPose.js rename to script-archive/tPose.js diff --git a/examples/tests/performance/renderableMatrix.js b/script-archive/tests/performance/renderableMatrix.js similarity index 100% rename from examples/tests/performance/renderableMatrix.js rename to script-archive/tests/performance/renderableMatrix.js diff --git a/examples/tests/playbackAcTest.js b/script-archive/tests/playbackAcTest.js similarity index 100% rename from examples/tests/playbackAcTest.js rename to script-archive/tests/playbackAcTest.js diff --git a/examples/tests/qmlWebTest.js b/script-archive/tests/qmlWebTest.js similarity index 100% rename from examples/tests/qmlWebTest.js rename to script-archive/tests/qmlWebTest.js diff --git a/examples/theBird.js b/script-archive/theBird.js similarity index 100% rename from examples/theBird.js rename to script-archive/theBird.js diff --git a/examples/tutorials/fireworks/chapter1/fireworksLaunchButtonEntityScript.js b/script-archive/tutorials/fireworks/chapter1/fireworksLaunchButtonEntityScript.js similarity index 100% rename from examples/tutorials/fireworks/chapter1/fireworksLaunchButtonEntityScript.js rename to script-archive/tutorials/fireworks/chapter1/fireworksLaunchButtonEntityScript.js diff --git a/examples/tutorials/fireworks/chapter1/fireworksLaunchButtonSpawner.js b/script-archive/tutorials/fireworks/chapter1/fireworksLaunchButtonSpawner.js similarity index 100% rename from examples/tutorials/fireworks/chapter1/fireworksLaunchButtonSpawner.js rename to script-archive/tutorials/fireworks/chapter1/fireworksLaunchButtonSpawner.js diff --git a/examples/tutorials/fireworks/chapter2/fireworksLaunchButtonEntityScript.js b/script-archive/tutorials/fireworks/chapter2/fireworksLaunchButtonEntityScript.js similarity index 100% rename from examples/tutorials/fireworks/chapter2/fireworksLaunchButtonEntityScript.js rename to script-archive/tutorials/fireworks/chapter2/fireworksLaunchButtonEntityScript.js diff --git a/examples/tutorials/fireworks/chapter2/fireworksLaunchButtonSpawner.js b/script-archive/tutorials/fireworks/chapter2/fireworksLaunchButtonSpawner.js similarity index 100% rename from examples/tutorials/fireworks/chapter2/fireworksLaunchButtonSpawner.js rename to script-archive/tutorials/fireworks/chapter2/fireworksLaunchButtonSpawner.js diff --git a/examples/tutorials/fireworks/chapter3/fireworksLaunchButtonEntityScript.js b/script-archive/tutorials/fireworks/chapter3/fireworksLaunchButtonEntityScript.js similarity index 100% rename from examples/tutorials/fireworks/chapter3/fireworksLaunchButtonEntityScript.js rename to script-archive/tutorials/fireworks/chapter3/fireworksLaunchButtonEntityScript.js diff --git a/examples/tutorials/fireworks/chapter3/fireworksLaunchButtonSpawner.js b/script-archive/tutorials/fireworks/chapter3/fireworksLaunchButtonSpawner.js similarity index 100% rename from examples/tutorials/fireworks/chapter3/fireworksLaunchButtonSpawner.js rename to script-archive/tutorials/fireworks/chapter3/fireworksLaunchButtonSpawner.js diff --git a/examples/utilities/diagnostics/inWorldTestTone.js b/script-archive/utilities/diagnostics/inWorldTestTone.js similarity index 100% rename from examples/utilities/diagnostics/inWorldTestTone.js rename to script-archive/utilities/diagnostics/inWorldTestTone.js diff --git a/examples/utilities/diagnostics/moveJoints.js b/script-archive/utilities/diagnostics/moveJoints.js similarity index 100% rename from examples/utilities/diagnostics/moveJoints.js rename to script-archive/utilities/diagnostics/moveJoints.js diff --git a/examples/utilities/diagnostics/orbitingSound.js b/script-archive/utilities/diagnostics/orbitingSound.js similarity index 100% rename from examples/utilities/diagnostics/orbitingSound.js rename to script-archive/utilities/diagnostics/orbitingSound.js diff --git a/examples/utilities/diagnostics/playSoundLoop.js b/script-archive/utilities/diagnostics/playSoundLoop.js similarity index 100% rename from examples/utilities/diagnostics/playSoundLoop.js rename to script-archive/utilities/diagnostics/playSoundLoop.js diff --git a/examples/utilities/diagnostics/playSoundWave.js b/script-archive/utilities/diagnostics/playSoundWave.js similarity index 100% rename from examples/utilities/diagnostics/playSoundWave.js rename to script-archive/utilities/diagnostics/playSoundWave.js diff --git a/examples/utilities/tools/cookies.js b/script-archive/utilities/tools/cookies.js similarity index 100% rename from examples/utilities/tools/cookies.js rename to script-archive/utilities/tools/cookies.js diff --git a/examples/utilities/tools/crazylegs.js b/script-archive/utilities/tools/crazylegs.js similarity index 100% rename from examples/utilities/tools/crazylegs.js rename to script-archive/utilities/tools/crazylegs.js diff --git a/examples/utilities/tools/vector.js b/script-archive/utilities/tools/vector.js similarity index 100% rename from examples/utilities/tools/vector.js rename to script-archive/utilities/tools/vector.js diff --git a/examples/vrShop/README.txt b/script-archive/vrShop/README.txt similarity index 100% rename from examples/vrShop/README.txt rename to script-archive/vrShop/README.txt diff --git a/examples/vrShop/cart/shopCartEntityScript.js b/script-archive/vrShop/cart/shopCartEntityScript.js similarity index 100% rename from examples/vrShop/cart/shopCartEntityScript.js rename to script-archive/vrShop/cart/shopCartEntityScript.js diff --git a/examples/vrShop/cart/shopCartSpawnEntityScript.js b/script-archive/vrShop/cart/shopCartSpawnEntityScript.js similarity index 100% rename from examples/vrShop/cart/shopCartSpawnEntityScript.js rename to script-archive/vrShop/cart/shopCartSpawnEntityScript.js diff --git a/examples/vrShop/cart/shopCartZeroEntityScript.js b/script-archive/vrShop/cart/shopCartZeroEntityScript.js similarity index 100% rename from examples/vrShop/cart/shopCartZeroEntityScript.js rename to script-archive/vrShop/cart/shopCartZeroEntityScript.js diff --git a/examples/vrShop/cash/shopCashEntityScript.js b/script-archive/vrShop/cash/shopCashEntityScript.js similarity index 100% rename from examples/vrShop/cash/shopCashEntityScript.js rename to script-archive/vrShop/cash/shopCashEntityScript.js diff --git a/examples/vrShop/cash/shopCashRegisterEntityScript.js b/script-archive/vrShop/cash/shopCashRegisterEntityScript.js similarity index 100% rename from examples/vrShop/cash/shopCashRegisterEntityScript.js rename to script-archive/vrShop/cash/shopCashRegisterEntityScript.js diff --git a/examples/vrShop/cash/shopCashierAC.js b/script-archive/vrShop/cash/shopCashierAC.js similarity index 100% rename from examples/vrShop/cash/shopCashierAC.js rename to script-archive/vrShop/cash/shopCashierAC.js diff --git a/examples/vrShop/cash/shopCreditCardEntityScript.js b/script-archive/vrShop/cash/shopCreditCardEntityScript.js similarity index 100% rename from examples/vrShop/cash/shopCreditCardEntityScript.js rename to script-archive/vrShop/cash/shopCreditCardEntityScript.js diff --git a/examples/vrShop/inspect/shopInspectEntityScript.js b/script-archive/vrShop/inspect/shopInspectEntityScript.js similarity index 100% rename from examples/vrShop/inspect/shopInspectEntityScript.js rename to script-archive/vrShop/inspect/shopInspectEntityScript.js diff --git a/examples/vrShop/item/shopItemEntityScript.js b/script-archive/vrShop/item/shopItemEntityScript.js similarity index 100% rename from examples/vrShop/item/shopItemEntityScript.js rename to script-archive/vrShop/item/shopItemEntityScript.js diff --git a/examples/vrShop/item/shopItemGrab.js b/script-archive/vrShop/item/shopItemGrab.js similarity index 100% rename from examples/vrShop/item/shopItemGrab.js rename to script-archive/vrShop/item/shopItemGrab.js diff --git a/examples/vrShop/review/shopReviewEntityScript.js b/script-archive/vrShop/review/shopReviewEntityScript.js similarity index 100% rename from examples/vrShop/review/shopReviewEntityScript.js rename to script-archive/vrShop/review/shopReviewEntityScript.js diff --git a/examples/vrShop/review/shopReviewerAC.js b/script-archive/vrShop/review/shopReviewerAC.js similarity index 100% rename from examples/vrShop/review/shopReviewerAC.js rename to script-archive/vrShop/review/shopReviewerAC.js diff --git a/examples/vrShop/shop/shopGrabSwapperEntityScript.js b/script-archive/vrShop/shop/shopGrabSwapperEntityScript.js similarity index 100% rename from examples/vrShop/shop/shopGrabSwapperEntityScript.js rename to script-archive/vrShop/shop/shopGrabSwapperEntityScript.js diff --git a/examples/vrShop/vendor/shopVendorAddItem.js b/script-archive/vrShop/vendor/shopVendorAddItem.js similarity index 100% rename from examples/vrShop/vendor/shopVendorAddItem.js rename to script-archive/vrShop/vendor/shopVendorAddItem.js diff --git a/examples/walk.js b/script-archive/walk.js similarity index 100% rename from examples/walk.js rename to script-archive/walk.js diff --git a/examples/weapons/shootingRangeSpawner.js b/script-archive/weapons/shootingRangeSpawner.js similarity index 100% rename from examples/weapons/shootingRangeSpawner.js rename to script-archive/weapons/shootingRangeSpawner.js diff --git a/examples/winterSmashUp/targetPractice/shooterPlatform.js b/script-archive/winterSmashUp/targetPractice/shooterPlatform.js similarity index 100% rename from examples/winterSmashUp/targetPractice/shooterPlatform.js rename to script-archive/winterSmashUp/targetPractice/shooterPlatform.js diff --git a/examples/winterSmashUp/targetPractice/startTargetPractice.js b/script-archive/winterSmashUp/targetPractice/startTargetPractice.js similarity index 100% rename from examples/winterSmashUp/targetPractice/startTargetPractice.js rename to script-archive/winterSmashUp/targetPractice/startTargetPractice.js diff --git a/examples/winterSmashUp/targetPractice/targetPracticeGame.js b/script-archive/winterSmashUp/targetPractice/targetPracticeGame.js similarity index 100% rename from examples/winterSmashUp/targetPractice/targetPracticeGame.js rename to script-archive/winterSmashUp/targetPractice/targetPracticeGame.js diff --git a/examples/zones/RainyDayNightZone.json b/script-archive/zones/RainyDayNightZone.json similarity index 100% rename from examples/zones/RainyDayNightZone.json rename to script-archive/zones/RainyDayNightZone.json diff --git a/examples/zones/jsstreamplayerdomain-zone-entity.js b/script-archive/zones/jsstreamplayerdomain-zone-entity.js similarity index 100% rename from examples/zones/jsstreamplayerdomain-zone-entity.js rename to script-archive/zones/jsstreamplayerdomain-zone-entity.js diff --git a/examples/zones/jsstreamplayerdomain-zone.html b/script-archive/zones/jsstreamplayerdomain-zone.html similarity index 100% rename from examples/zones/jsstreamplayerdomain-zone.html rename to script-archive/zones/jsstreamplayerdomain-zone.html diff --git a/examples/zones/jsstreamplayerdomain-zone.js b/script-archive/zones/jsstreamplayerdomain-zone.js similarity index 100% rename from examples/zones/jsstreamplayerdomain-zone.js rename to script-archive/zones/jsstreamplayerdomain-zone.js diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js new file mode 100644 index 0000000000..3772fd51e9 --- /dev/null +++ b/scripts/defaultScripts.js @@ -0,0 +1,23 @@ +// +// defaultScripts.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +Script.load("system/away.js"); +Script.load("system/progress.js"); +Script.load("system/edit.js"); +Script.load("system/examples.js"); +Script.load("system/selectAudioDevice.js"); +Script.load("system/notifications.js"); +Script.load("system/controllers/handControllerGrab.js"); +Script.load("system/controllers/squeezeHands.js"); +Script.load("system/controllers/grab.js"); +Script.load("system/directory.js"); +Script.load("system/dialTone.js"); +// Script.load("attachedEntitiesManager.js"); +Script.load("system/depthReticle.js"); \ No newline at end of file diff --git a/examples/debugging/actionInspector.js b/scripts/developer/debugging/actionInspector.js similarity index 88% rename from examples/debugging/actionInspector.js rename to scripts/developer/debugging/actionInspector.js index 303dcbebbd..71bf928d57 100644 --- a/examples/debugging/actionInspector.js +++ b/scripts/developer/debugging/actionInspector.js @@ -17,7 +17,7 @@ var overlays = {}; var toType = function(obj) { - return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() + return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() } @@ -50,7 +50,11 @@ function actionArgumentsToString(actionArguments) { function updateOverlay(entityID, actionText) { var properties = Entities.getEntityProperties(entityID, ["position", "dimensions"]); - var position = Vec3.sum(properties.position, {x:0, y:properties.dimensions.y, z:0}); + var position = Vec3.sum(properties.position, { + x: 0, + y: properties.dimensions.y, + z: 0 + }); // print("position: " + vec3toStr(position) + " " + actionText); if (entityID in overlays) { var overlay = overlays[entityID]; @@ -76,9 +80,20 @@ function updateOverlay(entityID, actionText) { overlays[entityID] = Overlays.addOverlay("text3d", { position: position, - dimensions: { x: textWidth, y: textHeight }, - backgroundColor: { red: 0, green: 0, blue: 0}, - color: { red: 255, green: 255, blue: 255}, + dimensions: { + x: textWidth, + y: textHeight + }, + backgroundColor: { + red: 0, + green: 0, + blue: 0 + }, + color: { + red: 255, + green: 255, + blue: 255 + }, topMargin: textMargin, leftMargin: textMargin, bottomMargin: textMargin, @@ -143,4 +158,4 @@ Script.setInterval(function() { }, 100); -Script.scriptEnding.connect(cleanup); +Script.scriptEnding.connect(cleanup); \ No newline at end of file diff --git a/examples/debugging/grabInspector.js b/scripts/developer/debugging/grabInspector.js similarity index 88% rename from examples/debugging/grabInspector.js rename to scripts/developer/debugging/grabInspector.js index 6b6dfc5d69..35993194ea 100644 --- a/examples/debugging/grabInspector.js +++ b/scripts/developer/debugging/grabInspector.js @@ -37,7 +37,7 @@ function grabDataToString(grabData) { argString = arg.toFixed(2); } result += argumentName + ": " - // + toType(arg) + " -- " + // + toType(arg) + " -- " + argString + "\n"; } } @@ -49,7 +49,11 @@ function grabDataToString(grabData) { function updateOverlay(entityID, grabText) { var properties = Entities.getEntityProperties(entityID, ["position", "dimensions"]); - var position = Vec3.sum(properties.position, {x:0, y:properties.dimensions.y, z:0}); + var position = Vec3.sum(properties.position, { + x: 0, + y: properties.dimensions.y, + z: 0 + }); if (entityID in overlays) { var overlay = overlays[entityID]; Overlays.editOverlay(overlay, { @@ -74,9 +78,20 @@ function updateOverlay(entityID, grabText) { overlays[entityID] = Overlays.addOverlay("text3d", { position: position, - dimensions: { x: textWidth, y: textHeight }, - backgroundColor: { red: 0, green: 0, blue: 0}, - color: { red: 255, green: 255, blue: 255}, + dimensions: { + x: textWidth, + y: textHeight + }, + backgroundColor: { + red: 0, + green: 0, + blue: 0 + }, + color: { + red: 255, + green: 255, + blue: 255 + }, topMargin: textMargin, leftMargin: textMargin, bottomMargin: textMargin, @@ -134,4 +149,4 @@ Script.setInterval(function() { }, 100); -Script.scriptEnding.connect(cleanup); +Script.scriptEnding.connect(cleanup); \ No newline at end of file diff --git a/examples/debugging/queryAACubeInspector.js b/scripts/developer/debugging/queryAACubeInspector.js similarity index 81% rename from examples/debugging/queryAACubeInspector.js rename to scripts/developer/debugging/queryAACubeInspector.js index 2735617bc1..2d585ffce4 100644 --- a/examples/debugging/queryAACubeInspector.js +++ b/scripts/developer/debugging/queryAACubeInspector.js @@ -18,9 +18,11 @@ var INSPECT_RADIUS = 10; var overlays = {}; function updateOverlay(entityID, queryAACube) { - var cubeCenter = {x: queryAACube.x + queryAACube.scale / 2.0, - y: queryAACube.y + queryAACube.scale / 2.0, - z: queryAACube.z + queryAACube.scale / 2.0}; + var cubeCenter = { + x: queryAACube.x + queryAACube.scale / 2.0, + y: queryAACube.y + queryAACube.scale / 2.0, + z: queryAACube.z + queryAACube.scale / 2.0 + }; if (entityID in overlays) { var overlay = overlays[entityID]; @@ -32,7 +34,11 @@ function updateOverlay(entityID, queryAACube) { overlays[entityID] = Overlays.addOverlay("cube", { position: cubeCenter, size: queryAACube.scale, - color: { red: 0, green: 0, blue: 255}, + color: { + red: 0, + green: 0, + blue: 255 + }, alpha: 1, // borderSize: ..., solid: false @@ -55,4 +61,4 @@ function cleanup() { } } -Script.scriptEnding.connect(cleanup); +Script.scriptEnding.connect(cleanup); \ No newline at end of file diff --git a/examples/libraries/jasmine/hifi-boot.js b/scripts/developer/libraries/jasmine/hifi-boot.js similarity index 100% rename from examples/libraries/jasmine/hifi-boot.js rename to scripts/developer/libraries/jasmine/hifi-boot.js diff --git a/examples/libraries/jasmine/jasmine.js b/scripts/developer/libraries/jasmine/jasmine.js similarity index 100% rename from examples/libraries/jasmine/jasmine.js rename to scripts/developer/libraries/jasmine/jasmine.js diff --git a/examples/libraries/utils.js b/scripts/developer/libraries/utils.js similarity index 100% rename from examples/libraries/utils.js rename to scripts/developer/libraries/utils.js diff --git a/examples/libraries/virtualBaton.js b/scripts/developer/libraries/virtualBaton.js similarity index 100% rename from examples/libraries/virtualBaton.js rename to scripts/developer/libraries/virtualBaton.js diff --git a/examples/tests/avatarAttachmentTest.js b/scripts/developer/tests/avatarAttachmentTest.js similarity index 100% rename from examples/tests/avatarAttachmentTest.js rename to scripts/developer/tests/avatarAttachmentTest.js diff --git a/examples/tests/avatarUnitTests.js b/scripts/developer/tests/avatarUnitTests.js similarity index 100% rename from examples/tests/avatarUnitTests.js rename to scripts/developer/tests/avatarUnitTests.js diff --git a/examples/tests/basicEntityTest/entitySpawner.js b/scripts/developer/tests/basicEntityTest/entitySpawner.js similarity index 100% rename from examples/tests/basicEntityTest/entitySpawner.js rename to scripts/developer/tests/basicEntityTest/entitySpawner.js diff --git a/examples/tests/basicEntityTest/myEntityScript.js b/scripts/developer/tests/basicEntityTest/myEntityScript.js similarity index 84% rename from examples/tests/basicEntityTest/myEntityScript.js rename to scripts/developer/tests/basicEntityTest/myEntityScript.js index b4a8885c70..17d9f0c0aa 100644 --- a/examples/tests/basicEntityTest/myEntityScript.js +++ b/scripts/developer/tests/basicEntityTest/myEntityScript.js @@ -1,22 +1,21 @@ - (function() { + var _this; + MyEntity = function() { _this = this; - + }; MyEntity.prototype = { - preload: function(entityID) { this.entityID = entityID; var randNum = Math.random().toFixed(3); - print("EBL PRELOAD ENTITY SCRIPT!!!", randNum) + print("PRELOAD ENTITY SCRIPT!!!", randNum) }, - }; // entity scripts always need to return a newly constructed object of our type diff --git a/examples/tests/batonSoundEntityTest/batonSoundTestEntityScript.js b/scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntityScript.js similarity index 100% rename from examples/tests/batonSoundEntityTest/batonSoundTestEntityScript.js rename to scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntityScript.js diff --git a/examples/tests/batonSoundEntityTest/batonSoundTestEntitySpawner.js b/scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntitySpawner.js similarity index 100% rename from examples/tests/batonSoundEntityTest/batonSoundTestEntitySpawner.js rename to scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntitySpawner.js diff --git a/examples/tests/controllerInterfaceTest.js b/scripts/developer/tests/controllerInterfaceTest.js similarity index 100% rename from examples/tests/controllerInterfaceTest.js rename to scripts/developer/tests/controllerInterfaceTest.js diff --git a/examples/tests/cube_texture.png b/scripts/developer/tests/cube_texture.png similarity index 100% rename from examples/tests/cube_texture.png rename to scripts/developer/tests/cube_texture.png diff --git a/examples/tests/dot.png b/scripts/developer/tests/dot.png similarity index 100% rename from examples/tests/dot.png rename to scripts/developer/tests/dot.png diff --git a/examples/tests/entityEditStressTest.js b/scripts/developer/tests/entityEditStressTest.js similarity index 100% rename from examples/tests/entityEditStressTest.js rename to scripts/developer/tests/entityEditStressTest.js diff --git a/examples/tests/injectorTest.js b/scripts/developer/tests/injectorTest.js similarity index 100% rename from examples/tests/injectorTest.js rename to scripts/developer/tests/injectorTest.js diff --git a/examples/tests/lodTest.js b/scripts/developer/tests/lodTest.js similarity index 100% rename from examples/tests/lodTest.js rename to scripts/developer/tests/lodTest.js diff --git a/examples/tests/mat4test.js b/scripts/developer/tests/mat4test.js similarity index 100% rename from examples/tests/mat4test.js rename to scripts/developer/tests/mat4test.js diff --git a/examples/tests/overlayMouseTrackingTest.js b/scripts/developer/tests/overlayMouseTrackingTest.js similarity index 100% rename from examples/tests/overlayMouseTrackingTest.js rename to scripts/developer/tests/overlayMouseTrackingTest.js diff --git a/examples/tests/particleOrientationTest.js b/scripts/developer/tests/particleOrientationTest.js similarity index 100% rename from examples/tests/particleOrientationTest.js rename to scripts/developer/tests/particleOrientationTest.js diff --git a/examples/tests/performance/consoleSpawner.js b/scripts/developer/tests/performance/consoleSpawner.js similarity index 100% rename from examples/tests/performance/consoleSpawner.js rename to scripts/developer/tests/performance/consoleSpawner.js diff --git a/examples/entityScripts/simpleKeepAway.js b/scripts/developer/tests/performance/keepAwayEntity.js similarity index 70% rename from examples/entityScripts/simpleKeepAway.js rename to scripts/developer/tests/performance/keepAwayEntity.js index 87beaa8794..b8f40523ba 100644 --- a/examples/entityScripts/simpleKeepAway.js +++ b/scripts/developer/tests/performance/keepAwayEntity.js @@ -1,24 +1,26 @@ -(function () { +(function() { // The attached entity will move away from you if you are too close, checking at distanceRate. // See tests/performance/simpleKeepAway.js var entityID, - distanceRate = 1, // hertz - distanceAllowance = 3, // meters - distanceScale = 0.5, // meters/second + distanceRate = 1, // hertz + distanceAllowance = 3, // meters + distanceScale = 0.5, // meters/second distanceTimer; - function moveDistance() { // every user checks their distance and tries to claim if close enough. + function moveDistance() { // every user checks their distance and tries to claim if close enough. var me = MyAvatar.position, ball = Entities.getEntityProperties(entityID, ['position']).position; ball.y = me.y; var vector = Vec3.subtract(ball, me); if (Vec3.length(vector) < distanceAllowance) { - Entities.editEntity(entityID, {velocity: Vec3.multiply(distanceScale, Vec3.normalize(vector))}); + Entities.editEntity(entityID, { + velocity: Vec3.multiply(distanceScale, Vec3.normalize(vector)) + }); } } - this.preload = function (givenEntityID) { + this.preload = function(givenEntityID) { var properties = Entities.getEntityProperties(givenEntityID, ['userData']), userData = properties.userData && JSON.parse(properties.userData); entityID = givenEntityID; @@ -31,7 +33,7 @@ // run all the time by everyone: distanceTimer = Script.setInterval(moveDistance, distanceRate); }; - this.unload = function () { + this.unload = function() { Script.clearTimeout(distanceTimer); }; -}) +}) \ No newline at end of file diff --git a/examples/tests/performance/simpleKeepAway.js b/scripts/developer/tests/performance/simpleKeepAway.js similarity index 98% rename from examples/tests/performance/simpleKeepAway.js rename to scripts/developer/tests/performance/simpleKeepAway.js index 05c0dd8159..9718600a9c 100644 --- a/examples/tests/performance/simpleKeepAway.js +++ b/scripts/developer/tests/performance/simpleKeepAway.js @@ -94,7 +94,7 @@ Script.setInterval(function () { gravity: GRAVITY, collisionsWillMove: true, lifetime: LIFETIME, - script: Script.resolvePath("../../entityScripts/simpleKeepAway.js") + script: Script.resolvePath("keepAwayEntity.js") }; Entities.addEntity(properties); totalCreated++; diff --git a/examples/tests/performance/staticEdits.js b/scripts/developer/tests/performance/staticEdits.js similarity index 100% rename from examples/tests/performance/staticEdits.js rename to scripts/developer/tests/performance/staticEdits.js diff --git a/examples/entityScripts/tribble.js b/scripts/developer/tests/performance/tribbleEntity.js similarity index 98% rename from examples/entityScripts/tribble.js rename to scripts/developer/tests/performance/tribbleEntity.js index 22990af1d1..78b88ca48e 100644 --- a/examples/entityScripts/tribble.js +++ b/scripts/developer/tests/performance/tribbleEntity.js @@ -1,6 +1,6 @@ (function () { // See tests/performance/tribbles.js - Script.include("../libraries/virtualBaton.js"); + Script.include("../../libraries/virtualBaton.js"); var dimensions, oldColor, entityID, editRate = 60, moveRate = 1, diff --git a/examples/tests/performance/tribbles.js b/scripts/developer/tests/performance/tribbles.js similarity index 97% rename from examples/tests/performance/tribbles.js rename to scripts/developer/tests/performance/tribbles.js index f4eef2ff1a..c9ae347a82 100644 --- a/examples/tests/performance/tribbles.js +++ b/scripts/developer/tests/performance/tribbles.js @@ -86,7 +86,7 @@ Script.setInterval(function () { gravity: GRAVITY, collisionsWillMove: true, lifetime: LIFETIME, - script: Script.resolvePath("../../entityScripts/tribble.js") + script: Script.resolvePath("tribbleEntity.js") }); totalCreated++; diff --git a/examples/tests/playaPerformanceTest.js b/scripts/developer/tests/playaPerformanceTest.js similarity index 100% rename from examples/tests/playaPerformanceTest.js rename to scripts/developer/tests/playaPerformanceTest.js diff --git a/examples/tests/playaPerformanceTest.qml b/scripts/developer/tests/playaPerformanceTest.qml similarity index 99% rename from examples/tests/playaPerformanceTest.qml rename to scripts/developer/tests/playaPerformanceTest.qml index 6eb0061598..cd8171a0f6 100644 --- a/examples/tests/playaPerformanceTest.qml +++ b/scripts/developer/tests/playaPerformanceTest.qml @@ -220,4 +220,3 @@ Rectangle { } } - diff --git a/examples/tests/qmlTest.js b/scripts/developer/tests/qmlTest.js similarity index 100% rename from examples/tests/qmlTest.js rename to scripts/developer/tests/qmlTest.js diff --git a/examples/tests/rapidProceduralChange/rapidProceduralChangeTest.js b/scripts/developer/tests/rapidProceduralChange/rapidProceduralChangeTest.js similarity index 100% rename from examples/tests/rapidProceduralChange/rapidProceduralChangeTest.js rename to scripts/developer/tests/rapidProceduralChange/rapidProceduralChangeTest.js diff --git a/examples/tests/rapidProceduralChange/timerTest.fs b/scripts/developer/tests/rapidProceduralChange/timerTest.fs similarity index 100% rename from examples/tests/rapidProceduralChange/timerTest.fs rename to scripts/developer/tests/rapidProceduralChange/timerTest.fs diff --git a/examples/tests/rapidProceduralChange/uniformTest.fs b/scripts/developer/tests/rapidProceduralChange/uniformTest.fs similarity index 100% rename from examples/tests/rapidProceduralChange/uniformTest.fs rename to scripts/developer/tests/rapidProceduralChange/uniformTest.fs diff --git a/examples/tests/skybox/px.fs b/scripts/developer/tests/skybox/px.fs similarity index 100% rename from examples/tests/skybox/px.fs rename to scripts/developer/tests/skybox/px.fs diff --git a/examples/tests/skybox/px_rgba.fs b/scripts/developer/tests/skybox/px_rgba.fs similarity index 100% rename from examples/tests/skybox/px_rgba.fs rename to scripts/developer/tests/skybox/px_rgba.fs diff --git a/examples/tests/skybox/px_tex.fs b/scripts/developer/tests/skybox/px_tex.fs similarity index 100% rename from examples/tests/skybox/px_tex.fs rename to scripts/developer/tests/skybox/px_tex.fs diff --git a/examples/tests/skybox/px_tex_rgba.fs b/scripts/developer/tests/skybox/px_tex_rgba.fs similarity index 100% rename from examples/tests/skybox/px_tex_rgba.fs rename to scripts/developer/tests/skybox/px_tex_rgba.fs diff --git a/examples/tests/skybox/skyboxTest.js b/scripts/developer/tests/skybox/skyboxTest.js similarity index 100% rename from examples/tests/skybox/skyboxTest.js rename to scripts/developer/tests/skybox/skyboxTest.js diff --git a/examples/tests/sphereLODTest.js b/scripts/developer/tests/sphereLODTest.js similarity index 100% rename from examples/tests/sphereLODTest.js rename to scripts/developer/tests/sphereLODTest.js diff --git a/examples/tests/textureStress.fs b/scripts/developer/tests/textureStress.fs similarity index 100% rename from examples/tests/textureStress.fs rename to scripts/developer/tests/textureStress.fs diff --git a/examples/tests/textureStress.js b/scripts/developer/tests/textureStress.js similarity index 100% rename from examples/tests/textureStress.js rename to scripts/developer/tests/textureStress.js diff --git a/examples/tests/textureStress.qml b/scripts/developer/tests/textureStress.qml similarity index 100% rename from examples/tests/textureStress.qml rename to scripts/developer/tests/textureStress.qml diff --git a/examples/tests/toolWindowStressTest.js b/scripts/developer/tests/toolWindowStressTest.js similarity index 100% rename from examples/tests/toolWindowStressTest.js rename to scripts/developer/tests/toolWindowStressTest.js diff --git a/examples/utilities/cache/cacheStats.js b/scripts/developer/utilities/cache/cacheStats.js similarity index 100% rename from examples/utilities/cache/cacheStats.js rename to scripts/developer/utilities/cache/cacheStats.js diff --git a/examples/utilities/cache/stats.qml b/scripts/developer/utilities/cache/stats.qml similarity index 100% rename from examples/utilities/cache/stats.qml rename to scripts/developer/utilities/cache/stats.qml diff --git a/examples/utilities/diagnostics/XMLHttpRequest.js b/scripts/developer/utilities/diagnostics/XMLHttpRequest.js similarity index 100% rename from examples/utilities/diagnostics/XMLHttpRequest.js rename to scripts/developer/utilities/diagnostics/XMLHttpRequest.js diff --git a/examples/utilities/diagnostics/loadTestServers.js b/scripts/developer/utilities/diagnostics/loadTestServers.js similarity index 100% rename from examples/utilities/diagnostics/loadTestServers.js rename to scripts/developer/utilities/diagnostics/loadTestServers.js diff --git a/examples/utilities/diagnostics/testWebSocket.js b/scripts/developer/utilities/diagnostics/testWebSocket.js similarity index 100% rename from examples/utilities/diagnostics/testWebSocket.js rename to scripts/developer/utilities/diagnostics/testWebSocket.js diff --git a/examples/utilities/diagnostics/typedArraysUnitTest.js b/scripts/developer/utilities/diagnostics/typedArraysUnitTest.js similarity index 100% rename from examples/utilities/diagnostics/typedArraysUnitTest.js rename to scripts/developer/utilities/diagnostics/typedArraysUnitTest.js diff --git a/examples/utilities/lib/plotperf/PlotPerf.qml b/scripts/developer/utilities/lib/plotperf/PlotPerf.qml similarity index 100% rename from examples/utilities/lib/plotperf/PlotPerf.qml rename to scripts/developer/utilities/lib/plotperf/PlotPerf.qml diff --git a/examples/utilities/lib/plotperf/qmldir b/scripts/developer/utilities/lib/plotperf/qmldir similarity index 100% rename from examples/utilities/lib/plotperf/qmldir rename to scripts/developer/utilities/lib/plotperf/qmldir diff --git a/examples/utilities/record/recorder.js b/scripts/developer/utilities/record/recorder.js similarity index 100% rename from examples/utilities/record/recorder.js rename to scripts/developer/utilities/record/recorder.js diff --git a/examples/utilities/render/BG.qml b/scripts/developer/utilities/render/BG.qml similarity index 100% rename from examples/utilities/render/BG.qml rename to scripts/developer/utilities/render/BG.qml diff --git a/examples/utilities/render/configSlider/ConfigSlider.qml b/scripts/developer/utilities/render/configSlider/ConfigSlider.qml similarity index 100% rename from examples/utilities/render/configSlider/ConfigSlider.qml rename to scripts/developer/utilities/render/configSlider/ConfigSlider.qml diff --git a/examples/utilities/render/configSlider/qmldir b/scripts/developer/utilities/render/configSlider/qmldir similarity index 100% rename from examples/utilities/render/configSlider/qmldir rename to scripts/developer/utilities/render/configSlider/qmldir diff --git a/examples/utilities/render/culling.qml b/scripts/developer/utilities/render/culling.qml similarity index 100% rename from examples/utilities/render/culling.qml rename to scripts/developer/utilities/render/culling.qml diff --git a/examples/utilities/render/debug.js b/scripts/developer/utilities/render/debug.js similarity index 100% rename from examples/utilities/render/debug.js rename to scripts/developer/utilities/render/debug.js diff --git a/examples/utilities/render/debugBG.js b/scripts/developer/utilities/render/debugBG.js similarity index 100% rename from examples/utilities/render/debugBG.js rename to scripts/developer/utilities/render/debugBG.js diff --git a/examples/utilities/render/debugFramebuffer.js b/scripts/developer/utilities/render/debugFramebuffer.js similarity index 100% rename from examples/utilities/render/debugFramebuffer.js rename to scripts/developer/utilities/render/debugFramebuffer.js diff --git a/examples/utilities/render/debugRender.js b/scripts/developer/utilities/render/debugRender.js similarity index 100% rename from examples/utilities/render/debugRender.js rename to scripts/developer/utilities/render/debugRender.js diff --git a/examples/utilities/render/framebuffer.qml b/scripts/developer/utilities/render/framebuffer.qml similarity index 100% rename from examples/utilities/render/framebuffer.qml rename to scripts/developer/utilities/render/framebuffer.qml diff --git a/examples/utilities/render/main.qml b/scripts/developer/utilities/render/main.qml similarity index 100% rename from examples/utilities/render/main.qml rename to scripts/developer/utilities/render/main.qml diff --git a/examples/utilities/render/rates.qml b/scripts/developer/utilities/render/rates.qml similarity index 100% rename from examples/utilities/render/rates.qml rename to scripts/developer/utilities/render/rates.qml diff --git a/examples/utilities/render/renderRates.js b/scripts/developer/utilities/render/renderRates.js similarity index 100% rename from examples/utilities/render/renderRates.js rename to scripts/developer/utilities/render/renderRates.js diff --git a/examples/utilities/render/renderStats.js b/scripts/developer/utilities/render/renderStats.js similarity index 100% rename from examples/utilities/render/renderStats.js rename to scripts/developer/utilities/render/renderStats.js diff --git a/examples/utilities/render/stats.qml b/scripts/developer/utilities/render/stats.qml similarity index 99% rename from examples/utilities/render/stats.qml rename to scripts/developer/utilities/render/stats.qml index 312deac7f8..322af5389e 100644 --- a/examples/utilities/render/stats.qml +++ b/scripts/developer/utilities/render/stats.qml @@ -243,4 +243,6 @@ Item { ] } } + } + diff --git a/examples/utilities/tests/allPerfTests.js b/scripts/developer/utilities/tests/allPerfTests.js similarity index 100% rename from examples/utilities/tests/allPerfTests.js rename to scripts/developer/utilities/tests/allPerfTests.js diff --git a/scripts/developer/utilities/tests/editEntityStressTest.js b/scripts/developer/utilities/tests/editEntityStressTest.js new file mode 100644 index 0000000000..61f10c5d80 --- /dev/null +++ b/scripts/developer/utilities/tests/editEntityStressTest.js @@ -0,0 +1,176 @@ +// entityEditStressTest.js +// +// Created by Seiji Emery on 8/31/15 +// Copyright 2015 High Fidelity, Inc. +// +// Stress tests the client + server-side entity trees by spawning huge numbers of entities in +// close proximity to your avatar and updating them continuously (ie. applying position edits), +// with the intent of discovering crashes and other bugs related to the entity, scripting, +// rendering, networking, and/or physics subsystems. +// +// This script was originally created to find + diagnose an a clientside crash caused by improper +// locking of the entity tree, but can be reused for other purposes. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var NUM_ENTITIES = 20000; // number of entities to spawn +var ENTITY_SPAWN_LIMIT = 1000; +var ENTITY_SPAWN_INTERVAL = 0.1; + +var UPDATE_INTERVAL = 0.05; // Re-randomize the entity's position every x seconds / ms +var ENTITY_LIFETIME = 30; // Entity timeout (when/if we crash, we need the entities to delete themselves) +var KEEPALIVE_INTERVAL = 5; // Refreshes the timeout every X seconds + +var RADIUS = 5.0; // Spawn within this radius (square) +var Y_OFFSET = 1.5; // Spawn at an offset below the avatar +var TEST_ENTITY_NAME = "EntitySpawnTest"; + +(function () { + this.makeEntity = function (properties) { + var entity = Entities.addEntity(properties); + // print("spawning entity: " + JSON.stringify(properties)); + + return { + update: function (properties) { + Entities.editEntity(entity, properties); + }, + destroy: function () { + Entities.deleteEntity(entity) + }, + getAge: function () { + return Entities.getEntityProperties(entity).age; + } + }; + } + + this.randomPositionXZ = function (center, radius) { + return { + x: center.x + (Math.random() * radius * 2.0) - radius, + y: center.y, + z: center.z + (Math.random() * radius * 2.0) - radius + }; + } + this.randomColor = function () { + var shade = Math.floor(Math.random() * 255); + var hue = Math.floor(Math.random() * (255 - shade)); + + return { + red: shade + hue, + green: shade, + blue: shade + }; + } + this.randomDimensions = function () { + return { + x: 0.1 + Math.random() * 0.5, + y: 0.1 + Math.random() * 0.1, + z: 0.1 + Math.random() * 0.5 + }; + } +})(); + +(function () { + var entities = []; + var entitiesToCreate = 0; + var entitiesSpawned = 0; + + + function clear () { + var ids = Entities.findEntities(MyAvatar.position, 50); + var that = this; + ids.forEach(function(id) { + var properties = Entities.getEntityProperties(id); + if (properties.name == TEST_ENTITY_NAME) { + Entities.deleteEntity(id); + } + }, this); + } + + function createEntities () { + print("Creating " + NUM_ENTITIES + " entities (UPDATE_INTERVAL = " + UPDATE_INTERVAL + ", KEEPALIVE_INTERVAL = " + KEEPALIVE_INTERVAL + ")"); + entitiesToCreate = NUM_ENTITIES; + Script.update.connect(spawnEntities); + } + + var spawnTimer = 0.0; + function spawnEntities (dt) { + if (entitiesToCreate <= 0) { + Script.update.disconnect(spawnEntities); + print("Finished spawning entities"); + } + else if ((spawnTimer -= dt) < 0.0){ + spawnTimer = ENTITY_SPAWN_INTERVAL; + + var n = Math.min(entitiesToCreate, ENTITY_SPAWN_LIMIT); + print("Spawning " + n + " entities (" + (entitiesSpawned += n) + ")"); + + + entitiesToCreate -= n; + + var center = MyAvatar.position; + center.y -= Y_OFFSET; + + for (; n > 0; --n) { + entities.push(makeEntity({ + type: "Box", + name: TEST_ENTITY_NAME, + position: randomPositionXZ(center, RADIUS), + color: randomColor(), + dimensions: randomDimensions(), + lifetime: ENTITY_LIFETIME + })); + } + } + } + + function despawnEntities () { + print("despawning entities"); + entities.forEach(function (entity) { + entity.destroy(); + }); + entities = []; + } + + var keepAliveTimer = 0.0; + var updateTimer = 0.0; + + // Runs the following entity updates: + // a) refreshes the timeout interval every KEEPALIVE_INTERVAL seconds, and + // b) re-randomizes its position every UPDATE_INTERVAL seconds. + // This should be sufficient to crash the client until the entity tree bug is fixed (and thereafter if it shows up again). + function updateEntities (dt) { + var updateLifetime = ((keepAliveTimer -= dt) < 0.0) ? ((keepAliveTimer = KEEPALIVE_INTERVAL), true) : false; + var updateProperties = ((updateTimer -= dt) < 0.0) ? ((updateTimer = UPDATE_INTERVAL), true) : false; + + if (updateLifetime || updateProperties) { + var center = MyAvatar.position; + center.y -= Y_OFFSET; + + entities.forEach((updateLifetime && updateProperties && function (entity) { + entity.update({ + lifetime: entity.getAge() + ENTITY_LIFETIME, + position: randomPositionXZ(center, RADIUS) + }); + }) || (updateLifetime && function (entity) { + entity.update({ + lifetime: entity.getAge() + ENTITY_LIFETIME + }); + }) || (updateProperties && function (entity) { + entity.update({ + position: randomPositionXZ(center, RADIUS) + }); + }) || null, this); + } + } + + function init () { + Script.update.disconnect(init); + clear(); + createEntities(); + Script.update.connect(updateEntities); + Script.scriptEnding.connect(despawnEntities); + } + Script.update.connect(init); +})(); \ No newline at end of file diff --git a/examples/utilities/tests/entityPerfTest.js b/scripts/developer/utilities/tests/entityPerfTest.js similarity index 100% rename from examples/utilities/tests/entityPerfTest.js rename to scripts/developer/utilities/tests/entityPerfTest.js diff --git a/examples/utilities/tests/forLoopPerfTest.js b/scripts/developer/utilities/tests/forLoopPerfTest.js similarity index 100% rename from examples/utilities/tests/forLoopPerfTest.js rename to scripts/developer/utilities/tests/forLoopPerfTest.js diff --git a/examples/utilities/tests/mathPerfTest.js b/scripts/developer/utilities/tests/mathPerfTest.js similarity index 100% rename from examples/utilities/tests/mathPerfTest.js rename to scripts/developer/utilities/tests/mathPerfTest.js diff --git a/examples/utilities/tests/perfTest.js b/scripts/developer/utilities/tests/perfTest.js similarity index 100% rename from examples/utilities/tests/perfTest.js rename to scripts/developer/utilities/tests/perfTest.js diff --git a/examples/utilities/tools/MonoHMD.js b/scripts/developer/utilities/tools/MonoHMD.js similarity index 100% rename from examples/utilities/tools/MonoHMD.js rename to scripts/developer/utilities/tools/MonoHMD.js diff --git a/examples/utilities/tools/currentAPI.js b/scripts/developer/utilities/tools/currentAPI.js similarity index 100% rename from examples/utilities/tools/currentAPI.js rename to scripts/developer/utilities/tools/currentAPI.js diff --git a/examples/utilities/tools/developerMenuItems.js b/scripts/developer/utilities/tools/developerMenuItems.js similarity index 100% rename from examples/utilities/tools/developerMenuItems.js rename to scripts/developer/utilities/tools/developerMenuItems.js diff --git a/examples/disableAvatarAnimations.js b/scripts/developer/utilities/tools/disableAvatarAnimations.js similarity index 100% rename from examples/disableAvatarAnimations.js rename to scripts/developer/utilities/tools/disableAvatarAnimations.js diff --git a/examples/utilities/tools/reverbTest.js b/scripts/developer/utilities/tools/reverbTest.js similarity index 100% rename from examples/utilities/tools/reverbTest.js rename to scripts/developer/utilities/tools/reverbTest.js diff --git a/scripts/system/assets/images/Overlay-Viz-blank.png b/scripts/system/assets/images/Overlay-Viz-blank.png new file mode 100644 index 0000000000..76f535b6e6 Binary files /dev/null and b/scripts/system/assets/images/Overlay-Viz-blank.png differ diff --git a/scripts/system/assets/images/Particle-Sprite-Smoke-1.png b/scripts/system/assets/images/Particle-Sprite-Smoke-1.png new file mode 100644 index 0000000000..78c9b3da4a Binary files /dev/null and b/scripts/system/assets/images/Particle-Sprite-Smoke-1.png differ diff --git a/scripts/system/assets/images/close-small-light.svg b/scripts/system/assets/images/close-small-light.svg new file mode 100644 index 0000000000..f9edf95fca --- /dev/null +++ b/scripts/system/assets/images/close-small-light.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/scripts/system/assets/images/grabsprite-3.png b/scripts/system/assets/images/grabsprite-3.png new file mode 100644 index 0000000000..4ecc772a41 Binary files /dev/null and b/scripts/system/assets/images/grabsprite-3.png differ diff --git a/scripts/system/assets/images/hourglass.svg b/scripts/system/assets/images/hourglass.svg new file mode 100644 index 0000000000..5c5055b755 --- /dev/null +++ b/scripts/system/assets/images/hourglass.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/scripts/system/assets/images/min-max-toggle.svg b/scripts/system/assets/images/min-max-toggle.svg new file mode 100644 index 0000000000..1699cc705d --- /dev/null +++ b/scripts/system/assets/images/min-max-toggle.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/progress-bar-background.svg b/scripts/system/assets/images/progress-bar-background.svg new file mode 100644 index 0000000000..732acd05ad --- /dev/null +++ b/scripts/system/assets/images/progress-bar-background.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/scripts/system/assets/images/progress-bar.svg b/scripts/system/assets/images/progress-bar.svg new file mode 100644 index 0000000000..0df6f98686 --- /dev/null +++ b/scripts/system/assets/images/progress-bar.svg @@ -0,0 +1,7 @@ + + + + + + diff --git a/scripts/system/assets/images/textures/dirt.jpeg b/scripts/system/assets/images/textures/dirt.jpeg new file mode 100644 index 0000000000..694e4f3c9a Binary files /dev/null and b/scripts/system/assets/images/textures/dirt.jpeg differ diff --git a/scripts/system/assets/images/textures/grass.png b/scripts/system/assets/images/textures/grass.png new file mode 100644 index 0000000000..d51fe0cf28 Binary files /dev/null and b/scripts/system/assets/images/textures/grass.png differ diff --git a/scripts/system/assets/images/tools/add-remove-friends.svg b/scripts/system/assets/images/tools/add-remove-friends.svg new file mode 100644 index 0000000000..6ee9ce842d --- /dev/null +++ b/scripts/system/assets/images/tools/add-remove-friends.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/cube-01.svg b/scripts/system/assets/images/tools/cube-01.svg new file mode 100644 index 0000000000..f8cf96e4f2 --- /dev/null +++ b/scripts/system/assets/images/tools/cube-01.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/directory-01.svg b/scripts/system/assets/images/tools/directory-01.svg new file mode 100644 index 0000000000..d038611d69 --- /dev/null +++ b/scripts/system/assets/images/tools/directory-01.svg @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/edit-01.svg b/scripts/system/assets/images/tools/edit-01.svg new file mode 100644 index 0000000000..c661c6f678 --- /dev/null +++ b/scripts/system/assets/images/tools/edit-01.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/examples-01.svg b/scripts/system/assets/images/tools/examples-01.svg new file mode 100644 index 0000000000..ec4758dcde --- /dev/null +++ b/scripts/system/assets/images/tools/examples-01.svg @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/light-01.svg b/scripts/system/assets/images/tools/light-01.svg new file mode 100644 index 0000000000..4573c7d636 --- /dev/null +++ b/scripts/system/assets/images/tools/light-01.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/min-max-toggle.svg b/scripts/system/assets/images/tools/min-max-toggle.svg new file mode 100644 index 0000000000..1699cc705d --- /dev/null +++ b/scripts/system/assets/images/tools/min-max-toggle.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/model-01.svg b/scripts/system/assets/images/tools/model-01.svg new file mode 100644 index 0000000000..e760d74d5c --- /dev/null +++ b/scripts/system/assets/images/tools/model-01.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/particle-01.svg b/scripts/system/assets/images/tools/particle-01.svg new file mode 100644 index 0000000000..cfcfb0ea7f --- /dev/null +++ b/scripts/system/assets/images/tools/particle-01.svg @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/polyvox.svg b/scripts/system/assets/images/tools/polyvox.svg new file mode 100644 index 0000000000..69f1e978ff --- /dev/null +++ b/scripts/system/assets/images/tools/polyvox.svg @@ -0,0 +1,39 @@ + + + + +polyvox + + + +voxels + + diff --git a/scripts/system/assets/images/tools/sphere-01.svg b/scripts/system/assets/images/tools/sphere-01.svg new file mode 100644 index 0000000000..975199c8da --- /dev/null +++ b/scripts/system/assets/images/tools/sphere-01.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/sphere-add.svg b/scripts/system/assets/images/tools/sphere-add.svg new file mode 100644 index 0000000000..59ca489b5f --- /dev/null +++ b/scripts/system/assets/images/tools/sphere-add.svg @@ -0,0 +1,77 @@ + + + +image/svg+xmladd + \ No newline at end of file diff --git a/scripts/system/assets/images/tools/sphere-delete.svg b/scripts/system/assets/images/tools/sphere-delete.svg new file mode 100644 index 0000000000..6997654500 --- /dev/null +++ b/scripts/system/assets/images/tools/sphere-delete.svg @@ -0,0 +1,76 @@ + + + +image/svg+xmldelete + \ No newline at end of file diff --git a/scripts/system/assets/images/tools/text-01.svg b/scripts/system/assets/images/tools/text-01.svg new file mode 100644 index 0000000000..d33d66d4a5 --- /dev/null +++ b/scripts/system/assets/images/tools/text-01.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/upload-01.svg b/scripts/system/assets/images/tools/upload-01.svg new file mode 100644 index 0000000000..149b10f3bc --- /dev/null +++ b/scripts/system/assets/images/tools/upload-01.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/voxel-add.svg b/scripts/system/assets/images/tools/voxel-add.svg new file mode 100644 index 0000000000..8e6e2c5b35 --- /dev/null +++ b/scripts/system/assets/images/tools/voxel-add.svg @@ -0,0 +1,104 @@ + + + +image/svg+xmladd + \ No newline at end of file diff --git a/scripts/system/assets/images/tools/voxel-delete.svg b/scripts/system/assets/images/tools/voxel-delete.svg new file mode 100644 index 0000000000..0b0d0b9787 --- /dev/null +++ b/scripts/system/assets/images/tools/voxel-delete.svg @@ -0,0 +1,103 @@ + + + +image/svg+xmldelete + \ No newline at end of file diff --git a/scripts/system/assets/images/tools/voxel-terrain.svg b/scripts/system/assets/images/tools/voxel-terrain.svg new file mode 100644 index 0000000000..e5ed16dbcd --- /dev/null +++ b/scripts/system/assets/images/tools/voxel-terrain.svg @@ -0,0 +1,101 @@ + + + +image/svg+xmlterrain + \ No newline at end of file diff --git a/scripts/system/assets/images/tools/voxels.svg b/scripts/system/assets/images/tools/voxels.svg new file mode 100644 index 0000000000..a0dbd63d45 --- /dev/null +++ b/scripts/system/assets/images/tools/voxels.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/web-01.svg b/scripts/system/assets/images/tools/web-01.svg new file mode 100644 index 0000000000..903b3ac819 --- /dev/null +++ b/scripts/system/assets/images/tools/web-01.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/zone-01.svg b/scripts/system/assets/images/tools/zone-01.svg new file mode 100644 index 0000000000..29d17e5187 --- /dev/null +++ b/scripts/system/assets/images/tools/zone-01.svg @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/sounds/goodbye.wav b/scripts/system/assets/sounds/goodbye.wav new file mode 100644 index 0000000000..bd6c51a5c0 Binary files /dev/null and b/scripts/system/assets/sounds/goodbye.wav differ diff --git a/scripts/system/assets/sounds/hello.wav b/scripts/system/assets/sounds/hello.wav new file mode 100644 index 0000000000..6269dab5db Binary files /dev/null and b/scripts/system/assets/sounds/hello.wav differ diff --git a/scripts/system/assets/sounds/notification-general1.raw b/scripts/system/assets/sounds/notification-general1.raw new file mode 100644 index 0000000000..be81fa15c5 Binary files /dev/null and b/scripts/system/assets/sounds/notification-general1.raw differ diff --git a/scripts/system/assets/sounds/notification-general2.raw b/scripts/system/assets/sounds/notification-general2.raw new file mode 100644 index 0000000000..58f0bac19c Binary files /dev/null and b/scripts/system/assets/sounds/notification-general2.raw differ diff --git a/scripts/system/assets/sounds/short1.wav b/scripts/system/assets/sounds/short1.wav new file mode 100644 index 0000000000..fb03f5dd49 Binary files /dev/null and b/scripts/system/assets/sounds/short1.wav differ diff --git a/scripts/system/assets/sounds/snap.wav b/scripts/system/assets/sounds/snap.wav new file mode 100644 index 0000000000..bb562e1db9 Binary files /dev/null and b/scripts/system/assets/sounds/snap.wav differ diff --git a/examples/attachedEntitiesManager.js b/scripts/system/attachedEntitiesManager.js similarity index 99% rename from examples/attachedEntitiesManager.js rename to scripts/system/attachedEntitiesManager.js index ef85f8cb98..9ddb040297 100644 --- a/examples/attachedEntitiesManager.js +++ b/scripts/system/attachedEntitiesManager.js @@ -27,7 +27,6 @@ var SHOW_TOOL_BAR = false; // tool bar if (SHOW_TOOL_BAR) { - HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; var BUTTON_SIZE = 32; var PADDING = 3; Script.include(["libraries/toolBars.js"]); diff --git a/examples/away.js b/scripts/system/away.js similarity index 99% rename from examples/away.js rename to scripts/system/away.js index dee4f841b0..687345a5e1 100644 --- a/examples/away.js +++ b/scripts/system/away.js @@ -270,4 +270,4 @@ Script.scriptEnding.connect(function () { Controller.disableMapping(eventMappingName); Controller.mousePressEvent.disconnect(goActive); Controller.keyPressEvent.disconnect(maybeGoActive); -}); +}); \ No newline at end of file diff --git a/examples/grab.js b/scripts/system/controllers/grab.js similarity index 99% rename from examples/grab.js rename to scripts/system/controllers/grab.js index f9d1f41b97..fcc7a6d291 100644 --- a/examples/grab.js +++ b/scripts/system/controllers/grab.js @@ -11,7 +11,7 @@ // /*global print, Mouse, MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, Audio, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt, pointInExtents, vec3equal, setEntityCustomData, getEntityCustomData */ -Script.include("libraries/utils.js"); +Script.include("../libraries/utils.js"); // objects that appear smaller than this can't be grabbed var MAX_SOLID_ANGLE = 0.01; diff --git a/examples/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js similarity index 99% rename from examples/controllers/handControllerGrab.js rename to scripts/system/controllers/handControllerGrab.js index 4b20651899..5924d566b4 100644 --- a/examples/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -12,7 +12,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html /*global print, MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, Audio, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt, pointInExtents, vec3equal, setEntityCustomData, getEntityCustomData */ -Script.include("/~/libraries/utils.js"); +Script.include("../libraries/utils.js"); // diff --git a/examples/controllers/handControllerMouse.js b/scripts/system/controllers/handControllerMouse.js similarity index 100% rename from examples/controllers/handControllerMouse.js rename to scripts/system/controllers/handControllerMouse.js diff --git a/examples/controllers/squeezeHands.js b/scripts/system/controllers/squeezeHands.js similarity index 100% rename from examples/controllers/squeezeHands.js rename to scripts/system/controllers/squeezeHands.js diff --git a/examples/depthReticle.js b/scripts/system/depthReticle.js similarity index 100% rename from examples/depthReticle.js rename to scripts/system/depthReticle.js diff --git a/examples/dialTone.js b/scripts/system/dialTone.js similarity index 75% rename from examples/dialTone.js rename to scripts/system/dialTone.js index eb1fc5ec1c..64ef62d61a 100644 --- a/examples/dialTone.js +++ b/scripts/system/dialTone.js @@ -11,9 +11,11 @@ // // setup the local sound we're going to use -var connectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/hello.wav"); -var disconnectSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/goodbye.wav"); -var micMutedSound = SoundCache.getSound("file:///" + Paths.resources + "sounds/goodbye.wav"); + + +var connectSound = SoundCache.getSound(Script.resolvePath("assets/sounds/hello.wav")); +var disconnectSound = SoundCache.getSound(Script.resolvePath("assets/sounds/goodbye.wav")); +var micMutedSound = SoundCache.getSound(Script.resolvePath("assets/sounds/goodbye.wav")); // setup the options needed for that sound var soundOptions = { diff --git a/examples/directory.js b/scripts/system/directory.js similarity index 96% rename from examples/directory.js rename to scripts/system/directory.js index ac426cafe7..cf9aa6aba7 100644 --- a/examples/directory.js +++ b/scripts/system/directory.js @@ -13,8 +13,7 @@ Script.include([ "libraries/toolBars.js", ]); -HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; -var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; +var toolIconUrl = Script.resolvePath("assets/images/tools/"); var DIRECTORY_WINDOW_URL = "https://metaverse.highfidelity.com/directory"; var directoryWindow = new OverlayWebWindow({ diff --git a/examples/edit.js b/scripts/system/edit.js similarity index 99% rename from examples/edit.js rename to scripts/system/edit.js index c4c3b5a99b..2796297e40 100644 --- a/examples/edit.js +++ b/scripts/system/edit.js @@ -50,7 +50,7 @@ selectionManager.addEventListener(function() { lightOverlayManager.updatePositions(); }); -var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; +var toolIconUrl = Script.resolvePath("assets/images/tools/"); var toolHeight = 50; var toolWidth = 50; var TOOLBAR_MARGIN_Y = 25; @@ -106,7 +106,7 @@ IMPORTING_SVO_OVERLAY_HEIGHT = 30; IMPORTING_SVO_OVERLAY_MARGIN = 5; IMPORTING_SVO_OVERLAY_LEFT_MARGIN = 34; var importingSVOImageOverlay = Overlays.addOverlay("image", { - imageURL: HIFI_PUBLIC_BUCKET + "images/hourglass.svg", + imageURL: Script.resolvePath("assets") + "/images/hourglass.svg", width: 20, height: 20, alpha: 1.0, @@ -191,7 +191,7 @@ var toolBar = (function() { }); activeButton = toolBar.addTool({ - imageURL: toolIconUrl + "edit-01.svg", + imageURL: toolIconUrl + "edit-01.svg", subImage: { x: 0, y: Tool.IMAGE_WIDTH, @@ -205,7 +205,7 @@ var toolBar = (function() { }, true, false); newModelButton = toolBar.addTool({ - imageURL: toolIconUrl + "model-01.svg", + imageURL:toolIconUrl + "model-01.svg", subImage: { x: 0, y: Tool.IMAGE_WIDTH, @@ -220,7 +220,7 @@ var toolBar = (function() { }); newCubeButton = toolBar.addTool({ - imageURL: toolIconUrl + "cube-01.svg", + imageURL:toolIconUrl + "cube-01.svg", subImage: { x: 0, y: Tool.IMAGE_WIDTH, diff --git a/examples/examples.js b/scripts/system/examples.js similarity index 95% rename from examples/examples.js rename to scripts/system/examples.js index 90dca71f38..9caedec70f 100644 --- a/examples/examples.js +++ b/scripts/system/examples.js @@ -13,8 +13,7 @@ Script.include([ "libraries/toolBars.js", ]); -HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; -var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; +var toolIconUrl = Script.resolvePath("assets/images/tools/"); var EXAMPLES_URL = "https://metaverse.highfidelity.com/examples"; var examplesWindow = new OverlayWebWindow({ @@ -136,4 +135,4 @@ var toolBar = (function() { }()); Controller.mousePressEvent.connect(toolBar.mousePressEvent) -Script.scriptEnding.connect(toolBar.cleanup); +Script.scriptEnding.connect(toolBar.cleanup); \ No newline at end of file diff --git a/examples/html/colpick.js b/scripts/system/html/colpick.js similarity index 100% rename from examples/html/colpick.js rename to scripts/system/html/colpick.js diff --git a/examples/html/css/colpick.css b/scripts/system/html/css/colpick.css similarity index 100% rename from examples/html/css/colpick.css rename to scripts/system/html/css/colpick.css diff --git a/examples/html/edit-style.css b/scripts/system/html/edit-style.css similarity index 94% rename from examples/html/edit-style.css rename to scripts/system/html/edit-style.css index de6f6a670d..5eaa3c6497 100644 --- a/examples/html/edit-style.css +++ b/scripts/system/html/edit-style.css @@ -10,51 +10,51 @@ @font-face { font-family: Raleway-Regular; - src: url(../../resources/fonts/Raleway-Regular.ttf), /* Windows production */ - url(../../fonts/Raleway-Regular.ttf), /* OSX production */ - url(../../interface/resources/fonts/Raleway-Regular.ttf); /* Development, running script in /HiFi/examples */ + src: url(../../../resources/fonts/Raleway-Regular.ttf), /* Windows production */ + url(../../../fonts/Raleway-Regular.ttf), /* OSX production */ + url(../../../interface/resources/fonts/Raleway-Regular.ttf); /* Development, running script in /HiFi/examples */ } @font-face { font-family: Raleway-Light; - src: url(../../resources/fonts/Raleway-Light.ttf), - url(../../fonts/Raleway-Light.ttf), - url(../../interface/resources/fonts/Raleway-Light.ttf); + src: url(../../../resources/fonts/Raleway-Light.ttf), + url(../../../fonts/Raleway-Light.ttf), + url(../../../interface/resources/fonts/Raleway-Light.ttf); } @font-face { font-family: Raleway-Bold; - src: url(../../resources/fonts/Raleway-Bold.ttf), - url(../../fonts/Raleway-Bold.ttf), - url(../../interface/resources/fonts/Raleway-Bold.ttf); + src: url(../../../resources/fonts/Raleway-Bold.ttf), + url(../../../fonts/Raleway-Bold.ttf), + url(../../../interface/resources/fonts/Raleway-Bold.ttf); } @font-face { font-family: Raleway-SemiBold; - src: url(../../resources/fonts/Raleway-SemiBold.ttf), - url(../../fonts/Raleway-SemiBold.ttf), - url(../../interface/resources/fonts/Raleway-SemiBold.ttf); + src: url(../../../resources/fonts/Raleway-SemiBold.ttf), + url(../../../fonts/Raleway-SemiBold.ttf), + url(../../../interface/resources/fonts/Raleway-SemiBold.ttf); } @font-face { font-family: FiraSans-SemiBold; - src: url(../../resources/fonts/FiraSans-SemiBold.ttf), - url(../../fonts/FiraSans-SemiBold.ttf), - url(../../interface/resources/fonts/FiraSans-SemiBold.ttf); + src: url(../../../resources/fonts/FiraSans-SemiBold.ttf), + url(../../../fonts/FiraSans-SemiBold.ttf), + url(../../../interface/resources/fonts/FiraSans-SemiBold.ttf); } @font-face { font-family: AnonymousPro-Regular; - src: url(../../resources/fonts/AnonymousPro-Regular.ttf), - url(../../fonts/AnonymousPro-Regular.ttf), - url(../../interface/resources/fonts/AnonymousPro-Regular.ttf); + src: url(../../../resources/fonts/AnonymousPro-Regular.ttf), + url(../../../fonts/AnonymousPro-Regular.ttf), + url(../../../interface/resources/fonts/AnonymousPro-Regular.ttf); } @font-face { font-family: HiFi-Glyphs; - src: url(../../resources/fonts/hifi-glyphs.ttf), - url(../../fonts/hifi-glyphs.ttf), - url(../../interface/resources/fonts/hifi-glyphs.ttf); + src: url(../../../resources/fonts/hifi-glyphs.ttf), + url(../../../fonts/hifi-glyphs.ttf), + url(../../../interface/resources/fonts/hifi-glyphs.ttf); } * { diff --git a/examples/html/entityList.html b/scripts/system/html/entityList.html similarity index 100% rename from examples/html/entityList.html rename to scripts/system/html/entityList.html diff --git a/examples/html/entityProperties.html b/scripts/system/html/entityProperties.html similarity index 100% rename from examples/html/entityProperties.html rename to scripts/system/html/entityProperties.html diff --git a/examples/html/eventBridgeLoader.js b/scripts/system/html/eventBridgeLoader.js similarity index 100% rename from examples/html/eventBridgeLoader.js rename to scripts/system/html/eventBridgeLoader.js diff --git a/examples/html/gridControls.html b/scripts/system/html/gridControls.html similarity index 100% rename from examples/html/gridControls.html rename to scripts/system/html/gridControls.html diff --git a/examples/html/jquery-2.1.4.min.js b/scripts/system/html/jquery-2.1.4.min.js similarity index 100% rename from examples/html/jquery-2.1.4.min.js rename to scripts/system/html/jquery-2.1.4.min.js diff --git a/examples/html/list.min.js b/scripts/system/html/list.min.js similarity index 100% rename from examples/html/list.min.js rename to scripts/system/html/list.min.js diff --git a/scripts/system/html/spinButtons.js b/scripts/system/html/spinButtons.js new file mode 100644 index 0000000000..fa2d18552f --- /dev/null +++ b/scripts/system/html/spinButtons.js @@ -0,0 +1,51 @@ +// +// spinButtons.js +// +// Created by David Rowe on 20 Apr 2016 +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +function hoverSpinButtons(event) { + var input = event.target, + x = event.offsetX, + y = event.offsetY, + width = input.offsetWidth, + height = input.offsetHeight, + SPIN_WIDTH = 11, + SPIN_MARGIN = 2, + maxX = width - SPIN_MARGIN, + minX = maxX - SPIN_WIDTH; + + if (minX <= x && x <= maxX) { + if (y < height / 2) { + input.classList.remove("hover-down"); + input.classList.add("hover-up"); + } else { + input.classList.remove("hover-up"); + input.classList.add("hover-down"); + } + } else { + input.classList.remove("hover-up"); + input.classList.remove("hover-down"); + } +} + +function unhoverSpinButtons(event) { + event.target.classList.remove("hover-up"); + event.target.classList.remove("hover-down"); +} + +function augmentSpinButtons() { + var inputs, i, length; + + inputs = document.getElementsByTagName("INPUT"); + for (i = 0, length = inputs.length; i < length; i += 1) { + if (inputs[i].type === "number") { + inputs[i].addEventListener("mousemove", hoverSpinButtons); + inputs[i].addEventListener("mouseout", unhoverSpinButtons); + } + } +} diff --git a/examples/libraries/ToolTip.js b/scripts/system/libraries/ToolTip.js similarity index 100% rename from examples/libraries/ToolTip.js rename to scripts/system/libraries/ToolTip.js diff --git a/examples/libraries/dataViewHelpers.js b/scripts/system/libraries/dataViewHelpers.js similarity index 100% rename from examples/libraries/dataViewHelpers.js rename to scripts/system/libraries/dataViewHelpers.js diff --git a/examples/libraries/entityCameraTool.js b/scripts/system/libraries/entityCameraTool.js similarity index 100% rename from examples/libraries/entityCameraTool.js rename to scripts/system/libraries/entityCameraTool.js diff --git a/examples/libraries/entityList.js b/scripts/system/libraries/entityList.js similarity index 92% rename from examples/libraries/entityList.js rename to scripts/system/libraries/entityList.js index 78a8aa5a6a..00120ab4c2 100644 --- a/examples/libraries/entityList.js +++ b/scripts/system/libraries/entityList.js @@ -59,8 +59,6 @@ EntityListTool = function(opts) { name: properties.name, type: properties.type, url: properties.type == "Model" ? properties.modelURL : "", - locked: properties.locked, - visible: properties.visible }); } @@ -101,10 +99,6 @@ EntityListTool = function(opts) { } } else if (data.type == "delete") { deleteSelectedEntities(); - } else if (data.type == "toggleLocked") { - toggleSelectedEntitiesLocked(); - } else if (data.type == "toggleVisible") { - toggleSelectedEntitiesVisible(); } else if (data.type === "radius") { searchRadius = data.radius; that.sendUpdate(); diff --git a/examples/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js similarity index 100% rename from examples/libraries/entitySelectionTool.js rename to scripts/system/libraries/entitySelectionTool.js diff --git a/examples/libraries/globals.js b/scripts/system/libraries/globals.js similarity index 100% rename from examples/libraries/globals.js rename to scripts/system/libraries/globals.js diff --git a/examples/libraries/gridTool.js b/scripts/system/libraries/gridTool.js similarity index 92% rename from examples/libraries/gridTool.js rename to scripts/system/libraries/gridTool.js index bebad84e1e..c002aec3b1 100644 --- a/examples/libraries/gridTool.js +++ b/scripts/system/libraries/gridTool.js @@ -3,7 +3,14 @@ var GRID_CONTROLS_HTML_URL = Script.resolvePath('../html/gridControls.html'); Grid = function(opts) { var that = {}; - var gridColor = { red: 255, green: 255, blue: 255 }; + var colors = [ + { red: 0, green: 0, blue: 0 }, + { red: 255, green: 255, blue: 255 }, + { red: 255, green: 0, blue: 0 }, + { red: 0, green: 255, blue: 0 }, + { red: 0, green: 0, blue: 255 }, + ]; + var colorIndex = 0; var gridAlpha = 0.6; var origin = { x: 0, y: +MyAvatar.getJointPosition('LeftToeBase').y.toFixed(1) + 0.1, z: 0 }; var scale = 500; @@ -21,7 +28,7 @@ Grid = function(opts) { position: origin, visible: false, drawInFront: false, - color: gridColor, + color: colors[0], alpha: gridAlpha, minorGridEvery: minorGridEvery, majorGridEvery: majorGridEvery, @@ -45,6 +52,12 @@ Grid = function(opts) { updateGrid(); }; + that.getColorIndex = function() { return colorIndex; }; + that.setColorIndex = function(value) { + colorIndex = value; + updateGrid(); + }; + that.getSnapToGrid = function() { return snapToGrid; }; that.setSnapToGrid = function(value) { snapToGrid = value; @@ -162,8 +175,8 @@ Grid = function(opts) { majorGridEvery = data.majorGridEvery; } - if (data.gridColor !== undefined) { - gridColor = data.gridColor; + if (data.colorIndex !== undefined) { + colorIndex = data.colorIndex; } if (data.gridSize) { @@ -183,7 +196,7 @@ Grid = function(opts) { visible: that.visible && that.enabled, minorGridEvery: minorGridEvery, majorGridEvery: majorGridEvery, - color: gridColor, + color: colors[colorIndex], alpha: gridAlpha, }); diff --git a/examples/libraries/lightOverlayManager.js b/scripts/system/libraries/lightOverlayManager.js similarity index 100% rename from examples/libraries/lightOverlayManager.js rename to scripts/system/libraries/lightOverlayManager.js diff --git a/examples/libraries/overlayUtils.js b/scripts/system/libraries/overlayUtils.js similarity index 100% rename from examples/libraries/overlayUtils.js rename to scripts/system/libraries/overlayUtils.js diff --git a/examples/libraries/progressDialog.js b/scripts/system/libraries/progressDialog.js similarity index 100% rename from examples/libraries/progressDialog.js rename to scripts/system/libraries/progressDialog.js diff --git a/examples/libraries/soundArray.js b/scripts/system/libraries/soundArray.js similarity index 100% rename from examples/libraries/soundArray.js rename to scripts/system/libraries/soundArray.js diff --git a/examples/libraries/stringHelpers.js b/scripts/system/libraries/stringHelpers.js similarity index 100% rename from examples/libraries/stringHelpers.js rename to scripts/system/libraries/stringHelpers.js diff --git a/examples/libraries/toolBars.js b/scripts/system/libraries/toolBars.js similarity index 99% rename from examples/libraries/toolBars.js rename to scripts/system/libraries/toolBars.js index 4f560e6b8d..1f83a4ffa6 100644 --- a/examples/libraries/toolBars.js +++ b/scripts/system/libraries/toolBars.js @@ -472,4 +472,4 @@ ToolBar = function(x, y, direction, optionalPersistenceKey, optionalInitialPosit } ToolBar.SPACING = 6; ToolBar.VERTICAL = 0; -ToolBar.HORIZONTAL = 1; +ToolBar.HORIZONTAL = 1; \ No newline at end of file diff --git a/scripts/system/libraries/utils.js b/scripts/system/libraries/utils.js new file mode 100644 index 0000000000..f39f4d7913 --- /dev/null +++ b/scripts/system/libraries/utils.js @@ -0,0 +1,313 @@ +// +// Created by Bradley Austin Davis on 2015/08/29 +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +vec3toStr = function(v, digits) { + if (!digits) { digits = 3; } + return "{ " + v.x.toFixed(digits) + ", " + v.y.toFixed(digits) + ", " + v.z.toFixed(digits)+ " }"; +} + +quatToStr = function(q, digits) { + if (!digits) { digits = 3; } + return "{ " + q.w.toFixed(digits) + ", " + q.x.toFixed(digits) + ", " + + q.y.toFixed(digits) + ", " + q.z.toFixed(digits)+ " }"; +} + +vec3equal = function(v0, v1) { + return (v0.x == v1.x) && (v0.y == v1.y) && (v0.z == v1.z); +} + +colorMix = function(colorA, colorB, mix) { + var result = {}; + for (var key in colorA) { + result[key] = (colorA[key] * (1 - mix)) + (colorB[key] * mix); + } + return result; +} +scaleLine = function (start, end, scale) { + var v = Vec3.subtract(end, start); + var length = Vec3.length(v); + v = Vec3.multiply(scale, v); + return Vec3.sum(start, v); +} + +findAction = function(name) { + return Controller.findAction(name); +} + +addLine = function(origin, vector, color) { + if (!color) { + color = COLORS.WHITE + } + return Entities.addEntity(mergeObjects(LINE_PROTOTYPE, { + position: origin, + linePoints: [ + ZERO_VECTOR, + vector, + ], + color: color + })); +} + +// FIXME fetch from a subkey of user data to support non-destructive modifications +setEntityUserData = function(id, data) { + var json = JSON.stringify(data) + Entities.editEntity(id, { userData: json }); +} + +// FIXME do non-destructive modification of the existing user data +getEntityUserData = function(id) { + var results = null; + var properties = Entities.getEntityProperties(id, "userData"); + if (properties.userData) { + try { + results = JSON.parse(properties.userData); + } catch(err) { + logDebug(err); + logDebug(properties.userData); + } + } + return results ? results : {}; +} + + +// Non-destructively modify the user data of an entity. +setEntityCustomData = function(customKey, id, data) { + var userData = getEntityUserData(id); + if (data == null) { + delete userData[customKey]; + } else { + userData[customKey] = data; + } + setEntityUserData(id, userData); +} + +getEntityCustomData = function(customKey, id, defaultValue) { + var userData = getEntityUserData(id); + if (undefined != userData[customKey]) { + return userData[customKey]; + } else { + return defaultValue; + } +} + +mergeObjects = function(proto, custom) { + var result = {}; + for (var attrname in proto) { + result[attrname] = proto[attrname]; + } + for (var attrname in custom) { + result[attrname] = custom[attrname]; + } + return result; +} + +LOG_WARN = 1; + +logWarn = function(str) { + if (LOG_WARN) { + print(str); + } +} + +LOG_ERROR = 1; + +logError = function(str) { + if (LOG_ERROR) { + print(str); + } +} + +LOG_INFO = 1; + +logInfo = function(str) { + if (LOG_INFO) { + print(str); + } +} + +LOG_DEBUG = 0; + +logDebug = function(str) { + if (LOG_DEBUG) { + print(str); + } +} + +LOG_TRACE = 0; + +logTrace = function(str) { + if (LOG_TRACE) { + print(str); + } +} + +// Computes the penetration between a point and a sphere (centered at the origin) +// if point is inside sphere: returns true and stores the result in 'penetration' +// (the vector that would move the point outside the sphere) +// otherwise returns false +findSphereHit = function(point, sphereRadius) { + var EPSILON = 0.000001; //smallish positive number - used as margin of error for some computations + var vectorLength = Vec3.length(point); + if (vectorLength < EPSILON) { + return true; + } + var distance = vectorLength - sphereRadius; + if (distance < 0.0) { + return true; + } + return false; +} + +findSpherePointHit = function(sphereCenter, sphereRadius, point) { + return findSphereHit(Vec3.subtract(point,sphereCenter), sphereRadius); +} + +findSphereSphereHit = function(firstCenter, firstRadius, secondCenter, secondRadius) { + return findSpherePointHit(firstCenter, firstRadius + secondRadius, secondCenter); +} + +// Given a vec3 v, return a vec3 that is the same vector relative to the avatars +// DEFAULT eye position, rotated into the avatars reference frame. +getEyeRelativePosition = function(v) { + return Vec3.sum(MyAvatar.getDefaultEyePosition(), Vec3.multiplyQbyV(MyAvatar.orientation, v)); +} + +getAvatarRelativeRotation = function(q) { + return Quat.multiply(MyAvatar.orientation, q); +} + +pointInExtents = function(point, minPoint, maxPoint) { + return (point.x >= minPoint.x && point.x <= maxPoint.x) && + (point.y >= minPoint.y && point.y <= maxPoint.y) && + (point.z >= minPoint.z && point.z <= maxPoint.z); +} + +/** + * Converts an HSL color value to RGB. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes h, s, and l are contained in the set [0, 1] and + * returns r, g, and b in the set [0, 255]. + * + * @param Number h The hue + * @param Number s The saturation + * @param Number l The lightness + * @return Array The RGB representation + */ +hslToRgb = function(hsl) { + var r, g, b; + if (hsl.s == 0) { + r = g = b = hsl.l; // achromatic + } else { + var hue2rgb = function hue2rgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + + var q = hsl.l < 0.5 ? hsl.l * (1 + hsl.s) : hsl.l + hsl.s - hsl.l * hsl.s; + var p = 2 * hsl.l - q; + r = hue2rgb(p, q, hsl.h + 1 / 3); + g = hue2rgb(p, q, hsl.h); + b = hue2rgb(p, q, hsl.h - 1 / 3); + } + + return { + red: Math.round(r * 255), + green: Math.round(g * 255), + blue: Math.round(b * 255) + }; +} + +map = function(value, min1, max1, min2, max2) { + return min2 + (max2 - min2) * ((value - min1) / (max1 - min1)); +} + +orientationOf = function(vector) { + var Y_AXIS = { + x: 0, + y: 1, + z: 0 + }; + var X_AXIS = { + x: 1, + y: 0, + z: 0 + }; + + var theta = 0.0; + + var RAD_TO_DEG = 180.0 / Math.PI; + var direction, yaw, pitch; + direction = Vec3.normalize(vector); + yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * RAD_TO_DEG, Y_AXIS); + pitch = Quat.angleAxis(Math.asin(-direction.y) * RAD_TO_DEG, X_AXIS); + return Quat.multiply(yaw, pitch); +} + +randFloat = function(low, high) { + return low + Math.random() * (high - low); +} + + +randInt = function(low, high) { + return Math.floor(randFloat(low, high)); +} + + +randomColor = function() { + return { + red: randInt(0, 255), + green: randInt(0, 255), + blue: randInt(0, 255) + } +} + + +hexToRgb = function(hex) { + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? { + red: parseInt(result[1], 16), + green: parseInt(result[2], 16), + blue: parseInt(result[3], 16) + } : null; +} + +calculateHandSizeRatio = function() { + // Get the ratio of the current avatar's hand to Owen's hand + + var standardCenterHandPoint = 0.11288; + var jointNames = MyAvatar.getJointNames(); + //get distance from handJoint up to leftHandIndex3 as a proxy for center of hand + var wristToFingertipDistance = 0;; + for (var i = 0; i < jointNames.length; i++) { + var jointName = jointNames[i]; + print(jointName) + if (jointName.indexOf("LeftHandIndex") !== -1) { + // translations are relative to parent joint, so simply add them together + // joints face down the y-axis + var translation = MyAvatar.getDefaultJointTranslation(i).y; + wristToFingertipDistance += translation; + } + } + // Right now units are in cm, so convert to meters + wristToFingertipDistance /= 100; + + var centerHandPoint = wristToFingertipDistance/2; + + // Compare against standard hand (Owen) + var handSizeRatio = centerHandPoint/standardCenterHandPoint; + return handSizeRatio; +} + +clamp = function(val, min, max){ + return Math.max(min, Math.min(max, val)) + } + diff --git a/examples/notifications.js b/scripts/system/notifications.js similarity index 98% rename from examples/notifications.js rename to scripts/system/notifications.js index 63d94fbd92..7d97470b8a 100644 --- a/examples/notifications.js +++ b/scripts/system/notifications.js @@ -55,7 +55,7 @@ // createNotification(noteString, NotificationType.SNAPSHOT); // } // } -Script.include("./libraries/globals.js"); + Script.include("./libraries/soundArray.js"); var width = 340.0; //width of notification overlay @@ -120,7 +120,8 @@ var NotificationType = { var randomSounds = new SoundArray({ localOnly: true }, true); var numberOfSounds = 2; for (var i = 1; i <= numberOfSounds; i++) { - randomSounds.addSound(HIFI_PUBLIC_BUCKET + "sounds/UI/notification-general" + i + ".raw"); + + randomSounds.addSound(Script.resolvePath("assets/sounds/notification-general"+ i + ".raw")); } var notifications = []; @@ -328,7 +329,7 @@ function createNotification(text, notificationType) { width: 10.0, height: 10.0, subImage: { x: 0, y: 0, width: 10, height: 10 }, - imageURL: "http://hifi-public.s3.amazonaws.com/images/close-small-light.svg", + imageURL: Script.resolvePath("assets/images/close-small-light.svg"), color: { red: 255, green: 255, blue: 255}, visible: true, alpha: backgroundAlpha diff --git a/examples/particle_explorer/dat.gui.min.js b/scripts/system/particle_explorer/dat.gui.min.js similarity index 100% rename from examples/particle_explorer/dat.gui.min.js rename to scripts/system/particle_explorer/dat.gui.min.js diff --git a/examples/particle_explorer/particleExplorer.html b/scripts/system/particle_explorer/particleExplorer.html similarity index 96% rename from examples/particle_explorer/particleExplorer.html rename to scripts/system/particle_explorer/particleExplorer.html index 2ab89c98ca..1de176214c 100644 --- a/examples/particle_explorer/particleExplorer.html +++ b/scripts/system/particle_explorer/particleExplorer.html @@ -18,7 +18,7 @@ - +