From 51ad631c540fab1dd0c357d123eca8c3a8fe9a4f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 19 Feb 2015 13:14:46 -0800 Subject: [PATCH 1/5] dynamically grab animation URL as model URL from model --- examples/entityScripts/portal.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/entityScripts/portal.js b/examples/entityScripts/portal.js index e1f00b0afc..5dd7849c38 100644 --- a/examples/entityScripts/portal.js +++ b/examples/entityScripts/portal.js @@ -1,6 +1,7 @@ (function(){ var teleport; var portalDestination; + var animationURL; function playSound() { Audio.playSound(teleport, { volume: 0.40, localOnly: true }); @@ -11,6 +12,7 @@ var properties = Entities.getEntityProperties(entityID); portalDestination = properties.userData; + animationURL = properties.modelURL; print("The portal destination is " + portalDestination); } @@ -25,7 +27,7 @@ this.leaveEntity = function(entityID) { Entities.editEntity(entityID, { - animationURL: "http://hifi-public.s3.amazonaws.com/models/content/phonebooth.fbx", + animationURL: animationURL, animationSettings: '{ "frameIndex": 1, "running": false }' }); @@ -34,7 +36,7 @@ this.hoverEnterEntity = function(entityID) { Entities.editEntity(entityID, { - animationURL: "http://hifi-public.s3.amazonaws.com/models/content/phonebooth.fbx", + animationURL: animationURL, animationSettings: '{ "fps": 24, "firstFrame": 1, "lastFrame": 25, "frameIndex": 1, "running": true, "hold": true }' }); }; From 66d1eeb327296e4d633d1fa66ea1bb573cc79645 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 19 Feb 2015 21:11:51 -0800 Subject: [PATCH 2/5] Add textured models as balls --- examples/example/games/billiards.js | 30 +++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/examples/example/games/billiards.js b/examples/example/games/billiards.js index fbd41e8939..cb30cc631f 100644 --- a/examples/example/games/billiards.js +++ b/examples/example/games/billiards.js @@ -105,37 +105,27 @@ function makeTable(pos) { } function makeBalls(pos) { - var colors = [{ red: 255, green: 255, blue: 0}, // Yellow - { red: 0, green: 0, blue: 255}, // Blue - { red: 255, green: 0, blue: 0}, // Red - { red: 128, green: 0, blue: 128}, // Purple - { red: 255, green: 165, blue: 0}, // Orange - { red: 0, green: 255, blue: 0}, // Green - { red: 128, green: 0, blue: 0}, // Maroon - { red: 0, green: 0, blue: 0}, // Black - { red: 255, green: 255, blue: 224}, // Light Yellow - { red: 173, green: 216, blue: 230}, // Light Blue - { red: 205, green: 92, blue: 92}, // Indian Red - { red: 218, green: 112, blue: 214}, // Orchid - { red: 218, green: 165, blue: 32}, // GoldenRod - { red: 255, green: 99, blue: 71}, // Tomato - { red: 128, green: 128, blue: 128}]; // Gray - // Object balls + var whichBall = [ 1, 14, 15, 4, 8, 7, 12, 9, 3, 13, 10, 5, 6, 11, 2 ]; + var ballNumber = 0; var ballPosition = { x: pos.x + (LENGTH / 4.0) * SCALE, y: pos.y + HEIGHT / 2.0 + DROP_HEIGHT, z: pos.z }; for (var row = 1; row <= 5; row++) { ballPosition.z = pos.z - ((row - 1.0) / 2.0 * (BALL_SIZE + BALL_GAP) * SCALE); for (var spot = 0; spot < row; spot++) { balls.push(Entities.addEntity( - { type: "Sphere", + { type: "Model", + modelURL: "https://s3.amazonaws.com/hifi-public/models/props/Pool/ball_" + whichBall[ballNumber].toString() + ".fbx", position: ballPosition, dimensions: { x: BALL_SIZE * SCALE, y: BALL_SIZE * SCALE, z: BALL_SIZE * SCALE }, - color: colors[balls.length], + rotation: Quat.fromPitchYawRollDegrees((Math.random() - 0.5) * 20, (Math.random() - 0.5) * 20, (Math.random() - 0.5) * 20), + color: { red: 255, green: 255, blue: 255 }, gravity: { x: 0, y: GRAVITY, z: 0 }, ignoreCollisions: false, damping: 0.50, + shapeType: 2, collisionsWillMove: true })); ballPosition.z += (BALL_SIZE + BALL_GAP) * SCALE; + ballNumber++; } ballPosition.x += (BALL_GAP + Math.sqrt(3.0) / 2.0 * BALL_SIZE) * SCALE; } @@ -143,7 +133,8 @@ function makeBalls(pos) { // Cue Ball cuePosition = { x: pos.x - (LENGTH / 4.0) * SCALE, y: pos.y + HEIGHT / 2.0 + DROP_HEIGHT, z: pos.z }; cueBall = Entities.addEntity( - { type: "Sphere", + { type: "Model", + modelURL: "https://s3.amazonaws.com/hifi-public/models/props/Pool/cue_ball.fbx", position: cuePosition, dimensions: { x: BALL_SIZE * SCALE, y: BALL_SIZE * SCALE, z: BALL_SIZE * SCALE }, color: { red: 255, green: 255, blue: 255 }, @@ -152,6 +143,7 @@ function makeBalls(pos) { velocity: {x: 0, y: 0, z: 0 }, ignoreCollisions: false, damping: 0.50, + shapeType: 2, collisionsWillMove: true }); } From c665a3873d8a6359a43eae853e8d67aaee70bb61 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 20 Feb 2015 10:11:55 -0800 Subject: [PATCH 3/5] Fix entity camera tool from taking over in mirror mode --- 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 bbd28dd38a..da6a35b273 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -477,7 +477,7 @@ CameraManager = function() { // Last mode that was first or third person var lastAvatarCameraMode = "first person"; Camera.modeUpdated.connect(function(newMode) { - if (newMode == "first person" || newMode == "third person") { + if (newMode != "independent") { lastAvatarCameraMode = newMode; that.disable(true); } else { From 3a95614ca43647c0a788152e0d4a495cc66a557e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 20 Feb 2015 11:29:51 -0800 Subject: [PATCH 4/5] Update Faceshift readme.txt with Windows instructions --- interface/external/faceshift/readme.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/interface/external/faceshift/readme.txt b/interface/external/faceshift/readme.txt index 5a7333a9f6..4208711632 100644 --- a/interface/external/faceshift/readme.txt +++ b/interface/external/faceshift/readme.txt @@ -13,9 +13,14 @@ You may optionally choose to place this folder in a location outside the reposit If so our CMake find module expects you to set the ENV variable 'HIFI_LIB_DIR' to a directory containing a subfolder ‘faceshift’ that contains the lib and include folders. -1. Build a Faceshift static library from the fsbinarystream.cpp file. If you build a release version call it libfaceshift.a. The debug version should be called libfaceshiftd.a. Place this in the ‘lib’ folder in your Faceshift folder. +1. Build a Faceshift static library from the fsbinarystream.cpp file. + Windows: Win32 console application; no precompiled header or SDL checks; no ATL or MFC headers; Project Properties, Configuration Type = Static Library (.lib). -2. Copy the fsbinarystream.h header file from the Faceshift SDK into the ‘include’ folder in your Faceshift folder. +2. Copy the library files to the ‘lib’ folder in your Faceshift folder. + OSX: If you build a release version call it libfaceshift.a. The debug version should be called libfaceshiftd.a. + Windows: The release and debug versions should be called faceshift.lib and faceshiftd.lib, respectively. Copy them into a ‘Win32’ folder in your ‘lib’ folder. -3. Clear your build directory, run cmake and build, and you should be all set. +3. Copy the fsbinarystream.h header file from the Faceshift SDK into the ‘include’ folder in your Faceshift folder. + +4. Clear your build directory, run cmake and build, and you should be all set. From cf0b13f8690e0b07c722711f738f8da04d74ed3f Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 20 Feb 2015 14:22:59 -0800 Subject: [PATCH 5/5] Update notifications.js audio to be local-only --- examples/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/notifications.js b/examples/notifications.js index 287bfd0b36..f9d2ba83ed 100644 --- a/examples/notifications.js +++ b/examples/notifications.js @@ -84,7 +84,7 @@ var users = []; var ctrlIsPressed = false; var ready = true; -var randomSounds = new SoundArray({}, true); +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");