From 82dbdec78c074b8eb6b5690edfc349b61407fb3e Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 3 Nov 2015 11:54:01 -0800 Subject: [PATCH 01/42] helicopter --- examples/helicopter/helicopter.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/helicopter/helicopter.js diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js new file mode 100644 index 0000000000..3ce084c305 --- /dev/null +++ b/examples/helicopter/helicopter.js @@ -0,0 +1,16 @@ +var modelURL= "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx"; +var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation()))); + +var helicopter = Entities.addEntity({ + type: "Model", + modelURL: modelURL, + position: center +}); + + + +function cleanup() { + Entities.deleteEntity(helicopter); +} + +Script.scriptEnding.connect(cleanup); \ No newline at end of file From 443df042a4b050a18a64934a28b491c53bba6128 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 3 Nov 2015 12:40:41 -0800 Subject: [PATCH 02/42] playing with light pos/rot --- examples/helicopter/helicopter.js | 50 ++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index 3ce084c305..7631f166f9 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -1,16 +1,64 @@ -var modelURL= "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx"; +var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx"; var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation()))); +// These constants define the Spotlight position and orientation relative to the model +var MODEL_LIGHT_POSITION = { + x: -2, + y: 0, + z: 0 +}; +var MODEL_LIGHT_ROTATION = Quat.angleAxis(-90, { + x: 0, + y: 1, + z: 0 +}); + +// Evaluate the world light entity positions and orientations from the model ones +function evalLightWorldTransform(modelPos, modelRot) { + + return { + p: Vec3.sum(modelPos, Vec3.multiplyQbyV(modelRot, MODEL_LIGHT_POSITION)), + q: Quat.multiply(modelRot, MODEL_LIGHT_ROTATION) + }; +} + + var helicopter = Entities.addEntity({ type: "Model", + name: "Helicopter", modelURL: modelURL, position: center }); +var modelProperties = Entities.getEntityProperties(helicopter, ['position', 'rotation']); +var lightTransform = evalLightWorldTransform(modelProperties.position, modelProperties.rotation); +var spotlight = Entities.addEntity({ + type: "Light", + name: "helicopter light", + position: lightTransform.p, + rotation: lightTransform.q, + intensity: 2, + color: {red: 200, green: 200, blue: 255}, + intensity: 2, + exponent: 0.3, + cutoff: 20 +}); + +var debugLight = Entities.addEntity({ + type: "Box", + position: lightTransform.p, + rotation: lightTransform.q, + dimensions: {x: 4, y: 1, z: 1}, + color: {red: 200, green: 200, blue: 0} +}); + function cleanup() { + Entities.deleteEntity(debugLight); Entities.deleteEntity(helicopter); + Entities.deleteEntity(spotlight); + } Script.scriptEnding.connect(cleanup); \ No newline at end of file From 58587a5780aa6eba447af94f987690aed3c6165b Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 3 Nov 2015 13:26:39 -0800 Subject: [PATCH 03/42] spotlight --- examples/helicopter/helicopter.js | 70 ++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index 7631f166f9..22df9e56b7 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -1,16 +1,16 @@ -var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx"; -var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation()))); +var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx?v3"; +var center = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(Camera.getOrientation()))); // These constants define the Spotlight position and orientation relative to the model var MODEL_LIGHT_POSITION = { - x: -2, + x: 2, y: 0, - z: 0 + z: -5 }; -var MODEL_LIGHT_ROTATION = Quat.angleAxis(-90, { +var MODEL_LIGHT_ROTATION = Quat.angleAxis(0, { x: 0, - y: 1, - z: 0 + y: 0, + z: 1 }); // Evaluate the world light entity positions and orientations from the model ones @@ -27,31 +27,46 @@ var helicopter = Entities.addEntity({ type: "Model", name: "Helicopter", modelURL: modelURL, - position: center + dimensions: {x: 12.13, y: 3.14, z: 9.92}, + // rotation: Quat.fromPitchYawRollDegrees(0, -90, 0), + position: center, + collisionsWillMove: true }); -var modelProperties = Entities.getEntityProperties(helicopter, ['position', 'rotation']); -var lightTransform = evalLightWorldTransform(modelProperties.position, modelProperties.rotation); var spotlight = Entities.addEntity({ type: "Light", name: "helicopter light", - position: lightTransform.p, - rotation: lightTransform.q, intensity: 2, - color: {red: 200, green: 200, blue: 255}, - intensity: 2, - exponent: 0.3, - cutoff: 20 + color: { + red: 200, + green: 200, + blue: 255 + }, + intensity: 10, + dimensions: { + x: 2, + y: 2, + z: 200 + }, + exponent: .1, + cutoff: 10, + isSpotlight: true }); var debugLight = Entities.addEntity({ type: "Box", - position: lightTransform.p, - rotation: lightTransform.q, - dimensions: {x: 4, y: 1, z: 1}, - color: {red: 200, green: 200, blue: 0} + dimensions: { + x: .1, + y: .1, + z: .3 + }, + color: { + red: 200, + green: 200, + blue: 0 + } }); function cleanup() { @@ -61,4 +76,19 @@ function cleanup() { } +function update() { + var modelProperties = Entities.getEntityProperties(helicopter, ['position', 'rotation']); + var lightTransform = evalLightWorldTransform(modelProperties.position, modelProperties.rotation); + Entities.editEntity(spotlight, { + position: lightTransform.p, + // rotation: lightTransform.q + }); + Entities.editEntity(debugLight, { + position: lightTransform.p, + rotation: lightTransform.q + }); +} + + +Script.update.connect(update); Script.scriptEnding.connect(cleanup); \ No newline at end of file From 0846c3bef4702177969837bab9867669ec173927 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 3 Nov 2015 14:12:56 -0800 Subject: [PATCH 04/42] moving --- examples/helicopter/helicopter.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index 22df9e56b7..748d1d62c3 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -1,5 +1,13 @@ var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx?v3"; -var center = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(Camera.getOrientation()))); +var spawnPosition = {x: 1031, y: 135, z: 1041}; + +var speed = .1; + +var helicopterSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/ryan/helicopter.L.wav"); +var audioInjector = Audio.playSound(helicopterSound, { + volume: 1, + loop: true +}); // These constants define the Spotlight position and orientation relative to the model var MODEL_LIGHT_POSITION = { @@ -29,8 +37,7 @@ var helicopter = Entities.addEntity({ modelURL: modelURL, dimensions: {x: 12.13, y: 3.14, z: 9.92}, // rotation: Quat.fromPitchYawRollDegrees(0, -90, 0), - position: center, - collisionsWillMove: true + position: spawnPosition, }); @@ -50,8 +57,8 @@ var spotlight = Entities.addEntity({ y: 2, z: 200 }, - exponent: .1, - cutoff: 10, + exponent: 1, + cutoff: 40, isSpotlight: true }); @@ -87,6 +94,18 @@ function update() { position: lightTransform.p, rotation: lightTransform.q }); + + audioInjector.setOptions({ + position: modelProperties.position, + }); + + //Move forward + var newRotation = Quat.multiply(modelProperties.rotation, {x: 0, y: .001, z: 0, w: 1}) + var newPosition = Vec3.sum(modelProperties.position, Vec3.multiply(speed, Quat.getFront(modelProperties.rotation))); + Entities.editEntity(helicopter, { + position: newPosition, + rotation: newRotation + }) } From ed2bd075859c20c48c1942ec215aa93fed930153 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 3 Nov 2015 14:54:05 -0800 Subject: [PATCH 05/42] rotating blade --- examples/helicopter/helicopter.js | 50 +++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index 748d1d62c3..154613f20c 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -1,5 +1,10 @@ var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx?v3"; -var spawnPosition = {x: 1031, y: 135, z: 1041}; +var animationURL = "https://s3.amazonaws.com/hifi-public/eric/models/bladeAnimation.fbx?v7"; +var spawnPosition = { + x: 1031, + y: 135, + z: 1041 +}; var speed = .1; @@ -15,7 +20,7 @@ var MODEL_LIGHT_POSITION = { y: 0, z: -5 }; -var MODEL_LIGHT_ROTATION = Quat.angleAxis(0, { +var MODEL_LIGHT_ROTATION = Quat.angleAxis(0, { x: 0, y: 0, z: 1 @@ -35,7 +40,17 @@ var helicopter = Entities.addEntity({ type: "Model", name: "Helicopter", modelURL: modelURL, - dimensions: {x: 12.13, y: 3.14, z: 9.92}, + animation: { + url: animationURL, + running: true, + fps: 180 + + }, + dimensions: { + x: 12.13, + y: 3.14, + z: 9.92 + }, // rotation: Quat.fromPitchYawRollDegrees(0, -90, 0), position: spawnPosition, }); @@ -87,25 +102,30 @@ function update() { var modelProperties = Entities.getEntityProperties(helicopter, ['position', 'rotation']); var lightTransform = evalLightWorldTransform(modelProperties.position, modelProperties.rotation); Entities.editEntity(spotlight, { - position: lightTransform.p, - // rotation: lightTransform.q + position: lightTransform.p, + // rotation: lightTransform.q }); - Entities.editEntity(debugLight, { - position: lightTransform.p, - rotation: lightTransform.q + Entities.editEntity(debugLight, { + position: lightTransform.p, + rotation: lightTransform.q }); - audioInjector.setOptions({ + audioInjector.setOptions({ position: modelProperties.position, - }); + }); - //Move forward - var newRotation = Quat.multiply(modelProperties.rotation, {x: 0, y: .001, z: 0, w: 1}) - var newPosition = Vec3.sum(modelProperties.position, Vec3.multiply(speed, Quat.getFront(modelProperties.rotation))); - Entities.editEntity(helicopter, { + //Move forward + var newRotation = Quat.multiply(modelProperties.rotation, { + x: 0, + y: .001, + z: 0, + w: 1 + }) + var newPosition = Vec3.sum(modelProperties.position, Vec3.multiply(speed, Quat.getFront(modelProperties.rotation))); + Entities.editEntity(helicopter, { position: newPosition, rotation: newRotation - }) + }) } From 0650280fb665f60a54858a3831d75ab35b27ee46 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 3 Nov 2015 15:14:56 -0800 Subject: [PATCH 06/42] tweaks --- examples/helicopter/helicopter.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index 154613f20c..44482e1c85 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -2,15 +2,15 @@ var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/helicopter.fbx? var animationURL = "https://s3.amazonaws.com/hifi-public/eric/models/bladeAnimation.fbx?v7"; var spawnPosition = { x: 1031, - y: 135, + y: 145, z: 1041 }; -var speed = .1; +var speed = .15; var helicopterSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/ryan/helicopter.L.wav"); var audioInjector = Audio.playSound(helicopterSound, { - volume: 1, + volume: 0.3, loop: true }); @@ -20,10 +20,10 @@ var MODEL_LIGHT_POSITION = { y: 0, z: -5 }; -var MODEL_LIGHT_ROTATION = Quat.angleAxis(0, { - x: 0, +var MODEL_LIGHT_ROTATION = Quat.angleAxis(-90, { + x: 1, y: 0, - z: 1 + z: 0 }); // Evaluate the world light entity positions and orientations from the model ones @@ -66,14 +66,14 @@ var spotlight = Entities.addEntity({ green: 200, blue: 255 }, - intensity: 10, + intensity: 1, dimensions: { x: 2, y: 2, z: 200 }, - exponent: 1, - cutoff: 40, + exponent: 0.01, + cutoff: 10, isSpotlight: true }); @@ -103,7 +103,7 @@ function update() { var lightTransform = evalLightWorldTransform(modelProperties.position, modelProperties.rotation); Entities.editEntity(spotlight, { position: lightTransform.p, - // rotation: lightTransform.q + rotation: lightTransform.q }); Entities.editEntity(debugLight, { position: lightTransform.p, @@ -117,7 +117,7 @@ function update() { //Move forward var newRotation = Quat.multiply(modelProperties.rotation, { x: 0, - y: .001, + y: .002, z: 0, w: 1 }) From 3c227db08ddd32b3e372e14c47ff45a09a0be43a Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Wed, 4 Nov 2015 11:27:16 -0800 Subject: [PATCH 07/42] explode heli --- examples/helicopter/explodeHelicopter.js | 62 ++++++++++++++++++++++++ examples/helicopter/helicopter.js | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 examples/helicopter/explodeHelicopter.js diff --git a/examples/helicopter/explodeHelicopter.js b/examples/helicopter/explodeHelicopter.js new file mode 100644 index 0000000000..98e806dbfd --- /dev/null +++ b/examples/helicopter/explodeHelicopter.js @@ -0,0 +1,62 @@ +var partsURLS = [ + "https://s3.amazonaws.com/hifi-public/eric/models/blade.fbx", + "https://s3.amazonaws.com/hifi-public/eric/models/body.fbx", + "https://s3.amazonaws.com/hifi-public/eric/models/tail.fbx", +] + +var parts = []; + +var explodePosition; +var helicopter; +var entities = Entities.findEntities(MyAvatar.position, 2000); +for (i = 0; i < entities.length; i++) { + var name = Entities.getEntityProperties(entities[i], 'name').name; + if (name === "Helicopter") { + helicopter = entities[i]; + explodeHelicopter(Entities.getEntityProperties(helicopter, 'position').position); + } +} + + +function explodeHelicopter(explodePosition) { + Entities.deleteEntity(helicopter); + for (var i = 0; i < partsURLS.length; i++) { + var part = Entities.addEntity({ + type: "Model", + modelURL: partsURLS[i], + position: explodePosition, + shapeType: "box", + damping: 0 + }); + parts.push(part); + } + + Script.setTimeout(function() { + parts.forEach(function(part) { + var naturalDimensions = Entities.getEntityProperties(part, "naturalDimensions").naturalDimensions; + Entities.editEntity(part, { + dimensions: naturalDimensions, + gravity: { + x: 0, + y: -9.6, + z: 0 + }, + velocity: { + x: Math.random(), + y: -10, + z: Math.random() + }, + collisionsWillMove: true + }); + }); + }, 1000); + +} + +function cleanup() { + parts.forEach(function(part) { + Entities.deleteEntity(part); + }); +} + +Script.scriptEnding.connect(cleanup); \ No newline at end of file diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index 44482e1c85..c1ad0f9d30 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -6,7 +6,7 @@ var spawnPosition = { z: 1041 }; -var speed = .15; +var speed = 0; var helicopterSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/ryan/helicopter.L.wav"); var audioInjector = Audio.playSound(helicopterSound, { From b7840fdd6b48f4a921e72e54817187dc26f874f6 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Wed, 4 Nov 2015 15:01:55 -0800 Subject: [PATCH 08/42] explosion --- examples/helicopter/explodeHelicopter.js | 136 ++++++++++++++++++----- 1 file changed, 109 insertions(+), 27 deletions(-) diff --git a/examples/helicopter/explodeHelicopter.js b/examples/helicopter/explodeHelicopter.js index 98e806dbfd..efca1a91cc 100644 --- a/examples/helicopter/explodeHelicopter.js +++ b/examples/helicopter/explodeHelicopter.js @@ -1,10 +1,30 @@ -var partsURLS = [ - "https://s3.amazonaws.com/hifi-public/eric/models/blade.fbx", - "https://s3.amazonaws.com/hifi-public/eric/models/body.fbx", - "https://s3.amazonaws.com/hifi-public/eric/models/tail.fbx", -] +var explosionSound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/eric/sounds/explosion.wav"); + +var partsURLS = [{ + url: "https://s3.amazonaws.com/hifi-public/eric/models/blade.fbx", + dimensions: { + x: 2, + y: 2, + z: 2 + } +}, { + url: "https://s3.amazonaws.com/hifi-public/eric/models/body.fbx", + dimensions: { + x: 2.2, + y: 2.98, + z: 7.96 + } +}, { + url: "https://s3.amazonaws.com/hifi-public/eric/models/tail.fbx", + dimensions: { + x: 1, + y: 1, + z: 1 + } +}]; var parts = []; +var emitters = []; var explodePosition; var helicopter; @@ -12,44 +32,103 @@ var entities = Entities.findEntities(MyAvatar.position, 2000); for (i = 0; i < entities.length; i++) { var name = Entities.getEntityProperties(entities[i], 'name').name; if (name === "Helicopter") { - helicopter = entities[i]; + var helicopter = entities[i]; explodeHelicopter(Entities.getEntityProperties(helicopter, 'position').position); } } function explodeHelicopter(explodePosition) { + Audio.playSound(explosionSound, { + position: explodePosition, + volume: 0.5 + }); Entities.deleteEntity(helicopter); for (var i = 0; i < partsURLS.length; i++) { + var position = Vec3.sum(explodePosition, { + x: 1, + y: 1, + z: 1 + }); var part = Entities.addEntity({ type: "Model", - modelURL: partsURLS[i], - position: explodePosition, + modelURL: partsURLS[i].url, + dimensions: partsURLS[i].dimensions, + position: position, shapeType: "box", - damping: 0 + collisionsWillMove: true, + damping: 0, + gravity: { + x: 0, + y: -9.6, + z: 0 + }, + velocity: { + x: Math.random(), + y: -10, + z: Math.random() + } }); + + var emitter = Entities.addEntity({ + type: "ParticleEffect", + name: "fire", + isEmitting: true, + textures: "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png", + position: explodePosition, + emitRate: 100, + colorStart: { + red: 70, + green: 70, + blue: 137 + }, + color: { + red: 200, + green: 99, + blue: 42 + }, + colorFinish: { + red: 255, + green: 99, + blue: 32 + }, + radiusSpread: 0.2, + radiusStart: 0.3, + radiusEnd: 0.04, + particleRadius: 0.09, + radiusFinish: 0.0, + emitSpeed: 0.1, + speedSpread: 0.1, + alphaStart: 0.1, + alpha: 0.7, + alphaFinish: 0.1, + emitOrientation: Quat.fromPitchYawRollDegrees(-90, 0, 0), + emitDimensions: { + x: 1, + y: 1, + z: 0.1 + }, + polarFinish: Math.PI, + polarStart: 0, + + accelerationSpread: { + x: 0.1, + y: 0.01, + z: 0.1 + }, + lifespan: 1, + }); + emitters.push(emitter) parts.push(part); } Script.setTimeout(function() { - parts.forEach(function(part) { - var naturalDimensions = Entities.getEntityProperties(part, "naturalDimensions").naturalDimensions; - Entities.editEntity(part, { - dimensions: naturalDimensions, - gravity: { - x: 0, - y: -9.6, - z: 0 - }, - velocity: { - x: Math.random(), - y: -10, - z: Math.random() - }, - collisionsWillMove: true - }); - }); - }, 1000); + var pos = Entities.getEntityProperties(parts[1], "position").position; + Entities.editEntity(emitters[0], {position: Vec3.sum(pos, {x: Math.random(), y: Math.random(), z: Math.random()})}); + Entities.editEntity(emitters[1], {position: Vec3.sum(pos, {x: Math.random(), y: Math.random(), z: Math.random()})}); + Entities.editEntity(emitters[2], {position: Vec3.sum(pos, {x: Math.random(), y: Math.random(), z: Math.random()})}); + }, 5000) + } @@ -57,6 +136,9 @@ function cleanup() { parts.forEach(function(part) { Entities.deleteEntity(part); }); + emitters.forEach(function(emitter){ + Entities.deleteEntity(emitter); + }) } Script.scriptEnding.connect(cleanup); \ No newline at end of file From f4c610a0f49cf6eb95bc9ae750bee77a6488762b Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 4 Nov 2015 18:21:04 -0800 Subject: [PATCH 09/42] Tuning the standard mapping for tbringin vertical axis --- interface/resources/controllers/standard.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/interface/resources/controllers/standard.json b/interface/resources/controllers/standard.json index 5de188c0b6..bd2e0c437f 100644 --- a/interface/resources/controllers/standard.json +++ b/interface/resources/controllers/standard.json @@ -15,7 +15,7 @@ }, { "from": "Standard.RX", "to": "Actions.Yaw" }, { "from": "Standard.RY", "when": "!Application.InHMD", "to": "Actions.Pitch" }, - + { "from": "Standard.RY", "when": "Application.InHMD", "filters": "invert", "to": "Actions.TranslateY" }, { "from": [ "Standard.DU", "Standard.DL", "Standard.DR", "Standard.DD" ], "to": "Standard.LeftPrimaryThumb" }, { "from": "Standard.Back", "to": "Standard.LeftSecondaryThumb" }, @@ -35,3 +35,6 @@ } + + + From 46d9a14951f8452897477a6d47bfd34618eaddbe Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 6 Nov 2015 09:35:20 -0800 Subject: [PATCH 10/42] Work in progress, fixing the animation playback --- interface/src/avatar/Avatar.cpp | 11 +++++++++++ interface/src/avatar/Avatar.h | 1 + libraries/avatars/src/AvatarData.cpp | 15 +++++++++++++++ libraries/avatars/src/AvatarData.h | 1 + libraries/avatars/src/Player.cpp | 11 ++++++----- libraries/avatars/src/Recorder.cpp | 2 ++ 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index b979334383..a5ae8cddda 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -888,6 +888,17 @@ glm::quat Avatar::getJointRotation(int index) const { return rotation; } +QVector Avatar::getJointTranslations() const { + if (QThread::currentThread() != thread()) { + return AvatarData::getJointTranslations(); + } + QVector jointTranslations(_skeletonModel.getJointStateCount()); + for (int i = 0; i < _skeletonModel.getJointStateCount(); ++i) { + _skeletonModel.getJointTranslation(i, jointTranslations[i]); + } + return jointTranslations; +} + glm::vec3 Avatar::getJointTranslation(int index) const { if (QThread::currentThread() != thread()) { return AvatarData::getJointTranslation(index); diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 44b5d91015..cb7c533db6 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -103,6 +103,7 @@ public: virtual QVector getJointRotations() const; virtual glm::quat getJointRotation(int index) const; + virtual QVector getJointTranslations() const; virtual glm::vec3 getJointTranslation(int index) const; virtual int getJointIndex(const QString& name) const; virtual QStringList getJointNames() const; diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index a698c6f374..a13c01901e 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -1146,6 +1146,21 @@ void AvatarData::setJointRotations(QVector jointRotations) { } } +QVector AvatarData::getJointTranslations() const { + if (QThread::currentThread() != thread()) { + QVector result; + QMetaObject::invokeMethod(const_cast(this), + "getJointTranslations", Qt::BlockingQueuedConnection, + Q_RETURN_ARG(QVector, result)); + return result; + } + QVector jointTranslations(_jointData.size()); + for (int i = 0; i < _jointData.size(); ++i) { + jointTranslations[i] = _jointData[i].translation; + } + return jointTranslations; +} + void AvatarData::setJointTranslations(QVector jointTranslations) { if (QThread::currentThread() != thread()) { QVector result; diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 3abd63bf63..da857f2f8a 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -260,6 +260,7 @@ public: Q_INVOKABLE virtual QVector getJointRotations() const; Q_INVOKABLE virtual void setJointRotations(QVector jointRotations); + Q_INVOKABLE virtual QVector getJointTranslations() const; Q_INVOKABLE virtual void setJointTranslations(QVector jointTranslations); Q_INVOKABLE virtual void clearJointsData(); diff --git a/libraries/avatars/src/Player.cpp b/libraries/avatars/src/Player.cpp index a425323a41..bb98f51139 100644 --- a/libraries/avatars/src/Player.cpp +++ b/libraries/avatars/src/Player.cpp @@ -247,19 +247,20 @@ void Player::play() { _frameInterpolationFactor); _avatar->setTargetScale(context->scale * scale); - + float animFactor = 0.0f; + QVector jointRotations(currentFrame.getJointRotations().size()); for (int i = 0; i < currentFrame.getJointRotations().size(); ++i) { jointRotations[i] = safeMix(currentFrame.getJointRotations()[i], nextFrame.getJointRotations()[i], - _frameInterpolationFactor); + animFactor); } QVector jointTranslations(currentFrame.getJointTranslations().size()); for (int i = 0; i < currentFrame.getJointTranslations().size(); ++i) { - jointTranslations[i] = - currentFrame.getJointTranslations()[i] * (1.0f - _frameInterpolationFactor) + - nextFrame.getJointTranslations()[i] * _frameInterpolationFactor; + jointTranslations[i] = glm::mix(currentFrame.getJointTranslations()[i], + nextFrame.getJointTranslations()[i], + animFactor); } _avatar->setJointRotations(jointRotations); diff --git a/libraries/avatars/src/Recorder.cpp b/libraries/avatars/src/Recorder.cpp index 8a90500f00..eeaa8cb1fd 100644 --- a/libraries/avatars/src/Recorder.cpp +++ b/libraries/avatars/src/Recorder.cpp @@ -101,6 +101,7 @@ void Recorder::record() { RecordingFrame frame; frame.setBlendshapeCoefficients(_avatar->getHeadData()->getBlendshapeCoefficients()); frame.setJointRotations(_avatar->getJointRotations()); + frame.setJointTranslations(_avatar->getJointTranslations()); frame.setTranslation(context.orientationInv * (_avatar->getPosition() - context.position)); frame.setRotation(context.orientationInv * _avatar->getOrientation()); frame.setScale(_avatar->getTargetScale() / context.scale); @@ -124,6 +125,7 @@ void Recorder::record() { qCDebug(avatars) << "Recording frame #" << _recording->getFrameNumber(); qCDebug(avatars) << "Blendshapes:" << frame.getBlendshapeCoefficients().size(); qCDebug(avatars) << "JointRotations:" << frame.getJointRotations().size(); + qCDebug(avatars) << "JointRotations:" << frame.getJointTranslations().size(); qCDebug(avatars) << "Translation:" << frame.getTranslation(); qCDebug(avatars) << "Rotation:" << frame.getRotation(); qCDebug(avatars) << "Scale:" << frame.getScale(); From 4dbca687678b8075ef1084fc8b36e162586a2caa Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 6 Nov 2015 16:24:19 -0800 Subject: [PATCH 11/42] Updating the legacy file format to support the joint translation and also fix the replay problem oof the joints going to the moon --- libraries/avatars/src/Recorder.cpp | 10 ++++++---- libraries/avatars/src/Recording.cpp | 23 +++++++++++++++++++---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/libraries/avatars/src/Recorder.cpp b/libraries/avatars/src/Recorder.cpp index eeaa8cb1fd..68e667604b 100644 --- a/libraries/avatars/src/Recorder.cpp +++ b/libraries/avatars/src/Recorder.cpp @@ -100,13 +100,15 @@ void Recorder::record() { const RecordingContext& context = _recording->getContext(); RecordingFrame frame; frame.setBlendshapeCoefficients(_avatar->getHeadData()->getBlendshapeCoefficients()); - frame.setJointRotations(_avatar->getJointRotations()); - frame.setJointTranslations(_avatar->getJointTranslations()); + // FIXME: here we need to make sure the correct joint data on the AvatarData to get correct play back. + // This should be fixed by a fix coming from Howard soon + frame.setJointRotations(_avatar->::AvatarData::getJointRotations()); + frame.setJointTranslations(_avatar->::AvatarData::getJointTranslations()); + frame.setTranslation(context.orientationInv * (_avatar->getPosition() - context.position)); frame.setRotation(context.orientationInv * _avatar->getOrientation()); frame.setScale(_avatar->getTargetScale() / context.scale); - - + const HeadData* head = _avatar->getHeadData(); if (head) { glm::vec3 rotationDegrees = glm::vec3(head->getFinalPitch(), diff --git a/libraries/avatars/src/Recording.cpp b/libraries/avatars/src/Recording.cpp index 2e2f46552d..4ca56421e5 100644 --- a/libraries/avatars/src/Recording.cpp +++ b/libraries/avatars/src/Recording.cpp @@ -239,12 +239,21 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) { if (i == 0 || frame._jointRotations[j] != previousFrame._jointRotations[j]) { writeQuat(stream, frame._jointRotations[j]); - // TODO -- handle translations mask.setBit(maskIndex); } maskIndex++; } - + + // Joint Translations + for (quint32 j = 0; j < numJoints; ++j) { + if (i == 0 || + frame._jointTranslations[j] != previousFrame._jointTranslations[j]) { + writeVec3(stream, frame._jointTranslations[j]); + mask.setBit(maskIndex); + } + maskIndex++; + } + // Translation if (i == 0) { mask.resize(mask.size() + 1); @@ -563,8 +572,14 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString } } - // TODO -- handle translations - + // Joint Translations + frame._jointTranslations.resize(numJoints); + for (quint32 j = 0; j < numJoints; ++j) { + if (!mask[maskIndex++] || !readVec3(stream, frame._jointTranslations[j])) { + frame._jointTranslations[j] = previousFrame._jointTranslations[j]; + } + } + if (!mask[maskIndex++] || !readVec3(stream, frame._translation)) { frame._translation = previousFrame._translation; } From bc852d8eab14d6d6b05202e338470141c7197aff Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 6 Nov 2015 16:39:23 -0800 Subject: [PATCH 12/42] removing useless differences --- interface/resources/controllers/standard.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/interface/resources/controllers/standard.json b/interface/resources/controllers/standard.json index c0e765dd77..6f1b2dbdff 100644 --- a/interface/resources/controllers/standard.json +++ b/interface/resources/controllers/standard.json @@ -14,6 +14,7 @@ ] }, { "from": "Standard.RX", "to": "Actions.Yaw" }, + { "from": "Standard.RY", "when": "Application.Grounded", "to": "Actions.Up", @@ -42,7 +43,3 @@ ] } - - - - From b1d5a36dc65ba07db594de79d40f0c063340aa2c Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 6 Nov 2015 16:40:46 -0800 Subject: [PATCH 13/42] removing useless differences --- interface/resources/controllers/standard.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/resources/controllers/standard.json b/interface/resources/controllers/standard.json index 6f1b2dbdff..d4988fc00d 100644 --- a/interface/resources/controllers/standard.json +++ b/interface/resources/controllers/standard.json @@ -14,7 +14,7 @@ ] }, { "from": "Standard.RX", "to": "Actions.Yaw" }, - + { "from": "Standard.RY", "when": "Application.Grounded", "to": "Actions.Up", @@ -43,3 +43,4 @@ ] } + From cbeb56aba4e99df963bdfdc8eb3ec5b716463688 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 6 Nov 2015 17:25:50 -0800 Subject: [PATCH 14/42] using the frameInterpolatorCOrrectly --- libraries/avatars/src/Player.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/avatars/src/Player.cpp b/libraries/avatars/src/Player.cpp index 485f8772ff..d3a7124226 100644 --- a/libraries/avatars/src/Player.cpp +++ b/libraries/avatars/src/Player.cpp @@ -246,21 +246,19 @@ void Player::play() { nextFrame.getScale(), _frameInterpolationFactor); _avatar->setTargetScale(context->scale * scale); - - float animFactor = 0.0f; QVector jointRotations(currentFrame.getJointRotations().size()); for (int i = 0; i < currentFrame.getJointRotations().size(); ++i) { jointRotations[i] = safeMix(currentFrame.getJointRotations()[i], nextFrame.getJointRotations()[i], - animFactor); + _frameInterpolationFactor); } QVector jointTranslations(currentFrame.getJointTranslations().size()); for (int i = 0; i < currentFrame.getJointTranslations().size(); ++i) { jointTranslations[i] = glm::mix(currentFrame.getJointTranslations()[i], nextFrame.getJointTranslations()[i], - animFactor); + _frameInterpolationFactor); } _avatar->setJointRotations(jointRotations); From b8357112660a0955077056d138acbe1e9d5e9d81 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 9 Nov 2015 12:04:17 -0800 Subject: [PATCH 15/42] Update script engine path resolution behavior The path resolution will now be relative to the script currently being evaluated *on its initial evaluation.* The previous behavior was that all paths would be resolved relative to the root script for client scripts, and inconsistent for entity scripts depending on the order that scripts were loaded. The entity script situation was particularly bad because including more than 1 level deep produced inconsistent results. --- libraries/script-engine/src/ScriptEngine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 381eef63db..e2a3143026 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -901,14 +901,19 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac BatchLoader* loader = new BatchLoader(urls); auto evaluateScripts = [=](const QMap& data) { + auto parentURL = _parentURL; for (QUrl url : urls) { QString contents = data[url]; if (contents.isNull()) { qCDebug(scriptengine) << "Error loading file: " << url << "line:" << __LINE__; } else { + // Set the parent url so that path resolution will be relative + // to this script's url during its initial evaluation + _parentURL = url.toString(); QScriptValue result = evaluate(contents, url.toString()); } } + _parentURL = parentURL; if (callback.isFunction()) { QScriptValue(callback).call(); From 8a434c8ab14bb2de5b84189d1a3d443afe207f04 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 9 Nov 2015 14:10:26 -0800 Subject: [PATCH 16/42] don't attempt to near-grab things that aren't physical --- examples/controllers/handControllerGrab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 5035f2e5a4..d308b3dc49 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -489,7 +489,7 @@ function MyController(hand) { if (grabbableData.wantsTrigger) { this.setState(STATE_NEAR_TRIGGER); return; - } else if (!props.locked) { + } else if (!props.locked && props.collisionsWillMove) { this.setState(STATE_NEAR_GRABBING); return; } From 767a7a7f1edf3395f8ca423ec6a122df8a43b87f Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 9 Nov 2015 14:26:23 -0800 Subject: [PATCH 17/42] Fix warnings on OS X --- interface/src/avatar/MyAvatar.cpp | 3 --- tests/recording/src/main.cpp | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 57af9e732d..8595fa850e 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1608,7 +1608,6 @@ void MyAvatar::updateOrientation(float deltaTime) { // Comfort Mode: If you press any of the left/right rotation drive keys or input, you'll // get an instantaneous 15 degree turn. If you keep holding the key down you'll get another // snap turn every half second. - quint64 now = usecTimestampNow(); if (_driveKeys[STEP_YAW] != 0.0f) { totalBodyYaw += _driveKeys[STEP_YAW]; } @@ -1676,8 +1675,6 @@ glm::vec3 MyAvatar::applyKeyboardMotor(float deltaTime, const glm::vec3& localVe float motorEfficiency = glm::clamp(deltaTime / timescale, 0.0f, 1.0f); glm::vec3 newLocalVelocity = localVelocity; - float stepControllerInput = fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]); - quint64 now = usecTimestampNow(); // FIXME how do I implement step translation as well? diff --git a/tests/recording/src/main.cpp b/tests/recording/src/main.cpp index 836d8b5ac1..96c9a7f1a7 100644 --- a/tests/recording/src/main.cpp +++ b/tests/recording/src/main.cpp @@ -12,8 +12,6 @@ #include "Constants.h" -#define QVERIFY Q_ASSERT - using namespace recording; FrameType TEST_FRAME_TYPE { Frame::TYPE_INVALID }; @@ -30,7 +28,8 @@ void testFrameTypeRegistration() { auto backMap = recording::Frame::getFrameTypeNames(); QVERIFY(backMap.count(TEST_FRAME_TYPE) == 1); QVERIFY(backMap[TEST_FRAME_TYPE] == TEST_NAME); - QVERIFY(backMap[recording::Frame::TYPE_HEADER] == HEADER_NAME); + auto typeHeader = recording::Frame::TYPE_HEADER; + QVERIFY(backMap[typeHeader] == HEADER_NAME); } void testFilePersist() { From e47b049200c6679fb266a99777f229d77796611a Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 9 Nov 2015 16:41:40 -0800 Subject: [PATCH 18/42] fix render item leak on Model::reset() --- libraries/render-utils/src/Model.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 6aae7ad1cb..2cb380a8e2 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -135,9 +135,6 @@ void Model::reset() { const FBXGeometry& geometry = _geometry->getFBXGeometry(); _rig->reset(geometry.joints); } - _meshGroupsKnown = false; - _readyWhenAdded = false; // in case any of our users are using scenes - invalidCalculatedMeshBoxes(); // if we have to reload, we need to assume our mesh boxes are all invalid } bool Model::updateGeometry() { From 021a6e689d92c26a4d2a84c6f0426bc592d8b4e7 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 9 Nov 2015 17:09:17 -0800 Subject: [PATCH 19/42] added some asserts to test future mistakes that would cause render item leaks --- libraries/render-utils/src/Model.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 2cb380a8e2..5b9bfdca3d 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1153,6 +1153,9 @@ void Model::segregateMeshGroups() { return; } + Q_ASSERT(_renderItems.isEmpty()); // We should not have any existing renderItems if we enter this section of code + Q_ASSERT(_renderItemsSet.isEmpty()); // We should not have any existing renderItemsSet if we enter this section of code + _renderItemsSet.clear(); // Run through all of the meshes, and place them into their segregated, but unsorted buckets From 77e21b7190ab2f999c4ff7bd9f1ed6b421ccd8d1 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 9 Nov 2015 18:18:30 -0800 Subject: [PATCH 20/42] Trying to fix the animation recording and playback, but still not good --- libraries/avatars/src/Player.cpp | 41 +++++++++++++++++++---- libraries/avatars/src/Recorder.cpp | 7 ++-- libraries/avatars/src/Recording.cpp | 51 ++++++++++++++++++++++++++--- libraries/avatars/src/Recording.h | 5 +++ 4 files changed, 91 insertions(+), 13 deletions(-) diff --git a/libraries/avatars/src/Player.cpp b/libraries/avatars/src/Player.cpp index d3a7124226..5ffaaf6c7b 100644 --- a/libraries/avatars/src/Player.cpp +++ b/libraries/avatars/src/Player.cpp @@ -247,22 +247,50 @@ void Player::play() { _frameInterpolationFactor); _avatar->setTargetScale(context->scale * scale); - QVector jointRotations(currentFrame.getJointRotations().size()); + const auto& prevJointArray = currentFrame.getJointArray(); + const auto& nextJointArray = currentFrame.getJointArray(); + QVector jointArray(prevJointArray.size()); + QVector jointRotations(prevJointArray.size()); + QVector jointTranslations(prevJointArray.size()); + + for (int i = 0; i < jointArray.size(); i++) { + const auto& prevJoint = prevJointArray[i]; + const auto& nextJoint = nextJointArray[i]; + auto& joint = jointArray[i]; + + // Rotation + joint.rotationSet = prevJoint.rotationSet || nextJoint.rotationSet; + if (joint.rotationSet) { + joint.rotation = safeMix(prevJoint.rotation, nextJoint.rotation, _frameInterpolationFactor); + jointRotations[i] = joint.rotation; + } + + joint.translationSet = prevJoint.translationSet || nextJoint.translationSet; + if (joint.translationSet) { + joint.translation = glm::mix(prevJoint.translation, nextJoint.translation, _frameInterpolationFactor); + jointTranslations[i] = joint.translation; + } + } + // _avatar->setRawJointData(jointArray); + _avatar->setJointRotations(jointRotations); + // _avatar->setJointTranslations(jointTranslations); + +/* QVector jointRotations(currentFrame.getJointRotations().size()); for (int i = 0; i < currentFrame.getJointRotations().size(); ++i) { jointRotations[i] = safeMix(currentFrame.getJointRotations()[i], nextFrame.getJointRotations()[i], _frameInterpolationFactor); } - - QVector jointTranslations(currentFrame.getJointTranslations().size()); + */ + /* QVector jointTranslations(currentFrame.getJointTranslations().size()); for (int i = 0; i < currentFrame.getJointTranslations().size(); ++i) { jointTranslations[i] = glm::mix(currentFrame.getJointTranslations()[i], nextFrame.getJointTranslations()[i], _frameInterpolationFactor); } - - _avatar->setJointRotations(jointRotations); - _avatar->setJointTranslations(jointTranslations); + */ + // _avatar->setJointRotations(jointRotations); + // _avatar->setJointTranslations(jointTranslations); HeadData* head = const_cast(_avatar->getHeadData()); if (head) { @@ -422,3 +450,4 @@ bool Player::computeCurrentFrame() { } return true; } + diff --git a/libraries/avatars/src/Recorder.cpp b/libraries/avatars/src/Recorder.cpp index 68e667604b..6da6596ab9 100644 --- a/libraries/avatars/src/Recorder.cpp +++ b/libraries/avatars/src/Recorder.cpp @@ -102,8 +102,11 @@ void Recorder::record() { frame.setBlendshapeCoefficients(_avatar->getHeadData()->getBlendshapeCoefficients()); // FIXME: here we need to make sure the correct joint data on the AvatarData to get correct play back. // This should be fixed by a fix coming from Howard soon - frame.setJointRotations(_avatar->::AvatarData::getJointRotations()); - frame.setJointTranslations(_avatar->::AvatarData::getJointTranslations()); + auto& jointData = _avatar->getRawJointData(); + + frame.setJointArray(jointData); + // frame.setJointRotations(_avatar->::AvatarData::getJointRotations()); + // frame.setJointTranslations(_avatar->::AvatarData::getJointTranslations()); frame.setTranslation(context.orientationInv * (_avatar->getPosition() - context.position)); frame.setRotation(context.orientationInv * _avatar->getOrientation()); diff --git a/libraries/avatars/src/Recording.cpp b/libraries/avatars/src/Recording.cpp index 4ca56421e5..a7d1cd5e86 100644 --- a/libraries/avatars/src/Recording.cpp +++ b/libraries/avatars/src/Recording.cpp @@ -229,7 +229,28 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) { ++maskIndex; } - // Joint Rotations + const auto& jointArray = frame.getJointArray(); + if (i == 0) { + numJoints = jointArray.size(); + stream << numJoints; + // 2 fields per joints + mask.resize(mask.size() + numJoints * 2); + } + for (int j = 0; j < numJoints; j++) { + const auto& joint = jointArray[j]; + if (joint.rotationSet) { + writeQuat(stream, joint.rotation); + mask.setBit(maskIndex); + } + maskIndex++; + if (joint.translationSet) { + writeVec3(stream, joint.translation); + mask.setBit(maskIndex); + } + maskIndex++; + } + + /* // Joint Rotations if (i == 0) { numJoints = frame.getJointRotations().size(); stream << numJoints; @@ -252,7 +273,7 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) { mask.setBit(maskIndex); } maskIndex++; - } + } */ // Translation if (i == 0) { @@ -561,10 +582,29 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString stream >> frame._blendshapeCoefficients[j]; } } - // Joint Rotations + // Joint Array if (i == 0) { stream >> numJoints; } + + frame._jointArray.resize(numJoints); + for (quint32 j = 0; j < numJoints; ++j) { + auto& joint = frame._jointArray[2]; + + if (mask[maskIndex++] && readQuat(stream, joint.rotation)) { + joint.rotationSet = true; + } else { + joint.rotationSet = false; + } + + if (mask[maskIndex++] || readVec3(stream, joint.translation)) { + joint.translationSet = true; + } else { + joint.translationSet = false; + } + } + + /* frame._jointRotations.resize(numJoints); for (quint32 j = 0; j < numJoints; ++j) { if (!mask[maskIndex++] || !readQuat(stream, frame._jointRotations[j])) { @@ -573,13 +613,14 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString } // Joint Translations - frame._jointTranslations.resize(numJoints); + /*frame._jointTranslations.resize(numJoints); for (quint32 j = 0; j < numJoints; ++j) { if (!mask[maskIndex++] || !readVec3(stream, frame._jointTranslations[j])) { frame._jointTranslations[j] = previousFrame._jointTranslations[j]; } } - + */ + if (!mask[maskIndex++] || !readVec3(stream, frame._translation)) { frame._translation = previousFrame._translation; } diff --git a/libraries/avatars/src/Recording.h b/libraries/avatars/src/Recording.h index 3533af6535..83d3642fdd 100644 --- a/libraries/avatars/src/Recording.h +++ b/libraries/avatars/src/Recording.h @@ -25,6 +25,7 @@ class AttachmentData; class Recording; class RecordingFrame; class Sound; +class JointData; typedef QSharedPointer RecordingPointer; @@ -82,6 +83,7 @@ private: class RecordingFrame { public: QVector getBlendshapeCoefficients() const { return _blendshapeCoefficients; } + QVector getJointArray() const { return _jointArray; } QVector getJointRotations() const { return _jointRotations; } QVector getJointTranslations() const { return _jointTranslations; } glm::vec3 getTranslation() const { return _translation; } @@ -94,6 +96,7 @@ public: protected: void setBlendshapeCoefficients(QVector blendshapeCoefficients); + void setJointArray(const QVector& jointArray) { _jointArray = jointArray; } void setJointRotations(QVector jointRotations) { _jointRotations = jointRotations; } void setJointTranslations(QVector jointTranslations) { _jointTranslations = jointTranslations; } void setTranslation(const glm::vec3& translation) { _translation = translation; } @@ -108,6 +111,8 @@ private: QVector _blendshapeCoefficients; QVector _jointRotations; QVector _jointTranslations; + QVector _jointArray; + glm::vec3 _translation; glm::quat _rotation; float _scale; From b47c5dbff2f8d1d20e3378014d99efa6cf3c8fd0 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 9 Nov 2015 23:12:04 -0800 Subject: [PATCH 21/42] Cleaning the code to remove the old rec format and the use of separate joint Rotationns/Translations arrays --- libraries/avatars/src/Player.cpp | 33 ++--- libraries/avatars/src/Recorder.cpp | 10 +- libraries/avatars/src/Recording.cpp | 212 +--------------------------- libraries/avatars/src/Recording.h | 7 - 4 files changed, 14 insertions(+), 248 deletions(-) diff --git a/libraries/avatars/src/Player.cpp b/libraries/avatars/src/Player.cpp index 5ffaaf6c7b..238753a217 100644 --- a/libraries/avatars/src/Player.cpp +++ b/libraries/avatars/src/Player.cpp @@ -247,11 +247,14 @@ void Player::play() { _frameInterpolationFactor); _avatar->setTargetScale(context->scale * scale); + // Joint array playback + // FIXME: THis is still using a deprecated path to assign the joint orientation since setting the full RawJointData array doesn't + // work for Avatar. We need to fix this working with the animation team const auto& prevJointArray = currentFrame.getJointArray(); const auto& nextJointArray = currentFrame.getJointArray(); QVector jointArray(prevJointArray.size()); - QVector jointRotations(prevJointArray.size()); - QVector jointTranslations(prevJointArray.size()); + QVector jointRotations(prevJointArray.size()); // FIXME: remove once the setRawJointData is fixed + QVector jointTranslations(prevJointArray.size()); // FIXME: remove once the setRawJointData is fixed for (int i = 0; i < jointArray.size(); i++) { const auto& prevJoint = prevJointArray[i]; @@ -262,35 +265,19 @@ void Player::play() { joint.rotationSet = prevJoint.rotationSet || nextJoint.rotationSet; if (joint.rotationSet) { joint.rotation = safeMix(prevJoint.rotation, nextJoint.rotation, _frameInterpolationFactor); - jointRotations[i] = joint.rotation; + jointRotations[i] = joint.rotation; // FIXME: remove once the setRawJointData is fixed } joint.translationSet = prevJoint.translationSet || nextJoint.translationSet; if (joint.translationSet) { joint.translation = glm::mix(prevJoint.translation, nextJoint.translation, _frameInterpolationFactor); - jointTranslations[i] = joint.translation; + jointTranslations[i] = joint.translation; // FIXME: remove once the setRawJointData is fixed } } - // _avatar->setRawJointData(jointArray); - _avatar->setJointRotations(jointRotations); - // _avatar->setJointTranslations(jointTranslations); -/* QVector jointRotations(currentFrame.getJointRotations().size()); - for (int i = 0; i < currentFrame.getJointRotations().size(); ++i) { - jointRotations[i] = safeMix(currentFrame.getJointRotations()[i], - nextFrame.getJointRotations()[i], - _frameInterpolationFactor); - } - */ - /* QVector jointTranslations(currentFrame.getJointTranslations().size()); - for (int i = 0; i < currentFrame.getJointTranslations().size(); ++i) { - jointTranslations[i] = glm::mix(currentFrame.getJointTranslations()[i], - nextFrame.getJointTranslations()[i], - _frameInterpolationFactor); - } - */ - // _avatar->setJointRotations(jointRotations); - // _avatar->setJointTranslations(jointTranslations); + // _avatar->setRawJointData(jointArray); // FIXME: Enable once the setRawJointData is fixed + _avatar->setJointRotations(jointRotations); // FIXME: remove once the setRawJointData is fixed + _avatar->setJointTranslations(jointTranslations); // FIXME: remove once the setRawJointData is fixed HeadData* head = const_cast(_avatar->getHeadData()); if (head) { diff --git a/libraries/avatars/src/Recorder.cpp b/libraries/avatars/src/Recorder.cpp index 6da6596ab9..5e47c296eb 100644 --- a/libraries/avatars/src/Recorder.cpp +++ b/libraries/avatars/src/Recorder.cpp @@ -100,13 +100,10 @@ void Recorder::record() { const RecordingContext& context = _recording->getContext(); RecordingFrame frame; frame.setBlendshapeCoefficients(_avatar->getHeadData()->getBlendshapeCoefficients()); - // FIXME: here we need to make sure the correct joint data on the AvatarData to get correct play back. - // This should be fixed by a fix coming from Howard soon - auto& jointData = _avatar->getRawJointData(); + // Capture the full skeleton joint data + auto& jointData = _avatar->getRawJointData(); frame.setJointArray(jointData); - // frame.setJointRotations(_avatar->::AvatarData::getJointRotations()); - // frame.setJointTranslations(_avatar->::AvatarData::getJointTranslations()); frame.setTranslation(context.orientationInv * (_avatar->getPosition() - context.position)); frame.setRotation(context.orientationInv * _avatar->getOrientation()); @@ -129,8 +126,7 @@ void Recorder::record() { if (wantDebug) { qCDebug(avatars) << "Recording frame #" << _recording->getFrameNumber(); qCDebug(avatars) << "Blendshapes:" << frame.getBlendshapeCoefficients().size(); - qCDebug(avatars) << "JointRotations:" << frame.getJointRotations().size(); - qCDebug(avatars) << "JointRotations:" << frame.getJointTranslations().size(); + qCDebug(avatars) << "JointArray:" << frame.getJointArray().size(); qCDebug(avatars) << "Translation:" << frame.getTranslation(); qCDebug(avatars) << "Rotation:" << frame.getRotation(); qCDebug(avatars) << "Scale:" << frame.getScale(); diff --git a/libraries/avatars/src/Recording.cpp b/libraries/avatars/src/Recording.cpp index a7d1cd5e86..dd9c722e26 100644 --- a/libraries/avatars/src/Recording.cpp +++ b/libraries/avatars/src/Recording.cpp @@ -250,31 +250,6 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) { maskIndex++; } - /* // Joint Rotations - if (i == 0) { - numJoints = frame.getJointRotations().size(); - stream << numJoints; - mask.resize(mask.size() + numJoints); - } - for (quint32 j = 0; j < numJoints; ++j) { - if (i == 0 || - frame._jointRotations[j] != previousFrame._jointRotations[j]) { - writeQuat(stream, frame._jointRotations[j]); - mask.setBit(maskIndex); - } - maskIndex++; - } - - // Joint Translations - for (quint32 j = 0; j < numJoints; ++j) { - if (i == 0 || - frame._jointTranslations[j] != previousFrame._jointTranslations[j]) { - writeVec3(stream, frame._jointTranslations[j]); - mask.setBit(maskIndex); - } - maskIndex++; - } */ - // Translation if (i == 0) { mask.resize(mask.size() + 1); @@ -438,11 +413,7 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString file.close(); } - if (filename.endsWith(".rec") || filename.endsWith(".REC")) { - qCDebug(avatars) << "Old .rec format"; - readRecordingFromRecFile(recording, filename, byteArray); - return recording; - } else if (!filename.endsWith(".hfr") && !filename.endsWith(".HFR")) { + if (!filename.endsWith(".hfr") && !filename.endsWith(".HFR")) { qCDebug(avatars) << "File extension not recognized"; } @@ -604,23 +575,6 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString } } - /* - frame._jointRotations.resize(numJoints); - for (quint32 j = 0; j < numJoints; ++j) { - if (!mask[maskIndex++] || !readQuat(stream, frame._jointRotations[j])) { - frame._jointRotations[j] = previousFrame._jointRotations[j]; - } - } - - // Joint Translations - /*frame._jointTranslations.resize(numJoints); - for (quint32 j = 0; j < numJoints; ++j) { - if (!mask[maskIndex++] || !readVec3(stream, frame._jointTranslations[j])) { - frame._jointTranslations[j] = previousFrame._jointTranslations[j]; - } - } - */ - if (!mask[maskIndex++] || !readVec3(stream, frame._translation)) { frame._translation = previousFrame._translation; } @@ -705,167 +659,3 @@ RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString return recording; } - -RecordingPointer readRecordingFromRecFile(RecordingPointer recording, const QString& filename, const QByteArray& byteArray) { - QElapsedTimer timer; - timer.start(); - - if (!recording) { - recording = QSharedPointer::create(); - } - - QDataStream fileStream(byteArray); - - fileStream >> recording->_timestamps; - RecordingFrame baseFrame; - - // Blendshape coefficients - fileStream >> baseFrame._blendshapeCoefficients; - - // Joint Rotations - int jointRotationSize; - fileStream >> jointRotationSize; - baseFrame._jointRotations.resize(jointRotationSize); - for (int i = 0; i < jointRotationSize; ++i) { - fileStream >> baseFrame._jointRotations[i].x >> baseFrame._jointRotations[i].y >> baseFrame._jointRotations[i].z >> baseFrame._jointRotations[i].w; - } - - // TODO -- handle translations - - fileStream >> baseFrame._translation.x >> baseFrame._translation.y >> baseFrame._translation.z; - fileStream >> baseFrame._rotation.x >> baseFrame._rotation.y >> baseFrame._rotation.z >> baseFrame._rotation.w; - fileStream >> baseFrame._scale; - fileStream >> baseFrame._headRotation.x >> baseFrame._headRotation.y >> baseFrame._headRotation.z >> baseFrame._headRotation.w; - fileStream >> baseFrame._leanSideways; - fileStream >> baseFrame._leanForward; - - - // Fake context - RecordingContext& context = recording->getContext(); - context.globalTimestamp = usecTimestampNow(); - context.domain = DependencyManager::get()->getDomainHandler().getHostname(); - context.position = glm::vec3(144.5f, 3.3f, 181.3f); - context.orientation = glm::angleAxis(glm::radians(-92.5f), glm::vec3(0, 1, 0));; - context.scale = baseFrame._scale; - context.headModel = "http://public.highfidelity.io/models/heads/Emily_v4.fst"; - context.skeletonModel = "http://public.highfidelity.io/models/skeletons/EmilyCutMesh_A.fst"; - context.displayName = "Leslie"; - context.attachments.clear(); - AttachmentData data; - data.modelURL = "http://public.highfidelity.io/models/attachments/fbx.fst"; - data.jointName = "RightHand" ; - data.translation = glm::vec3(0.04f, 0.07f, 0.0f); - data.rotation = glm::angleAxis(glm::radians(102.0f), glm::vec3(0, 1, 0)); - data.scale = 0.20f; - context.attachments << data; - - context.orientationInv = glm::inverse(context.orientation); - - baseFrame._translation = glm::vec3(); - baseFrame._rotation = glm::quat(); - baseFrame._scale = 1.0f; - - recording->_frames << baseFrame; - - for (int i = 1; i < recording->_timestamps.size(); ++i) { - QBitArray mask; - QByteArray buffer; - QDataStream stream(&buffer, QIODevice::ReadOnly); - RecordingFrame frame; - RecordingFrame& previousFrame = recording->_frames.last(); - - fileStream >> mask; - fileStream >> buffer; - int maskIndex = 0; - - // Blendshape Coefficients - frame._blendshapeCoefficients.resize(baseFrame._blendshapeCoefficients.size()); - for (int i = 0; i < baseFrame._blendshapeCoefficients.size(); ++i) { - if (mask[maskIndex++]) { - stream >> frame._blendshapeCoefficients[i]; - } else { - frame._blendshapeCoefficients[i] = previousFrame._blendshapeCoefficients[i]; - } - } - - // Joint Rotations - frame._jointRotations.resize(baseFrame._jointRotations.size()); - for (int i = 0; i < baseFrame._jointRotations.size(); ++i) { - if (mask[maskIndex++]) { - stream >> frame._jointRotations[i].x >> frame._jointRotations[i].y >> frame._jointRotations[i].z >> frame._jointRotations[i].w; - } else { - frame._jointRotations[i] = previousFrame._jointRotations[i]; - } - } - - // TODO -- handle translations - - if (mask[maskIndex++]) { - stream >> frame._translation.x >> frame._translation.y >> frame._translation.z; - frame._translation = context.orientationInv * frame._translation; - } else { - frame._translation = previousFrame._translation; - } - - if (mask[maskIndex++]) { - stream >> frame._rotation.x >> frame._rotation.y >> frame._rotation.z >> frame._rotation.w; - } else { - frame._rotation = previousFrame._rotation; - } - - if (mask[maskIndex++]) { - stream >> frame._scale; - } else { - frame._scale = previousFrame._scale; - } - - if (mask[maskIndex++]) { - stream >> frame._headRotation.x >> frame._headRotation.y >> frame._headRotation.z >> frame._headRotation.w; - } else { - frame._headRotation = previousFrame._headRotation; - } - - if (mask[maskIndex++]) { - stream >> frame._leanSideways; - } else { - frame._leanSideways = previousFrame._leanSideways; - } - - if (mask[maskIndex++]) { - stream >> frame._leanForward; - } else { - frame._leanForward = previousFrame._leanForward; - } - - recording->_frames << frame; - } - - QByteArray audioArray; - fileStream >> audioArray; - - // Cut down audio if necessary - int SAMPLE_SIZE = 2; // 16 bits - int MSEC_PER_SEC = 1000; - int audioLength = recording->getLength() * SAMPLE_SIZE * (AudioConstants::SAMPLE_RATE / MSEC_PER_SEC); - audioArray.chop(audioArray.size() - audioLength); - - recording->addAudioPacket(audioArray); - - qCDebug(avatars) << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms."; - - // Set new filename - QString newFilename = filename; - if (newFilename.startsWith("http") || newFilename.startsWith("https") || newFilename.startsWith("ftp")) { - newFilename = QUrl(newFilename).fileName(); - } - if (newFilename.endsWith(".rec") || newFilename.endsWith(".REC")) { - newFilename.chop(qstrlen(".rec")); - } - newFilename.append(".hfr"); - newFilename = QFileInfo(newFilename).absoluteFilePath(); - - // Set recording to new format - writeRecordingToFile(recording, newFilename); - qCDebug(avatars) << "Recording has been successfully converted at" << newFilename; - return recording; -} diff --git a/libraries/avatars/src/Recording.h b/libraries/avatars/src/Recording.h index 83d3642fdd..7657a12b46 100644 --- a/libraries/avatars/src/Recording.h +++ b/libraries/avatars/src/Recording.h @@ -84,8 +84,6 @@ class RecordingFrame { public: QVector getBlendshapeCoefficients() const { return _blendshapeCoefficients; } QVector getJointArray() const { return _jointArray; } - QVector getJointRotations() const { return _jointRotations; } - QVector getJointTranslations() const { return _jointTranslations; } glm::vec3 getTranslation() const { return _translation; } glm::quat getRotation() const { return _rotation; } float getScale() const { return _scale; } @@ -97,8 +95,6 @@ public: protected: void setBlendshapeCoefficients(QVector blendshapeCoefficients); void setJointArray(const QVector& jointArray) { _jointArray = jointArray; } - void setJointRotations(QVector jointRotations) { _jointRotations = jointRotations; } - void setJointTranslations(QVector jointTranslations) { _jointTranslations = jointTranslations; } void setTranslation(const glm::vec3& translation) { _translation = translation; } void setRotation(const glm::quat& rotation) { _rotation = rotation; } void setScale(float scale) { _scale = scale; } @@ -109,8 +105,6 @@ protected: private: QVector _blendshapeCoefficients; - QVector _jointRotations; - QVector _jointTranslations; QVector _jointArray; glm::vec3 _translation; @@ -130,6 +124,5 @@ private: void writeRecordingToFile(RecordingPointer recording, const QString& filename); RecordingPointer readRecordingFromFile(RecordingPointer recording, const QString& filename); -RecordingPointer readRecordingFromRecFile(RecordingPointer recording, const QString& filename, const QByteArray& byteArray); #endif // hifi_Recording_h From 06a87012ad63567d5d1c6b07138d10cad682735a Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 9 Nov 2015 23:38:51 -0800 Subject: [PATCH 22/42] Removing the setJointTranslations which is not helping... --- libraries/avatars/src/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/avatars/src/Player.cpp b/libraries/avatars/src/Player.cpp index 238753a217..47fc1390d9 100644 --- a/libraries/avatars/src/Player.cpp +++ b/libraries/avatars/src/Player.cpp @@ -277,7 +277,7 @@ void Player::play() { // _avatar->setRawJointData(jointArray); // FIXME: Enable once the setRawJointData is fixed _avatar->setJointRotations(jointRotations); // FIXME: remove once the setRawJointData is fixed - _avatar->setJointTranslations(jointTranslations); // FIXME: remove once the setRawJointData is fixed + // _avatar->setJointTranslations(jointTranslations); // FIXME: remove once the setRawJointData is fixed HeadData* head = const_cast(_avatar->getHeadData()); if (head) { From 0ea901fd721081dcfcd969bdd928da007666b3f6 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 10 Nov 2015 08:34:58 -0800 Subject: [PATCH 23/42] fix various warnings --- .../src/RenderableParticleEffectEntityItem.cpp | 1 - libraries/recording/src/recording/Deck.cpp | 5 ++++- libraries/recording/src/recording/Frame.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index 6f3b40eb1e..41cf3b9bbf 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -218,7 +218,6 @@ void RenderableParticleEffectEntityItem::updateRenderItem() { _vertices.clear(); // build vertices from particle positions and radiuses - glm::vec3 frustumPosition = frustum->getPosition(); glm::vec3 dir = frustum->getDirection(); for (auto&& particle : particleDetails) { glm::vec3 right = glm::normalize(glm::cross(glm::vec3(0.0f, 1.0f, 0.0f), dir)); diff --git a/libraries/recording/src/recording/Deck.cpp b/libraries/recording/src/recording/Deck.cpp index a80fc43204..f0db37078b 100644 --- a/libraries/recording/src/recording/Deck.cpp +++ b/libraries/recording/src/recording/Deck.cpp @@ -6,4 +6,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "Deck.h" + +// FIXME -- DO NOT include headers in empty CPP files, it produces warnings. Once we define new symbols +// and some actual code here, we can uncomment this include. +//#include "Deck.h" diff --git a/libraries/recording/src/recording/Frame.cpp b/libraries/recording/src/recording/Frame.cpp index 211f192c0a..aac8a4d9c3 100644 --- a/libraries/recording/src/recording/Frame.cpp +++ b/libraries/recording/src/recording/Frame.cpp @@ -80,6 +80,7 @@ FrameType Frame::registerFrameType(const QString& frameTypeName) { std::call_once(once, [&] { auto headerType = frameTypes.registerValue("com.highfidelity.recording.Header"); Q_ASSERT(headerType == Frame::TYPE_HEADER); + Q_UNUSED(headerType); // FIXME - build system on unix still not upgraded to Qt 5.5.1 so Q_ASSERT still produces warnings }); return frameTypes.registerValue(frameTypeName); } From 4a0a481ac6c654b205e4b7d43e6586ddc5fdf66b Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 10 Nov 2015 08:44:51 -0800 Subject: [PATCH 24/42] more fixes --- tests/recording/src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/recording/src/main.cpp b/tests/recording/src/main.cpp index 96c9a7f1a7..f4049b04b7 100644 --- a/tests/recording/src/main.cpp +++ b/tests/recording/src/main.cpp @@ -94,6 +94,7 @@ void testClipOrdering() { for (auto writeFrame = writeClip->nextFrame(); writeFrame; writeFrame = writeClip->nextFrame()) { QVERIFY(writeClip->position() >= lastFrameTimeOffset); } + Q_UNUSED(lastFrameTimeOffset); // FIXME - Unix build not yet upgraded to Qt 5.5.1 we can remove this once it is } #ifdef Q_OS_WIN32 From 53ca4c857d8d10752b9b0c6f82b55bd8ce01bcfb Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 08:52:37 -0800 Subject: [PATCH 25/42] Fix relative include path in entityCameraTool.js --- examples/libraries/entityCameraTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index 88e01b29fe..e3e86cedb3 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -9,7 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -Script.include("libraries/overlayUtils.js"); +Script.include("overlayUtils.js"); var MOUSE_SENSITIVITY = 0.9; var SCROLL_SENSITIVITY = 0.05; From 2cf2257783198ab14435347ca098871396258268 Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 10 Nov 2015 09:20:43 -0800 Subject: [PATCH 26/42] Fix warning --- libraries/avatars/src/Recording.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/avatars/src/Recording.cpp b/libraries/avatars/src/Recording.cpp index dd9c722e26..fa343630ed 100644 --- a/libraries/avatars/src/Recording.cpp +++ b/libraries/avatars/src/Recording.cpp @@ -236,7 +236,7 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) { // 2 fields per joints mask.resize(mask.size() + numJoints * 2); } - for (int j = 0; j < numJoints; j++) { + for (quint32 j = 0; j < numJoints; j++) { const auto& joint = jointArray[j]; if (joint.rotationSet) { writeQuat(stream, joint.rotation); From f5308530e680641260250b7fb55d2b475d36dec2 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 10 Nov 2015 09:35:35 -0800 Subject: [PATCH 27/42] Removed commented out line --- examples/helicopter/helicopter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/helicopter/helicopter.js b/examples/helicopter/helicopter.js index c1ad0f9d30..7073722e1e 100644 --- a/examples/helicopter/helicopter.js +++ b/examples/helicopter/helicopter.js @@ -51,7 +51,6 @@ var helicopter = Entities.addEntity({ y: 3.14, z: 9.92 }, - // rotation: Quat.fromPitchYawRollDegrees(0, -90, 0), position: spawnPosition, }); From b802da4fef56d06638b863843b3519f1a1865b89 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 09:37:36 -0800 Subject: [PATCH 28/42] Fix include in satellite.js --- examples/example/games/satellite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example/games/satellite.js b/examples/example/games/satellite.js index db65198b87..9ae0105917 100644 --- a/examples/example/games/satellite.js +++ b/examples/example/games/satellite.js @@ -15,7 +15,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -Script.include('../utilities/tools/vector.js'); +Script.include('../../utilities/tools/vector.js'); var URL = "https://s3.amazonaws.com/hifi-public/marketplace/hificontent/Scripts/planets/"; From 37d9d98594681c92a22c5d7b1fc6d0d224a98244 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 09:37:53 -0800 Subject: [PATCH 29/42] Fix breakdance include paths --- .../libraries/omniTool/modules/breakdanceOmniToolModule.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/libraries/omniTool/modules/breakdanceOmniToolModule.js b/examples/libraries/omniTool/modules/breakdanceOmniToolModule.js index 36ee6b1fee..3764c5e381 100644 --- a/examples/libraries/omniTool/modules/breakdanceOmniToolModule.js +++ b/examples/libraries/omniTool/modules/breakdanceOmniToolModule.js @@ -11,7 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -Script.include("../toys/breakdanceCore.js"); +Script.include("../../../breakdanceCore.js"); OmniToolModules.Breakdance = function() { print("OmniToolModules.Breakdance..."); @@ -32,4 +32,4 @@ OmniToolModules.Breakdance.prototype.onUpdate = function(deltaTime) { breakdanceEnd(); } -OmniToolModuleType = "Breakdance"; \ No newline at end of file +OmniToolModuleType = "Breakdance"; From 29fd352169427959c315323f43fe295ac5ea62f6 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 09:38:21 -0800 Subject: [PATCH 30/42] Fix omniTool test module include path --- examples/libraries/omniTool/modules/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libraries/omniTool/modules/test.js b/examples/libraries/omniTool/modules/test.js index 9f7191b2d0..83472ee0f1 100644 --- a/examples/libraries/omniTool/modules/test.js +++ b/examples/libraries/omniTool/modules/test.js @@ -1,5 +1,5 @@ -Script.include("avatarRelativeOverlays.js"); +Script.include("../../avatarRelativeOverlays.js"); OmniToolModules.Test = function(omniTool, activeEntityId) { this.omniTool = omniTool; From 2ad4c5b9e22118843b100fcfaed24b78f09ea6e9 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 09:38:40 -0800 Subject: [PATCH 31/42] Fix walkApi include paths --- examples/libraries/walkApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libraries/walkApi.js b/examples/libraries/walkApi.js index 8935380150..3a51491cac 100644 --- a/examples/libraries/walkApi.js +++ b/examples/libraries/walkApi.js @@ -14,7 +14,7 @@ // // included here to ensure walkApi.js can be used as an API, separate from walk.js -Script.include("./libraries/walkConstants.js"); +Script.include("walkConstants.js"); Avatar = function() { // if Hydras are connected, the only way to enable use is to never set any arm joint rotation From 6577c7a13c792632e8f9b558033cde8cbf8acb9c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 09:38:52 -0800 Subject: [PATCH 32/42] Fix magBalls include paths --- examples/magBalls.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/magBalls.js b/examples/magBalls.js index c9b45164ab..465e5f8e57 100644 --- a/examples/magBalls.js +++ b/examples/magBalls.js @@ -7,11 +7,11 @@ // // FIXME Script paths have to be relative to the caller, in this case libraries/OmniTool.js -Script.include("../magBalls/constants.js"); -Script.include("../magBalls/graph.js"); -Script.include("../magBalls/edgeSpring.js"); -Script.include("../magBalls/magBalls.js"); -Script.include("avatarRelativeOverlays.js"); +Script.include("magBalls/constants.js"); +Script.include("magBalls/graph.js"); +Script.include("magBalls/edgeSpring.js"); +Script.include("magBalls/magBalls.js"); +Script.include("libraries/avatarRelativeOverlays.js"); OmniToolModuleType = "MagBallsController" From e7e6c63c64b8c20520331cff2f2443874c5a6063 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:36:53 -0800 Subject: [PATCH 33/42] Fix edit.js resolvePath calls --- examples/libraries/entityList.js | 4 +++- examples/libraries/gridTool.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/libraries/entityList.js b/examples/libraries/entityList.js index bb84ce27b4..1aa08fbe2d 100644 --- a/examples/libraries/entityList.js +++ b/examples/libraries/entityList.js @@ -1,7 +1,9 @@ +var ENTITY_LIST_HTML_URL = Script.resolvePath('../html/entityList.html'); + EntityListTool = function(opts) { var that = {}; - var url = Script.resolvePath('html/entityList.html'); + var url = ENTITY_LIST_HTML_URL; var webView = new WebWindow('Entities', url, 200, 280, true); var searchRadius = 100; diff --git a/examples/libraries/gridTool.js b/examples/libraries/gridTool.js index ed4e999be8..35d9858ace 100644 --- a/examples/libraries/gridTool.js +++ b/examples/libraries/gridTool.js @@ -1,3 +1,5 @@ +var GRID_CONTROLS_HTML_URL = Script.resolvePath('../html/gridControls.html'); + Grid = function(opts) { var that = {}; @@ -228,7 +230,7 @@ GridTool = function(opts) { var verticalGrid = opts.verticalGrid; var listeners = []; - var url = Script.resolvePath('html/gridControls.html'); + var url = GRID_CONTROLS_HTML_URL; var webView = new WebWindow('Grid', url, 200, 280, true); horizontalGrid.addListener(function(data) { From 2a349620eef3c094efbbd383e261209a55a11ebb Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:37:59 -0800 Subject: [PATCH 34/42] Fix walkSettings.js resolvePath calls --- examples/libraries/walkSettings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/libraries/walkSettings.js b/examples/libraries/walkSettings.js index 3e5ac53572..0378f305b5 100644 --- a/examples/libraries/walkSettings.js +++ b/examples/libraries/walkSettings.js @@ -13,6 +13,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +var WALK_SETTINGS_HTML_URL = Script.resolvePath('../html/walkSettings.html'); + WalkSettings = function() { var _visible = false; var _innerWidth = Window.innerWidth; @@ -69,7 +71,7 @@ WalkSettings = function() { // web window const PANEL_WIDTH = 200; const PANEL_HEIGHT = 180; - var _url = Script.resolvePath('html/walkSettings.html'); + var _url = WALK_SETTINGS_HTML_URL; var _webWindow = new WebWindow('Walk Settings', _url, PANEL_WIDTH, PANEL_HEIGHT, false); _webWindow.setVisible(false); _webWindow.eventBridge.webEventReceived.connect(function(data) { From 90a1fbe04eecadbf5e7f0db5c19e645ffb8ab73d Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:38:16 -0800 Subject: [PATCH 35/42] Fix magBalls.js resolvePath calls --- examples/magBalls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/magBalls.js b/examples/magBalls.js index 465e5f8e57..bda6ccd9c3 100644 --- a/examples/magBalls.js +++ b/examples/magBalls.js @@ -34,7 +34,7 @@ MODE_INFO[BALL_EDIT_MODE_ADD] = { }, colors: [ COLORS.GREEN, COLORS.BLUE ], // FIXME use an http path or find a way to get the relative path to the file - url: Script.resolvePath('../html/magBalls/addMode.html'), + url: Script.resolvePath('html/magBalls/addMode.html'), }; MODE_INFO[BALL_EDIT_MODE_DELETE] = { @@ -45,7 +45,7 @@ MODE_INFO[BALL_EDIT_MODE_DELETE] = { }, colors: [ COLORS.RED, COLORS.BLUE ], // FIXME use an http path or find a way to get the relative path to the file - url: Script.resolvePath('../html/magBalls/deleteMode.html'), + url: Script.resolvePath('html/magBalls/deleteMode.html'), }; var UI_POSITION_MODE_LABEL = Vec3.multiply(0.5, From a6bc1a2b5b75d0b7d2abcc6beb73ec47e20045bc Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:38:36 -0800 Subject: [PATCH 36/42] Fix closePaint.js Script.include --- examples/painting/closePaint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/painting/closePaint.js b/examples/painting/closePaint.js index d9f70aab3c..563ed1dafb 100644 --- a/examples/painting/closePaint.js +++ b/examples/painting/closePaint.js @@ -11,7 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -Script.include("libraries/utils.js"); +Script.include("../libraries/utils.js"); var RIGHT_HAND = 1; From a264ed479547e12b9bfb08d7ba935df08eb1cc51 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:38:57 -0800 Subject: [PATCH 37/42] Remove old includes in bubblewand --- examples/toybox/bubblewand/createWand.js | 1 - examples/toybox/bubblewand/wand.js | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/toybox/bubblewand/createWand.js b/examples/toybox/bubblewand/createWand.js index d62c2064cf..4f4bc39e2c 100644 --- a/examples/toybox/bubblewand/createWand.js +++ b/examples/toybox/bubblewand/createWand.js @@ -10,7 +10,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html /*global MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt */ -Script.include("../../utilities.js"); Script.include("../../libraries/utils.js"); var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx'; diff --git a/examples/toybox/bubblewand/wand.js b/examples/toybox/bubblewand/wand.js index c8ba51f51d..4bdc789612 100644 --- a/examples/toybox/bubblewand/wand.js +++ b/examples/toybox/bubblewand/wand.js @@ -14,7 +14,6 @@ (function () { - Script.include("../../utilities.js"); Script.include("../../libraries/utils.js"); var BUBBLE_MODEL = "http://hifi-public.s3.amazonaws.com/models/bubblewand/bubble.fbx"; From 5f084730d928605929e4d939c73f65bde2dacc14 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:39:12 -0800 Subject: [PATCH 38/42] Remove old includes in doll.js --- examples/toybox/doll/doll.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/toybox/doll/doll.js b/examples/toybox/doll/doll.js index 8f8a8cd840..577f86cae2 100644 --- a/examples/toybox/doll/doll.js +++ b/examples/toybox/doll/doll.js @@ -13,7 +13,6 @@ /*global 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() { - Script.include("../../utilities.js"); Script.include("../../libraries/utils.js"); var _this; // this is the "constructor" for the entity as a JS object we don't do much here From 031a93cb0ea774f7aab30157a3c462c04e191a97 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:39:31 -0800 Subject: [PATCH 39/42] Fix utils include in createPingPongGun.js --- examples/toybox/ping_pong_gun/createPingPongGun.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/toybox/ping_pong_gun/createPingPongGun.js b/examples/toybox/ping_pong_gun/createPingPongGun.js index 9639f75320..705671e784 100644 --- a/examples/toybox/ping_pong_gun/createPingPongGun.js +++ b/examples/toybox/ping_pong_gun/createPingPongGun.js @@ -9,7 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // /*global MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt */ -Script.include("../../utilities.js"); +Script.include("../../libraries/utils.js"); var scriptURL = Script.resolvePath('pingPongGun.js'); From 08c27599472978cce6310e9ea4275efc94f1d203 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 10 Nov 2015 11:39:50 -0800 Subject: [PATCH 40/42] Remove unused include in createTargets.js --- examples/toybox/ping_pong_gun/createTargets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/toybox/ping_pong_gun/createTargets.js b/examples/toybox/ping_pong_gun/createTargets.js index fb286b1928..fde0d6f54a 100644 --- a/examples/toybox/ping_pong_gun/createTargets.js +++ b/examples/toybox/ping_pong_gun/createTargets.js @@ -10,7 +10,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // /*global MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt */ -Script.include("../../utilities.js"); + Script.include("../../libraries/utils.js"); var scriptURL = Script.resolvePath('wallTarget.js'); From d3d5d3a19e4970707e5c552585aa336c638beece Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 10 Nov 2015 12:02:20 -0800 Subject: [PATCH 41/42] Removing useless code --- interface/src/avatar/Avatar.cpp | 11 ----------- interface/src/avatar/Avatar.h | 1 - interface/src/avatar/MyAvatar.cpp | 8 -------- interface/src/avatar/MyAvatar.h | 1 - libraries/avatars/src/AvatarData.cpp | 15 --------------- libraries/avatars/src/AvatarData.h | 1 - libraries/avatars/src/Recording.cpp | 2 +- 7 files changed, 1 insertion(+), 38 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index a5ae8cddda..b979334383 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -888,17 +888,6 @@ glm::quat Avatar::getJointRotation(int index) const { return rotation; } -QVector Avatar::getJointTranslations() const { - if (QThread::currentThread() != thread()) { - return AvatarData::getJointTranslations(); - } - QVector jointTranslations(_skeletonModel.getJointStateCount()); - for (int i = 0; i < _skeletonModel.getJointStateCount(); ++i) { - _skeletonModel.getJointTranslation(i, jointTranslations[i]); - } - return jointTranslations; -} - glm::vec3 Avatar::getJointTranslation(int index) const { if (QThread::currentThread() != thread()) { return AvatarData::getJointTranslation(index); diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index cb7c533db6..44b5d91015 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -103,7 +103,6 @@ public: virtual QVector getJointRotations() const; virtual glm::quat getJointRotation(int index) const; - virtual QVector getJointTranslations() const; virtual glm::vec3 getJointTranslation(int index) const; virtual int getJointIndex(const QString& name) const; virtual QStringList getJointNames() const; diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 8595fa850e..6f60ad179c 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1132,14 +1132,6 @@ void MyAvatar::setJointRotations(QVector jointRotations) { } } -void MyAvatar::setJointTranslations(QVector jointTranslations) { - int numStates = glm::min(_skeletonModel.getJointStateCount(), jointTranslations.size()); - for (int i = 0; i < numStates; ++i) { - // HACK: ATM only Recorder calls setJointTranslations() so we hardcode its priority here - _skeletonModel.setJointTranslation(i, true, jointTranslations[i], RECORDER_PRIORITY); - } -} - void MyAvatar::setJointData(int index, const glm::quat& rotation, const glm::vec3& translation) { if (QThread::currentThread() != thread()) { QMetaObject::invokeMethod(this, "setJointData", Q_ARG(int, index), Q_ARG(const glm::quat&, rotation), diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index d6f51636f3..da836b7f15 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -192,7 +192,6 @@ public: void clearLookAtTargetAvatar(); virtual void setJointRotations(QVector jointRotations) override; - virtual void setJointTranslations(QVector jointTranslations) override; virtual void setJointData(int index, const glm::quat& rotation, const glm::vec3& translation) override; virtual void setJointRotation(int index, const glm::quat& rotation) override; virtual void setJointTranslation(int index, const glm::vec3& translation) override; diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index a13c01901e..a698c6f374 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -1146,21 +1146,6 @@ void AvatarData::setJointRotations(QVector jointRotations) { } } -QVector AvatarData::getJointTranslations() const { - if (QThread::currentThread() != thread()) { - QVector result; - QMetaObject::invokeMethod(const_cast(this), - "getJointTranslations", Qt::BlockingQueuedConnection, - Q_RETURN_ARG(QVector, result)); - return result; - } - QVector jointTranslations(_jointData.size()); - for (int i = 0; i < _jointData.size(); ++i) { - jointTranslations[i] = _jointData[i].translation; - } - return jointTranslations; -} - void AvatarData::setJointTranslations(QVector jointTranslations) { if (QThread::currentThread() != thread()) { QVector result; diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 766f31dda1..9079f15f53 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -261,7 +261,6 @@ public: Q_INVOKABLE virtual QVector getJointRotations() const; Q_INVOKABLE virtual void setJointRotations(QVector jointRotations); - Q_INVOKABLE virtual QVector getJointTranslations() const; Q_INVOKABLE virtual void setJointTranslations(QVector jointTranslations); Q_INVOKABLE virtual void clearJointsData(); diff --git a/libraries/avatars/src/Recording.cpp b/libraries/avatars/src/Recording.cpp index fa343630ed..26c5ab66dd 100644 --- a/libraries/avatars/src/Recording.cpp +++ b/libraries/avatars/src/Recording.cpp @@ -238,7 +238,7 @@ void writeRecordingToFile(RecordingPointer recording, const QString& filename) { } for (quint32 j = 0; j < numJoints; j++) { const auto& joint = jointArray[j]; - if (joint.rotationSet) { + if (true) { //(joint.rotationSet) { writeQuat(stream, joint.rotation); mask.setBit(maskIndex); } From bf0677a0cea84edcba4887ded70e4f3e1500b7d1 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Tue, 10 Nov 2015 13:42:15 -0800 Subject: [PATCH 42/42] Moved helicopter scripts into drylake folder --- examples/{helicopter => drylake}/explodeHelicopter.js | 0 examples/{helicopter => drylake}/helicopter.js | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename examples/{helicopter => drylake}/explodeHelicopter.js (100%) rename examples/{helicopter => drylake}/helicopter.js (100%) diff --git a/examples/helicopter/explodeHelicopter.js b/examples/drylake/explodeHelicopter.js similarity index 100% rename from examples/helicopter/explodeHelicopter.js rename to examples/drylake/explodeHelicopter.js diff --git a/examples/helicopter/helicopter.js b/examples/drylake/helicopter.js similarity index 100% rename from examples/helicopter/helicopter.js rename to examples/drylake/helicopter.js