diff --git a/hifi-content/faye/ZBL_lexx01_door_door.fbx b/hifi-content/faye/ZBL_lexx01_door_door.fbx new file mode 100644 index 000000000..272b43e9a --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_door_door.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6df6642ea56c29884e54a81d9ad8900916867a4f1937012ba6be3bf38fd849fc +size 30112 diff --git a/hifi-content/faye/ZBL_lexx01_door_frame.fbx b/hifi-content/faye/ZBL_lexx01_door_frame.fbx new file mode 100644 index 000000000..bdce07e99 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_door_frame.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:542b08b359ae5acbf136d5ff11e5e9b9d987cce9a8df3103e0d5616da3786ac5 +size 22352 diff --git a/hifi-content/faye/ZBL_lexx01_floor.fbx b/hifi-content/faye/ZBL_lexx01_floor.fbx new file mode 100644 index 000000000..f253b35ea --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_floor.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b94717ec5c468fdb4802abbfff811cbf5f4818fa92e430192100e135fa29184d +size 25744 diff --git a/hifi-content/faye/ZBL_lexx01_roof.fbx b/hifi-content/faye/ZBL_lexx01_roof.fbx new file mode 100644 index 000000000..704ec4f72 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_roof.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:331f3d2dce105153734b5552565aa2f52e61fa17ce054557942a264ebbf3056a +size 32896 diff --git a/hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx b/hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx new file mode 100644 index 000000000..c065fcb66 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d083dae8abe1ba37784cb5aa0df2ac8eaf7bd9657e6913641b0e80a5eeb7d8ea +size 38416 diff --git a/hifi-content/faye/ZBL_lexx01_wall_aperture.fbx b/hifi-content/faye/ZBL_lexx01_wall_aperture.fbx new file mode 100644 index 000000000..38ffbaf92 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_wall_aperture.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4433c9e31c24df1ee284cfbc699979ef0c210bdafcc32412a8025c3ad07b8603 +size 34080 diff --git a/hifi-content/faye/ZBL_lexx01_wall_corner.fbx b/hifi-content/faye/ZBL_lexx01_wall_corner.fbx new file mode 100644 index 000000000..ce2fb4fa9 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_wall_corner.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34091ad7e57e0cea4180dd1b3c3f85489ec81f1461e9cfbd0c06c51f70b5a451 +size 32832 diff --git a/hifi-content/faye/ZBL_lexx01_wall_portal.fbx b/hifi-content/faye/ZBL_lexx01_wall_portal.fbx new file mode 100644 index 000000000..7ad2aad89 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_wall_portal.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1aba141da07fe369f787d2cd4c6075d6d8e48b356702987f5a32b8689085d3de +size 33808 diff --git a/hifi-content/faye/ZBL_lexx01_wall_roof_triangle.fbx b/hifi-content/faye/ZBL_lexx01_wall_roof_triangle.fbx new file mode 100644 index 000000000..e0e6e14fb --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_wall_roof_triangle.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1a10ff699330a004b130dd900da043302d38c482b396bbf74d23db9396db330 +size 28176 diff --git a/hifi-content/faye/ZBL_lexx01_wall_straight.fbx b/hifi-content/faye/ZBL_lexx01_wall_straight.fbx new file mode 100644 index 000000000..4d69f5a59 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_wall_straight.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:704d7f8dacdc51d0bb7cc9c8538c7fd5ddfe8ed346911f351f02a49ecae13521 +size 28032 diff --git a/hifi-content/faye/ZBL_lexx01_window.fbx b/hifi-content/faye/ZBL_lexx01_window.fbx new file mode 100644 index 000000000..483931748 --- /dev/null +++ b/hifi-content/faye/ZBL_lexx01_window.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4139d47e492f26fa689ac8a3767d2205d52fab3bf12fb73a752f54d867538fd6 +size 28832 diff --git a/hifi-content/faye/avatarCounter.js b/hifi-content/faye/avatarCounter.js new file mode 100644 index 000000000..c0c49f924 --- /dev/null +++ b/hifi-content/faye/avatarCounter.js @@ -0,0 +1,26 @@ +// +// avatarCounter.js +// +// Usage: Attach this script as an entity server script to a Text Entity. The Text Entity will display +// the current avatar counts in the domain. +// +// Created by Faye Li on 3 Feb 2017. +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +(function() { + var INTERVAL_MS = 1000; // in ms, how often do we recount avatars + var intervalID = null; + this.preload = function(entityID) { + intervalID = Script.setInterval(function() { + var avatarCount = AvatarList.getAvatarIdentifiers().length; + Entities.editEntity(entityID, {text: avatarCount}); + }, INTERVAL_MS); + }; + this.unload = function() { + Script.clearInterval(intervalID); + }; +}); \ No newline at end of file diff --git a/hifi-content/faye/being-of-pink-jellyfish/beingOfPinkJellyfish.fst b/hifi-content/faye/being-of-pink-jellyfish/beingOfPinkJellyfish.fst new file mode 100644 index 000000000..b8474ad41 --- /dev/null +++ b/hifi-content/faye/being-of-pink-jellyfish/beingOfPinkJellyfish.fst @@ -0,0 +1,135 @@ +name = being_of_pink_jellyfish +type = body+head +scale = 1 +filename = being_of_pink_jellyfish.fbx +texdir = being_of_light/textures +joint = jointRoot = Hips +joint = jointLeftHand = LeftHand +joint = jointHead = HeadTop_End +joint = jointLean = Spine +joint = jointEyeLeft = LeftEye +joint = jointRightHand = RightHand +joint = jointNeck = Head +joint = jointEyeRight = RightEye +freeJoint = LeftArm +freeJoint = LeftForeArm +freeJoint = RightArm +freeJoint = RightForeArm +bs = MouthFrown_L = Frown_Left = 1 +bs = MouthLeft = Midmouth_Left = 1 +bs = BrowsU_R = BrowsUp_Right = 1 +bs = ChinUpperRaise = UpperLipUp_Right = 0.5 +bs = ChinUpperRaise = UpperLipUp_Left = 0.5 +bs = MouthSmile_R = Smile_Right = 1 +bs = MouthDimple_L = Smile_Left = 0.25 +bs = EyeBlink_L = Blink_Left = 1 +bs = BrowsD_L = BrowsDown_Left = 1 +bs = MouthFrown_R = Frown_Right = 1 +bs = MouthDimple_R = Smile_Right = 0.25 +bs = Sneer = Squint_Right = 0.5 +bs = Sneer = Squint_Left = 0.5 +bs = Sneer = NoseScrunch_Right = 0.75 +bs = Sneer = NoseScrunch_Left = 0.75 +bs = EyeSquint_L = Squint_Left = 1 +bs = EyeBlink_R = Blink_Right = 1 +bs = JawLeft = JawRotateY_Left = 0.5 +bs = BrowsD_R = BrowsDown_Right = 1 +bs = EyeSquint_R = Squint_Right = 1 +bs = Puff = CheekPuff_Right = 1 +bs = Puff = CheekPuff_Left = 1 +bs = LipsUpperClose = UpperLipIn = 1 +bs = JawOpen = MouthOpen = 0.69999999999999996 +bs = LipsUpperUp = UpperLipUp_Right = 0.69999999999999996 +bs = LipsUpperUp = UpperLipUp_Left = 0.69999999999999996 +bs = LipsLowerDown = LowerLipDown_Right = 0.69999999999999996 +bs = LipsLowerDown = LowerLipDown_Left = 0.69999999999999996 +bs = LipsLowerOpen = LowerLipOut = 1 +bs = EyeOpen_L = EyesWide_Left = 1 +bs = LipsPucker = MouthNarrow_Right = 1 +bs = LipsPucker = MouthNarrow_Left = 1 +bs = EyeOpen_R = EyesWide_Right = 1 +bs = JawRight = Jaw_Right = 1 +bs = MouthRight = Midmouth_Right = 1 +bs = ChinLowerRaise = Jaw_Up = 1 +bs = LipsUpperOpen = UpperLipOut = 1 +bs = BrowsU_C = BrowsUp_Right = 1 +bs = BrowsU_C = BrowsUp_Left = 1 +bs = JawFwd = JawForeward = 1 +bs = BrowsU_L = BrowsUp_Left = 1 +bs = MouthSmile_L = Smile_Left = 1 +bs = LipsLowerClose = LowerLipIn = 1 +bs = LipsFunnel = TongueUp = 1 +bs = LipsFunnel = MouthWhistle_NarrowAdjust_Right = 0.5 +bs = LipsFunnel = MouthWhistle_NarrowAdjust_Left = 0.5 +bs = LipsFunnel = MouthNarrow_Right = 1 +bs = LipsFunnel = MouthNarrow_Left = 1 +bs = LipsFunnel = Jaw_Down = 0.35999999999999999 +bs = LipsFunnel = JawForeward = 0.39000000000000001 +jointIndex = LeftHandIndex1 = 50 +jointIndex = LeftHandIndex2 = 51 +jointIndex = LeftHandIndex3 = 52 +jointIndex = LeftHandIndex4 = 53 +jointIndex = Spine1 = 12 +jointIndex = Spine2 = 13 +jointIndex = RightHandThumb1 = 18 +jointIndex = RightHandThumb2 = 19 +jointIndex = RightHandThumb3 = 20 +jointIndex = RightHandThumb4 = 21 +jointIndex = LeftFoot = 8 +jointIndex = LeftForeArm = 40 +jointIndex = Neck = 62 +jointIndex = Head = 63 +jointIndex = Hips = 0 +jointIndex = RightHandPinky1 = 30 +jointIndex = RightHandPinky2 = 31 +jointIndex = RightHandPinky3 = 32 +jointIndex = RightHandPinky4 = 33 +jointIndex = RightLeg = 2 +jointIndex = RightForeArm = 16 +jointIndex = LeftHandRing1 = 46 +jointIndex = LeftHandRing2 = 47 +jointIndex = LeftHandRing3 = 48 +jointIndex = LeftHandRing4 = 49 +jointIndex = LeftHandThumb1 = 54 +jointIndex = LeftHandThumb2 = 55 +jointIndex = LeftHandThumb3 = 56 +jointIndex = LeftHandThumb4 = 57 +jointIndex = HeadTop_End = 66 +jointIndex = LeftUpLeg = 6 +jointIndex = LeftToeBase = 9 +jointIndex = LeftHandPinky1 = 42 +jointIndex = LeftHandPinky2 = 43 +jointIndex = LeftHandPinky3 = 44 +jointIndex = LeftHandPinky4 = 45 +jointIndex = LeftLeg = 7 +jointIndex = RightEye = 65 +jointIndex = RightHand = 17 +jointIndex = RightToeBase = 4 +jointIndex = RightUpLeg = 1 +jointIndex = RightArm = 15 +jointIndex = RightHandRing1 = 26 +jointIndex = RightHandRing2 = 27 +jointIndex = RightHandRing3 = 28 +jointIndex = RightHandRing4 = 29 +jointIndex = RightHandIndex1 = 22 +jointIndex = RightHandIndex2 = 23 +jointIndex = RightHandIndex3 = 24 +jointIndex = RightHandIndex4 = 25 +jointIndex = LeftToe_End = 10 +jointIndex = LeftHandMiddle1 = 58 +jointIndex = LeftHandMiddle2 = 59 +jointIndex = LeftHandMiddle3 = 60 +jointIndex = LeftShoulder = 38 +jointIndex = LeftHandMiddle4 = 61 +jointIndex = RightFoot = 3 +jointIndex = LeftHand = 41 +jointIndex = RightHandMiddle1 = 34 +jointIndex = RightHandMiddle2 = 35 +jointIndex = RightHandMiddle3 = 36 +jointIndex = RightShoulder = 14 +jointIndex = LeftEye = 64 +jointIndex = RightHandMiddle4 = 37 +jointIndex = Body = 67 +jointIndex = LeftArm = 39 +jointIndex = RightToe_End = 5 +jointIndex = Spine = 11 diff --git a/hifi-content/faye/being-of-pink-jellyfish/being_of_pink_jellyfish.fbx b/hifi-content/faye/being-of-pink-jellyfish/being_of_pink_jellyfish.fbx new file mode 100644 index 000000000..b63950c01 --- /dev/null +++ b/hifi-content/faye/being-of-pink-jellyfish/being_of_pink_jellyfish.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0920ac7eb535956ca204e35cccdcf7800b5069f8d127bfd3bf52f90d38936808 +size 10119952 diff --git a/hifi-content/faye/christmastree/greenButtonEntityScript.js b/hifi-content/faye/christmastree/greenButtonEntityScript.js new file mode 100644 index 000000000..9e2f86911 --- /dev/null +++ b/hifi-content/faye/christmastree/greenButtonEntityScript.js @@ -0,0 +1,47 @@ +// greenButtonEntityScript.js +// +// Created by Faye Li on November 3, 2016 +// +(function() { + print("green button v0.36"); + var _this; + var CLICK_SOUND_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/gameTable/woodenTapClick.wav"; + var myChannel = "Christmas-Tree-Channel"; + + function GreenButton() { + _this = this; + } + + GreenButton.prototype = { + entityID: null, + sound: null, + position: null, + preload: function(entityID) { + print('preload(' + entityID + ')'); + _this.entityID = entityID; + _this.sound = SoundCache.getSound(CLICK_SOUND_URL); + var props = Entities.getEntityProperties(_this.entityID); + _this.position = props.position; + }, + startNearTrigger: function(entityID) { + print('star near trigger'); + _this.click(); + }, + clickDownOnEntity: function(entityID, mouseEvent) { + print('click down on entity'); + _this.click(); + }, + click: function(){ + // plays click sound as audio feedback + var props = Entities.getEntityProperties(_this.entityID); + var options = { position: props.position }; + var injector = Audio.playSound(_this.sound,options); + // TODO: add visual feedback ie. animate a button click + + var message = "ok"; + Messages.sendMessage(myChannel, message); + } + }; + + return new GreenButton(); +}); diff --git a/hifi-content/faye/crow-flock/entityLocalFish.js b/hifi-content/faye/crow-flock/entityLocalFish.js new file mode 100644 index 000000000..9c2525e3f --- /dev/null +++ b/hifi-content/faye/crow-flock/entityLocalFish.js @@ -0,0 +1,174 @@ +// +// entityLocalFish.js +// examples +// +// Philip Rosedale +// Copyright 2016 High Fidelity, Inc. +// Fish smimming around in a space in front of you +// These fish are overlays, meaning they can only be seen by you. +// Attach this entity script to an object to create fish that stay within the +// dimensions of the object. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html + +(function(){ + + var NUM_FISH = 40; + var FISH_SCALE = 0.45; + var MAX_SIGHT_DISTANCE = 0.5; + var MIN_SEPARATION = 0.1; + var AVOIDANCE_FORCE = 0.05; + var COHESION_FORCE = 0.015; + var ALIGNMENT_FORCE = 0.015; + var SWIMMING_FORCE = 0.045; + var SWIMMING_SPEED = 0.8; + var VELOCITY_FOLLOW_RATE = 0.05; + var FISH_MODEL_URL = "https://hifi-content.s3.amazonaws.com/jimi/personal/props/crow_Anim3.fbx"; + var CROW_ANIMATION_URL = "https://hifi-content.s3.amazonaws.com/jimi/personal/props/crow_Anim3.fbx"; + + var fishLoaded = false; + var fish = []; + + var lowerCorner = { x: 0, y: 0, z: 0 }; + var upperCorner = { x: 0, y: 0, z: 0 }; + + var entityID; + + function update(deltaTime) { + + var averageVelocity = { x: 0, y: 0, z: 0 }; + var averagePosition = { x: 0, y: 0, z: 0 }; + + for (var i = 0; i < fish.length; i++) { + + // Update position by velocity + fish[i].position = Vec3.sum(fish[i].position, Vec3.multiply(deltaTime, fish[i].velocity)); + + averageVelocity = { x: 0, y: 0, z: 0 }; + averagePosition = { x: 0, y: 0, z: 0 }; + + var othersCounted = 0; + for (var j = 0; j < fish.length; j++) { + if (i != j) { + // Get only the properties we need, because that is faster + var separation = Vec3.distance(fish[i].position, fish[j].position); + if (separation < MAX_SIGHT_DISTANCE) { + averageVelocity = Vec3.sum(averageVelocity, fish[j].velocity); + averagePosition = Vec3.sum(averagePosition, fish[j].position); + othersCounted++; + } + if (separation < MIN_SEPARATION) { + // Separation: Push away if you are too close to someone else + var pushAway = Vec3.multiply(Vec3.normalize(Vec3.subtract(fish[i].position, fish[j].position)), AVOIDANCE_FORCE); + fish[i].velocity = Vec3.sum(fish[i].velocity, pushAway); + } + } + } + + if (othersCounted > 0) { + averageVelocity = Vec3.multiply(averageVelocity, 1.0 / othersCounted); + averagePosition = Vec3.multiply(averagePosition, 1.0 / othersCounted); + // Alignment: Follow group's direction and speed + fish[i].velocity = Vec3.mix(fish[i].velocity, Vec3.multiply(Vec3.normalize(averageVelocity), Vec3.length(fish[i].velocity)), ALIGNMENT_FORCE); + // Cohesion: Steer towards center of flock + var towardCenter = Vec3.subtract(averagePosition, fish[i].position); + fish[i].velocity = Vec3.mix(fish[i].velocity, Vec3.multiply(Vec3.normalize(towardCenter), Vec3.length(fish[i].velocity)), COHESION_FORCE); + } + + // Try to swim at a constant speed + fish[i].velocity = Vec3.mix(fish[i].velocity, Vec3.multiply(Vec3.normalize(fish[i].velocity), SWIMMING_SPEED), SWIMMING_FORCE); + + // Keep fish in their 'tank' + if (fish[i].position.x < lowerCorner.x) { + fish[i].position.x = lowerCorner.x; + fish[i].velocity.x *= -1.0; + } else if (fish[i].position.x > upperCorner.x) { + fish[i].position.x = upperCorner.x; + fish[i].velocity.x *= -1.0; + } + if (fish[i].position.y < lowerCorner.y) { + fish[i].position.y = lowerCorner.y; + fish[i].velocity.y *= -1.0; + } else if (fish[i].position.y > upperCorner.y) { + fish[i].position.y = upperCorner.y; + fish[i].velocity.y *= -1.0; + } + if (fish[i].position.z < lowerCorner.z) { + fish[i].position.z = lowerCorner.z; + fish[i].velocity.z *= -1.0; + } else if (fish[i].position.z > upperCorner.z) { + fish[i].position.z = upperCorner.z; + fish[i].velocity.z *= -1.0; + } + + // Orient in direction of velocity + var rotation = Quat.rotationBetween(Vec3.UNIT_NEG_Z, fish[i].velocity); + fish[i].rotation = Quat.slerp(fish[i].rotation, rotation, VELOCITY_FOLLOW_RATE); + + // Update the actual 3D overlay + Overlays.editOverlay(fish[i].overlayID, { position: fish[i].position, + velocity: fish[i].velocity, + rotation: fish[i].rotation }); + } + } + + function randomVector(scale) { + return { x: Math.random() * scale - scale / 2.0, y: Math.random() * scale - scale / 2.0, z: Math.random() * scale - scale / 2.0 }; + } + + function loadFish(entityID, howMany) { + var STARTING_FRACTION = 0.25; + var properties = Entities.getEntityProperties(entityID); + lowerCorner = { x: properties.position.x - properties.dimensions.x / 2, + y: properties.position.y - properties.dimensions.y / 2, + z: properties.position.z - properties.dimensions.z / 2 }; + upperCorner = { x: properties.position.x + properties.dimensions.x / 2, + y: properties.position.y + properties.dimensions.y / 2, + z: properties.position.z + properties.dimensions.z / 2 }; + + for (var i = 0; i < howMany; i++) { + var position = { + x: lowerCorner.x + (upperCorner.x - lowerCorner.x) / 2.0 + (Math.random() - 0.5) * (upperCorner.x - lowerCorner.x) * STARTING_FRACTION, + y: lowerCorner.y + (upperCorner.y - lowerCorner.y) / 2.0 + (Math.random() - 0.5) * (upperCorner.y - lowerCorner.y) * STARTING_FRACTION, + z: lowerCorner.z + (upperCorner.z - lowerCorner.x) / 2.0 + (Math.random() - 0.5) * (upperCorner.z - lowerCorner.z) * STARTING_FRACTION + }; + var rotation = { x: 0, y: 0, z: 0, w: 1 }; + fish.push({ + overlayID: Overlays.addOverlay("model", { + url: FISH_MODEL_URL, + animation: { + url: CROW_ANIMATION_URL, + fps: 30, + loop: true, + running: true, + startAutomatically: true + }, + position: position, + rotation: rotation, + scale: FISH_SCALE, + visible: true }), + position: position, + rotation: rotation, + velocity: randomVector(SWIMMING_SPEED) + }); + } + print("Fish loaded"); + } + + this.preload = function(entityID) { + print("Fish Preload v3"); + loadFish(entityID, NUM_FISH); + fishLoaded = true; + Script.update.connect(update); + + }; + + this.unload = function() { + Script.update.disconnect(update); + print("Fish Unload"); + for (var i = 0; i < fish.length; i++) { + Overlays.deleteOverlay(fish[i].overlayID); + } + }; +}) diff --git a/hifi-content/faye/earth.fbx b/hifi-content/faye/earth.fbx new file mode 100644 index 000000000..f5332aef7 --- /dev/null +++ b/hifi-content/faye/earth.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7db2bf46af26fa6ebc5674509bf7f42513306d78ebd29af69e56bcd3ed52b46a +size 659216 diff --git a/hifi-content/faye/flickeringLightFloyd.js b/hifi-content/faye/flickeringLightFloyd.js new file mode 100644 index 000000000..d70d45366 --- /dev/null +++ b/hifi-content/faye/flickeringLightFloyd.js @@ -0,0 +1,95 @@ +// +// flickeringLight.js +// examples +// +// Created by Brad Hefta-Gaub on 2015/09/29. +// Copyright 2015 High Fidelity, Inc. +// +// Creates an ephemeral flickering light that will randomly flicker as long as the script is running. +// After the script stops running, the light will eventually disappear (~10 seconds later). This script +// can run in the interface or in an assignment client and it will work equally well. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +function randFloat(low, high) { + return low + Math.random() * (high - low); +} + +var LIGHT_NAME = "flickering fire"; + +var LIGHT_POSITION = { + x: 1101.7900390625, + y: 460.2709045410156, + z: -78.48441314697266 +}; + +var LIGHT_COLOR = { + red: 194, + green: 50 , + blue: 194 +}; + +var ZERO_VEC = { + x: 0, + y: 0, + z: 0 +}; + +var totalTime = 0; +var lastUpdate = 0; +var UPDATE_INTERVAL = 1 / 30; // 30fps + +var MINIMUM_LIGHT_INTENSITY = 1; +var MAXIMUM_LIGHT_INTENSITY = 3; +var LIGHT_FALLOFF_RADIUS = 10; +var LIGHT_INTENSITY_RANDOMNESS = 0.1; +var EPHEMERAL_LIFETIME = 60; // ephemeral entities will live for 60 seconds after script stops running + +var LightMaker = { + light: null, + spawnLight: function() { + print('CREATING LIGHT') + var _this = this; + _this.light = Entities.addEntity({ + type: "Light", + name: LIGHT_NAME, + position: LIGHT_POSITION, + lifetime: EPHEMERAL_LIFETIME, + color: LIGHT_COLOR, + dimensions: { x: 21, y: 21, z: 21 }, + falloffRadius: 10 + }); + } +} + +var hasSpawned = false; + +function update(deltaTime) { + + if (!Entities.serversExist() || !Entities.canRez()) { + return; + } + + if (hasSpawned === false) { + hasSpawned = true; + LightMaker.spawnLight(); + } else { + totalTime += deltaTime; + + // We don't want to edit the entity EVERY update cycle, because that's just a lot + // of wasted bandwidth and extra effort on the server for very little visual gain + if (totalTime - lastUpdate > UPDATE_INTERVAL) { + var intensity = (MINIMUM_LIGHT_INTENSITY + (MAXIMUM_LIGHT_INTENSITY + (Math.sin(totalTime) * MAXIMUM_LIGHT_INTENSITY))); + intensity += randFloat(-LIGHT_INTENSITY_RANDOMNESS, LIGHT_INTENSITY_RANDOMNESS); + var properties = Entities.getEntityProperties(LightMaker.light, "age"); + var newLifetime = properties.age + EPHEMERAL_LIFETIME; + Entities.editEntity(LightMaker.light, { type: "Light", intensity: intensity, lifetime: newLifetime }); + lastUpdate = totalTime; + } + } +} + +Script.update.connect(update); diff --git a/hifi-content/faye/frontflip/frontFlip.fbx b/hifi-content/faye/frontflip/frontFlip.fbx new file mode 100644 index 000000000..07d09a5e4 --- /dev/null +++ b/hifi-content/faye/frontflip/frontFlip.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfdea5283bc12cfcf6f2768a151f1f3577aa3f65227503794d3c8a21449cc6cd +size 1688816 diff --git a/hifi-content/faye/fst/butterflyAvatar.fbx b/hifi-content/faye/fst/butterflyAvatar.fbx new file mode 100644 index 000000000..734dab357 --- /dev/null +++ b/hifi-content/faye/fst/butterflyAvatar.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be44cf52dceb3cc44e27229168af19cf57e730a948bd171c3f7dfbfd09bf8fbc +size 7439084 diff --git a/hifi-content/faye/fst/butterflyAvatar.fst b/hifi-content/faye/fst/butterflyAvatar.fst new file mode 100644 index 000000000..075ee9710 --- /dev/null +++ b/hifi-content/faye/fst/butterflyAvatar.fst @@ -0,0 +1,155 @@ +name = butterflyAvatar +type = body+head +scale = 1 +filename = butterflyAvatar.fbx +texdir = butterflyAvatar/textures +joint = jointLeftHand = LeftHand +joint = jointRightHand = RightHand +joint = jointHead = HeadTop_End +joint = jointRoot = Hips +joint = jointEyeLeft = LeftEye +joint = jointNeck = Neck +joint = jointEyeRight = RightEye +joint = jointLean = Spine +freeJoint = LeftArm +freeJoint = LeftForeArm +freeJoint = RightArm +freeJoint = RightForeArm +bs = ChinUpperRaise = UpperLipUp_Right = 0.5 +bs = ChinUpperRaise = UpperLipUp_Left = 0.5 +bs = Puff = CheekPuff_Right = 1 +bs = Puff = CheekPuff_Left = 1 +bs = Sneer = Squint_Right = 0.5 +bs = Sneer = Squint_Left = 0.5 +bs = Sneer = NoseScrunch_Right = 0.75 +bs = Sneer = NoseScrunch_Left = 0.75 +bs = EyeOpen_L = EyesWide_Left = 1 +bs = MouthDimple_R = Smile_Right = 0.25 +bs = EyeSquint_L = Squint_Left = 1 +bs = LipsUpperOpen = UpperLipOut = 1 +bs = LipsUpperClose = UpperLipIn = 1 +bs = BrowsU_R = BrowsUp_Right = 1 +bs = MouthLeft = Midmouth_Left = 1 +bs = EyeBlink_R = Blink_Right = 1 +bs = LipsLowerClose = LowerLipIn = 1 +bs = MouthDimple_L = Smile_Left = 0.25 +bs = MouthFrown_R = Frown_Right = 1 +bs = MouthSmile_R = Smile_Right = 1 +bs = EyeBlink_L = Blink_Left = 1 +bs = LipsPucker = MouthNarrow_Right = 1 +bs = LipsPucker = MouthNarrow_Left = 1 +bs = MouthFrown_L = Frown_Left = 1 +bs = EyeOpen_R = EyesWide_Right = 1 +bs = LipsUpperUp = UpperLipUp_Right = 0.69999999999999996 +bs = LipsUpperUp = UpperLipUp_Left = 0.69999999999999996 +bs = EyeSquint_R = Squint_Right = 1 +bs = JawFwd = JawForeward = 1 +bs = MouthSmile_L = Smile_Left = 1 +bs = BrowsU_C = BrowsUp_Right = 1 +bs = BrowsU_C = BrowsUp_Left = 1 +bs = ChinLowerRaise = Jaw_Up = 1 +bs = BrowsD_L = BrowsDown_Left = 1 +bs = BrowsD_R = BrowsDown_Right = 1 +bs = JawOpen = MouthOpen = 0.69999999999999996 +bs = LipsLowerOpen = LowerLipOut = 1 +bs = LipsLowerDown = LowerLipDown_Right = 0.69999999999999996 +bs = LipsLowerDown = LowerLipDown_Left = 0.69999999999999996 +bs = JawRight = Jaw_Right = 1 +bs = MouthRight = Midmouth_Right = 1 +bs = LipsFunnel = TongueUp = 1 +bs = LipsFunnel = MouthWhistle_NarrowAdjust_Right = 0.5 +bs = LipsFunnel = MouthWhistle_NarrowAdjust_Left = 0.5 +bs = LipsFunnel = MouthNarrow_Right = 1 +bs = LipsFunnel = MouthNarrow_Left = 1 +bs = LipsFunnel = Jaw_Down = 0.35999999999999999 +bs = LipsFunnel = JawForeward = 0.39000000000000001 +bs = BrowsU_L = BrowsUp_Left = 1 +bs = JawLeft = JawRotateY_Left = 0.5 +jointIndex = HeadTop_End = 84 +jointIndex = LeftHandPinky3 = 55 +jointIndex = RightEye = 82 +jointIndex = Hips = 4 +jointIndex = Spine2 = 19 +jointIndex = RightHandThumb4_end = 43 +jointIndex = Flat_geo = 86 +jointIndex = RightHandThumb2 = 40 +jointIndex = RightHandRing1 = 29 +jointIndex = Camera = 0 +jointIndex = RightShoulder = 20 +jointIndex = LeftHandPinky4 = 56 +jointIndex = RightToe_End = 15 +jointIndex = LeftHandRing2 = 59 +jointIndex = LeftEye_end = 81 +jointIndex = RightHandPinky1 = 24 +jointIndex = RightHandPinky2 = 25 +jointIndex = RightForeArm = 22 +jointIndex = LeftHandMiddle3 = 75 +jointIndex = RightHandThumb4 = 42 +jointIndex = Lamp = 1 +jointIndex = LeftHandMiddle2 = 74 +jointIndex = LeftHandRing3 = 60 +jointIndex = LeftHandMiddle1 = 73 +jointIndex = LeftHandIndex4_end = 67 +jointIndex = LeftHandIndex3 = 65 +jointIndex = LeftHandIndex1 = 63 +jointIndex = LeftHandMiddle4 = 76 +jointIndex = RightHandThumb3 = 41 +jointIndex = reference_nakedAvatar = 87 +jointIndex = LeftHandRing4 = 61 +jointIndex = RightHandIndex3 = 36 +jointIndex = RightHandRing4_end = 33 +jointIndex = Neck = 78 +jointIndex = RightEye_end = 83 +jointIndex = Head = 79 +jointIndex = HeadTop_End_end = 85 +jointIndex = LeftHandPinky4_end = 57 +jointIndex = LeftArm = 50 +jointIndex = LeftShoulder = 49 +jointIndex = LeftEye = 80 +jointIndex = LeftHandThumb1 = 68 +jointIndex = LeftHandThumb4 = 71 +jointIndex = LeftToeBase = 8 +jointIndex = LeftHandMiddle4_end = 77 +jointIndex = LeftUpLeg = 5 +jointIndex = RightHandIndex4 = 37 +jointIndex = RightToe_End_end = 16 +jointIndex = LeftHandIndex2 = 64 +jointIndex = LeftForeArm = 51 +jointIndex = LeftHandPinky1 = 53 +jointIndex = LeftToe_End_end = 10 +jointIndex = LeftHandPinky2 = 54 +jointIndex = LeftFoot = 7 +jointIndex = Spine = 17 +jointIndex = RightUpLeg = 11 +jointIndex = LeftToe_End = 9 +jointIndex = LeftHandRing4_end = 62 +jointIndex = Spine1 = 18 +jointIndex = LeftHandRing1 = 58 +jointIndex = LeftHandIndex4 = 66 +jointIndex = LeftHand = 52 +jointIndex = RightHandPinky4_end = 28 +jointIndex = LeftHandThumb4_end = 72 +jointIndex = RightHandThumb1 = 39 +jointIndex = RightLeg = 12 +jointIndex = RightToeBase = 14 +jointIndex = RightHandRing4 = 32 +jointIndex = RightHandPinky4 = 27 +jointIndex = LeftHandThumb2 = 69 +jointIndex = RightFoot = 13 +jointIndex = Armature = 3 +jointIndex = RightHandRing3 = 31 +jointIndex = RightHandMiddle1 = 44 +jointIndex = RightHandMiddle4_end = 48 +jointIndex = RightHandIndex4_end = 38 +jointIndex = RightHandMiddle4 = 47 +jointIndex = RightHand = 23 +jointIndex = RightHandIndex1 = 34 +jointIndex = RightHandMiddle3 = 46 +jointIndex = LeftHandThumb3 = 70 +jointIndex = LeftLeg = 6 +jointIndex = RightHandPinky3 = 26 +jointIndex = RightHandMiddle2 = 45 +jointIndex = RightArm = 21 +jointIndex = RightHandRing2 = 30 +jointIndex = Body = 2 +jointIndex = RightHandIndex2 = 35 diff --git a/hifi-content/faye/gemstoneMagicMaker/gemstoneAppIcon.svg b/hifi-content/faye/gemstoneMagicMaker/gemstoneAppIcon.svg new file mode 100644 index 000000000..f742c5975 --- /dev/null +++ b/hifi-content/faye/gemstoneMagicMaker/gemstoneAppIcon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/hifi-content/faye/gemstoneMagicMaker/gemstoneMagicMaker.html b/hifi-content/faye/gemstoneMagicMaker/gemstoneMagicMaker.html new file mode 120000 index 000000000..d7e100580 --- /dev/null +++ b/hifi-content/faye/gemstoneMagicMaker/gemstoneMagicMaker.html @@ -0,0 +1 @@ +../../samuel/gemstone.html \ No newline at end of file diff --git a/hifi-content/faye/gemstoneMagicMaker/gemstoneMagicMakerStep2.html b/hifi-content/faye/gemstoneMagicMaker/gemstoneMagicMakerStep2.html new file mode 100644 index 000000000..c04add74a --- /dev/null +++ b/hifi-content/faye/gemstoneMagicMaker/gemstoneMagicMakerStep2.html @@ -0,0 +1,140 @@ + + + + Gemstone Magic Maker + + + + + + +
+

Gemstone Magic Maker

+
+
+

Pick a gemstone from our curated collection:

+

+

+

+

+
+ + + + + \ No newline at end of file diff --git a/hifi-content/faye/gesture/increaseAvatarSize.js b/hifi-content/faye/gesture/increaseAvatarSize.js new file mode 100644 index 000000000..636824543 --- /dev/null +++ b/hifi-content/faye/gesture/increaseAvatarSize.js @@ -0,0 +1,5 @@ +(function() { + for (var i = 0; i < 5; i++){ + MyAvatar.increaseSize(); + } +}()); \ No newline at end of file diff --git a/hifi-content/faye/gesture/toggleMic.js b/hifi-content/faye/gesture/toggleMic.js new file mode 100644 index 000000000..a383621f2 --- /dev/null +++ b/hifi-content/faye/gesture/toggleMic.js @@ -0,0 +1,3 @@ +(function() { + Menu.setIsOptionChecked("Mute Microphone", !Menu.isOptionChecked("Mute Microphone")); +}()); \ No newline at end of file diff --git a/hifi-content/faye/gesture/togglePersonalBubble.js b/hifi-content/faye/gesture/togglePersonalBubble.js new file mode 100644 index 000000000..c3452fa9a --- /dev/null +++ b/hifi-content/faye/gesture/togglePersonalBubble.js @@ -0,0 +1,3 @@ +(function() { + Users.toggleIgnoreRadius(); +}()); \ No newline at end of file diff --git a/hifi-content/faye/hamburger.json b/hifi-content/faye/hamburger.json new file mode 100644 index 000000000..5df6ea3ee --- /dev/null +++ b/hifi-content/faye/hamburger.json @@ -0,0 +1,241 @@ +{ + "Entities": [ + { + "clientOnly": 0, + "color": { + "blue": 43, + "green": 255, + "red": 248 + }, + "created": "2017-02-02T01:22:02Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.0083922296762466431, + "z": 0.20000000298023224 + }, + "id": "{e5685466-e33d-412d-b60c-9f9ae8660c3c}", + "lastEdited": 1485998587055872, + "lastEditedBy": "{acc0dce4-bbe1-44cf-aaf0-5b8f4b17cc47}", + "name": "Faye's Hamburger - Cheese", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{4992f3d4-719e-4db2-908c-510e054cc0e0}", + "position": { + "x": 0, + "y": 0.10842794179916382, + "z": 0 + }, + "queryAACube": { + "scale": 0.84890162944793701, + "x": 0.56746578216552734, + "y": 0.55333739519119263, + "z": -2.2812376022338867 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box" + }, + { + "clientOnly": 0, + "color": { + "blue": 49, + "green": 142, + "red": 204 + }, + "created": "2017-02-02T01:22:02Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.047083869576454163, + "z": 0.20000000298023224 + }, + "gravity": { + "x": 0, + "y": -0.5, + "z": 0 + }, + "id": "{e5177b0b-8baf-44c9-866c-faa883a92aa3}", + "lastEdited": 1485998528428926, + "lastEditedBy": "{acc0dce4-bbe1-44cf-aaf0-5b8f4b17cc47}", + "name": "Faye's Hamburger - Bun", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{4992f3d4-719e-4db2-908c-510e054cc0e0}", + "position": { + "x": 0, + "y": 0.14185553789138794, + "z": 0 + }, + "queryAACube": { + "scale": 0.86020463705062866, + "x": 0.58402878046035767, + "y": 0.53077894449234009, + "z": -2.3175511360168457 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box" + }, + { + "clientOnly": 0, + "color": { + "blue": 46, + "green": 84, + "red": 255 + }, + "created": "2017-02-02T01:22:02Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.017483428120613098, + "z": 0.20000000298023224 + }, + "id": "{308dee4d-f350-456c-8f6c-9cfc893ba5ba}", + "lastEdited": 1485998563910599, + "lastEditedBy": "{acc0dce4-bbe1-44cf-aaf0-5b8f4b17cc47}", + "name": "Faye's Hamburger Tomato", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{4992f3d4-719e-4db2-908c-510e054cc0e0}", + "position": { + "x": 0, + "y": 0.05262070894241333, + "z": 0 + }, + "queryAACube": { + "scale": 0.85014772415161133, + "x": 0.72543478012084961, + "y": 0.76334357261657715, + "z": -2.5442085266113281 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box" + }, + { + "clientOnly": 0, + "color": { + "blue": 12, + "green": 60, + "red": 92 + }, + "created": "2017-02-02T01:22:02Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.034626737236976624, + "z": 0.20000000298023224 + }, + "id": "{c4a99ee8-76f2-4af2-8f95-4e6a95b7d176}", + "lastEdited": 1485998575743136, + "lastEditedBy": "{acc0dce4-bbe1-44cf-aaf0-5b8f4b17cc47}", + "name": "Faye's Hamburger - Beef", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{4992f3d4-719e-4db2-908c-510e054cc0e0}", + "position": { + "x": 0, + "y": 0.081467807292938232, + "z": 0 + }, + "queryAACube": { + "scale": 0.85486328601837158, + "x": 0.56640422344207764, + "y": 0.58218556642532349, + "z": -2.289370059967041 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box" + }, + { + "clientOnly": 0, + "color": { + "blue": 46, + "green": 255, + "red": 168 + }, + "created": "2017-02-02T01:22:02Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.012778356671333313, + "z": 0.20000000298023224 + }, + "id": "{acfa1637-cc80-4d7d-8244-b3832fbb8dee}", + "lastEdited": 1485998553541811, + "lastEditedBy": "{acc0dce4-bbe1-44cf-aaf0-5b8f4b17cc47}", + "name": "Faye's Hamburger - Lettuce", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{4992f3d4-719e-4db2-908c-510e054cc0e0}", + "position": { + "x": 0, + "y": 0.03562319278717041, + "z": 0 + }, + "queryAACube": { + "scale": 0.84939372539520264, + "x": 0.71656042337417603, + "y": 0.77622425556182861, + "z": -2.5380725860595703 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box" + }, + { + "clientOnly": 0, + "collisionsWillMove": 1, + "color": { + "blue": 49, + "green": 142, + "red": 204 + }, + "created": "2017-02-02T01:22:02Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.047083869576454163, + "z": 0.20000000298023224 + }, + "dynamic": 1, + "id": "{4992f3d4-719e-4db2-908c-510e054cc0e0}", + "lastEdited": 1485998539425056, + "lastEditedBy": "{acc0dce4-bbe1-44cf-aaf0-5b8f4b17cc47}", + "name": "Faye's Hamburger - Bun", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "queryAACube": { + "scale": 0.28673487901687622, + "x": -0.14336743950843811, + "y": -0.14336743950843811, + "z": -0.14336743950843811 + }, + "rotation": { + "w": -0.16096740961074829, + "x": -0.43581295013427734, + "y": -0.058854043483734131, + "z": 0.88357365131378174 + }, + "shape": "Cube", + "type": "Box", + "userData": "{\"grabbableKey\":{\"grabbable\":true}}" + } + ], + "Version": 66 +} diff --git a/hifi-content/faye/house.json b/hifi-content/faye/house.json new file mode 100644 index 000000000..26f64f48d --- /dev/null +++ b/hifi-content/faye/house.json @@ -0,0 +1,563 @@ +{ + "Entities": [ + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 8.8747072219848633, + "y": 3.5499997138977051, + "z": 0.20000018179416656 + }, + "id": "{aee53a28-9871-4394-adab-236bfa40e638}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_roof_triangle.fbx", + "name": "Snap Block wall_rooftriangle", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 9.0373468399047852, + "y": 5.6610641479492188, + "z": 15.650066375732422 + }, + "queryAACube": { + "scale": 9.5604877471923828, + "x": 4.2571029663085938, + "y": 0.88082027435302734, + "z": 10.86982250213623 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 2.9999995231628418, + "y": 1.9812009334564209, + "z": 0.22000008821487427 + }, + "id": "{aa6a7e53-abc5-4712-ae99-8b04832ac7d4}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_window.fbx", + "name": "Snap Block window", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 9.2999696731567383, + "y": 2.044189453125, + "z": 15.409954071044922 + }, + "queryAACube": { + "scale": 3.6018819808959961, + "x": 7.4990286827087402, + "y": 0.24324846267700195, + "z": 13.609012603759766 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 9.9999961853027344, + "y": 4.000004768371582, + "z": 9.9999990463256836 + }, + "id": "{9a5dcd19-5962-408e-918e-f5c47ac8cf05}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_roof.fbx", + "name": "Snap Block roof", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 9.000147819519043, + "y": 7.830230712890625, + "z": 11.850090026855469 + }, + "queryAACube": { + "scale": 14.69693660736084, + "x": 1.651679515838623, + "y": 0.48176240921020508, + "z": 4.5016217231750488 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 1.5615746974945068, + "y": 3.1231496334075928, + "z": 0.090553291141986847 + }, + "id": "{a6f810df-574d-4db9-aa8d-1fe40821ffef}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_door_door.fbx", + "name": "Snap Block door", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 37.033596038818359, + "y": 1.7551727294921875, + "z": 26.380775451660156 + }, + "queryAACube": { + "scale": 3.4929614067077637, + "x": 35.287117004394531, + "y": 0.0086920261383056641, + "z": 24.634294509887695 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T21:04:32Z", + "dimensions": { + "x": 4, + "y": 4.0000009536743164, + "z": 4 + }, + "id": "{e2e1dba2-1153-4650-bf99-c1510223376e}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_corner.fbx", + "name": "Snap Block wall_corner", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 4.0000581741333008, + "y": 1.8844528198242188, + "z": 1.8999977111816406 + }, + "queryAACube": { + "scale": 6.9282035827636719, + "x": 0.53595638275146484, + "y": -1.5796489715576172, + "z": -1.5641040802001953 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 2, + "y": 3.9999995231628418, + "z": 0.20000246167182922 + }, + "id": "{bab3fd6c-1025-4b03-95eb-7f51701a8a8a}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_portal.fbx", + "name": "Snap Block wall_portal", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 2.1000289916992188, + "y": 1.8846817016601562, + "z": 14.499940872192383 + }, + "queryAACube": { + "scale": 4.4766054153442383, + "x": -0.13827371597290039, + "y": -0.35362100601196289, + "z": 12.261638641357422 + }, + "rotation": { + "w": 0.70708787441253662, + "x": -4.57763671875e-05, + "y": 0.70708787441253662, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:51:25Z", + "dimensions": { + "x": 4, + "y": 4.0000009536743164, + "z": 4 + }, + "id": "{fec4242b-6551-4551-882a-c477535dd42c}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_corner.fbx", + "name": "Snap Block wall_corner", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 12.000058174133301, + "y": 1.8844528198242188, + "z": 1.8999996185302734 + }, + "queryAACube": { + "scale": 6.9282035827636719, + "x": 8.5359563827514648, + "y": -1.5796489715576172, + "z": -1.5641021728515625 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T21:00:10Z", + "dimensions": { + "x": 2, + "y": 3.9999995231628418, + "z": 0.20000246167182922 + }, + "id": "{ef340b13-6168-4b50-8d44-14af64d49e75}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_portal.fbx", + "name": "Snap Block wall_portal", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 9.0500001907348633, + "y": 1.8846817016601562, + "z": 7.7999687194824219 + }, + "queryAACube": { + "scale": 4.4766054153442383, + "x": 6.8116974830627441, + "y": -0.35362100601196289, + "z": 5.5616660118103027 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:57:59Z", + "dimensions": { + "x": 4, + "y": 3.9999995231628418, + "z": 0.20000022649765015 + }, + "id": "{a7d3632b-f151-4ae7-ae54-1038d463ee7e}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_straight.fbx", + "name": "Snap Block wall_straight", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 8.0000009536743164, + "y": 1.883453369140625, + "z": 15.599998474121094 + }, + "queryAACube": { + "scale": 5.6603884696960449, + "x": 5.1698064804077148, + "y": -0.94674086570739746, + "z": 12.769804000854492 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:55:47Z", + "dimensions": { + "x": 4, + "y": 4.0000009536743164, + "z": 4 + }, + "id": "{81c15d66-232d-4e10-a2c1-7b35ba6b63ea}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_corner.fbx", + "name": "Snap Block wall_corner", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 12.000058174133301, + "y": 1.8844528198242188, + "z": 13.69999885559082 + }, + "queryAACube": { + "scale": 6.9282035827636719, + "x": 8.5359563827514648, + "y": -1.5796489715576172, + "z": 10.235897064208984 + }, + "rotation": { + "w": 0.70708787441253662, + "x": -1.52587890625e-05, + "y": -0.70714884996414185, + "z": -4.57763671875e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 4, + "y": 3.9999995231628418, + "z": 0.20000259578227997 + }, + "id": "{0e2a45b4-c78e-4a32-ab2e-6b1e7cb45626}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_aperture.fbx", + "name": "Snap Block wall_aperture", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 8.0000009536743164, + "y": 1.8816070556640625, + "z": 0 + }, + "queryAACube": { + "scale": 5.6603884696960449, + "x": 5.1698064804077148, + "y": -0.94858717918395996, + "z": -2.8301942348480225 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 4, + "y": 3.9999995231628418, + "z": 0.20000022649765015 + }, + "id": "{f33d6bce-0db6-4c2b-a3ed-b53c608dc6eb}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_straight.fbx", + "name": "Snap Block wall_straight", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 0, + "y": 2.2834548950195312, + "z": 16.94999885559082 + }, + "queryAACube": { + "scale": 5.6603884696960449, + "x": -2.8301942348480225, + "y": -0.54673933982849121, + "z": 14.119804382324219 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 8, + "y": 0.20000045001506805, + "z": 7.9999990463256836 + }, + "id": "{f040f261-d473-4100-a06c-65aa5f51898c}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_floor.fbx", + "name": "Snap Block floor", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 10.000061988830566, + "y": 0, + "z": 3.9000015258789062 + }, + "queryAACube": { + "scale": 11.315475463867188, + "x": 4.3423242568969727, + "y": -5.6577377319335938, + "z": -1.7577362060546875 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T21:08:54Z", + "dimensions": { + "x": 4, + "y": 3.9999995231628418, + "z": 0.20000022649765015 + }, + "id": "{ff43473f-4655-4aeb-9796-b1c90c1c4257}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_straight.fbx", + "name": "Snap Block wall_straight", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 4.0000009536743164, + "y": 1.883453369140625, + "z": 15.599998474121094 + }, + "queryAACube": { + "scale": 5.6603884696960449, + "x": 1.1698067188262939, + "y": -0.94674086570739746, + "z": 12.769804000854492 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T21:00:10Z", + "dimensions": { + "x": 4, + "y": 4, + "z": 7.7999992370605469 + }, + "id": "{9a8eb926-2063-499d-a645-423eb1b94c28}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx", + "name": "Snap Block wall_tsplit", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 12.000115394592285, + "y": 1.8843841552734375, + "z": 7.7999973297119141 + }, + "queryAACube": { + "scale": 9.6353511810302734, + "x": 7.1824398040771484, + "y": -2.9332914352416992, + "z": 2.9823217391967773 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:47:03Z", + "dimensions": { + "x": 4, + "y": 4, + "z": 7.7999992370605469 + }, + "id": "{9389c938-5db2-49b2-a432-af7d3015ae2f}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx", + "name": "Snap Block wall_tsplit", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 3.8001165390014648, + "y": 1.8843841552734375, + "z": 7.7999973297119141 + }, + "queryAACube": { + "scale": 9.6353511810302734, + "x": -1.0175590515136719, + "y": -2.9332914352416992, + "z": 2.9823217391967773 + }, + "rotation": { + "w": -4.57763671875e-05, + "x": 1.52587890625e-05, + "y": -1, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T20:55:47Z", + "dimensions": { + "x": 4, + "y": 4.0000009536743164, + "z": 4 + }, + "id": "{8580d926-f9ce-4729-a572-cd2701b3e1f4}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_corner.fbx", + "name": "Snap Block wall_corner", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 5.817413330078125e-05, + "y": 1.8844528198242188, + "z": 1.899998664855957 + }, + "queryAACube": { + "scale": 6.9282035827636719, + "x": -3.4640436172485352, + "y": -1.5796489715576172, + "z": -1.5641031265258789 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + }, + { + "clientOnly": 0, + "created": "2016-10-12T21:04:32Z", + "dimensions": { + "x": 4, + "y": 4, + "z": 7.7999992370605469 + }, + "id": "{d8ae1bb8-6081-4394-b36e-bfbc1594d503}", + "modelURL": "https://s3-us-west-1.amazonaws.com/hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx", + "name": "Snap Block wall_tsplit", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 6.050114631652832, + "y": 1.8843841552734375, + "z": 7.7999973297119141 + }, + "queryAACube": { + "scale": 9.6353511810302734, + "x": 1.2324390411376953, + "y": -2.9332914352416992, + "z": 2.9823217391967773 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "type": "Model" + } + ], + "Version": 64 +} diff --git a/hifi-content/faye/photobooth.html b/hifi-content/faye/photobooth.html new file mode 100644 index 000000000..26ad57f86 --- /dev/null +++ b/hifi-content/faye/photobooth.html @@ -0,0 +1,152 @@ + + + Photo Booth + + + + + + + + +
+
Photobooth
+
+
+
+
+ + + +
+
+ + +
+
+ + +
+
+ +
+
+
+ + + + + + diff --git a/hifi-content/faye/plp/PLPZoneEntityScript.js b/hifi-content/faye/plp/PLPZoneEntityScript.js new file mode 100644 index 000000000..9eed9b211 --- /dev/null +++ b/hifi-content/faye/plp/PLPZoneEntityScript.js @@ -0,0 +1,14 @@ +// PLPZoneEntityScript.js +// +// Created by Si Fi Faye Li on 31 Oct, 2016 +// +// + +(function(){ // BEGINS LOCAL SCOPE + this.enterEntity = function(entityID) { + print("enter PLP Zone"); + }; + this.leaveEntity = function(entityID) { + print("leave PLP Zone"); + }; +}); // ENDS LOCAL SCOPE \ No newline at end of file diff --git a/hifi-content/faye/plp/assets/arrow.fbx b/hifi-content/faye/plp/assets/arrow.fbx new file mode 100644 index 000000000..39498223e --- /dev/null +++ b/hifi-content/faye/plp/assets/arrow.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:188978484a147db12b93dc8bd36a9d98b30216d5ae64f9e244bf710d3fef939a +size 22112 diff --git a/hifi-content/faye/plp/assets/mini-cooper.fbx b/hifi-content/faye/plp/assets/mini-cooper.fbx new file mode 100644 index 000000000..02bf96186 --- /dev/null +++ b/hifi-content/faye/plp/assets/mini-cooper.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d985bec6349e96f4ab6253d46cbd0a7b60f1810c9194c45cddeea36e4016d15 +size 35335248 diff --git a/hifi-content/faye/plp/assets/mini-cooper_1.fbx b/hifi-content/faye/plp/assets/mini-cooper_1.fbx new file mode 100644 index 000000000..1a19d74c6 --- /dev/null +++ b/hifi-content/faye/plp/assets/mini-cooper_1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efb0f663fe56ce2b8a1c8815e42abe52271da92fd8ccd4910e7abba4a14e0582 +size 38905440 diff --git a/hifi-content/faye/plp/assets/original-wheel.fbx b/hifi-content/faye/plp/assets/original-wheel.fbx new file mode 100644 index 000000000..8e9e49394 --- /dev/null +++ b/hifi-content/faye/plp/assets/original-wheel.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d90365ef6319cf0a3d4b81240eb554b665c9f160895cb0f25573b71d0f3affed +size 785360 diff --git a/hifi-content/faye/plp/assets/plain-ring.fbx b/hifi-content/faye/plp/assets/plain-ring.fbx new file mode 100644 index 000000000..39e5fa278 --- /dev/null +++ b/hifi-content/faye/plp/assets/plain-ring.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c39874b4cb0566b99c6f705560a5e6c1892fec182ed50c9d61543b34b6fc9423 +size 298816 diff --git a/hifi-content/faye/plp/assets/volkeswagon-vw-beetle.fbx b/hifi-content/faye/plp/assets/volkeswagon-vw-beetle.fbx new file mode 100644 index 000000000..037ece0b4 --- /dev/null +++ b/hifi-content/faye/plp/assets/volkeswagon-vw-beetle.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3e8aea1e596bef9210e6c079eae8b365572d4624ca90006ccfc7d4d0c5c36ca +size 2378336 diff --git a/hifi-content/faye/plp/flame.json b/hifi-content/faye/plp/flame.json new file mode 100644 index 000000000..93f0e61b9 --- /dev/null +++ b/hifi-content/faye/plp/flame.json @@ -0,0 +1,104 @@ +{ + "Entities": [ + { + "accelerationSpread": { + "x": 0.5, + "y": 0, + "z": 0.80000001192092896 + }, + "alpha": 0.14000000059604645, + "alphaFinish": 0.14000000059604645, + "alphaStart": 0.14000000059604645, + "azimuthFinish": 0, + "azimuthStart": -3, + "clientOnly": 0, + "created": "2016-11-04T23:39:20Z", + "dimensions": { + "x": 1.6670498847961426, + "y": 1.6670498847961426, + "z": 1.6670498847961426 + }, + "emitAcceleration": { + "x": 0, + "y": 0, + "z": 0 + }, + "emitOrientation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "emitRate": 68, + "emitSpeed": 0.010999999940395355, + "id": "{e9a12baf-007a-419d-b672-83e65f6d5a22}", + "lifespan": 0.34999999403953552, + "maxParticles": 1620, + "name": "torch_particle_fire", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "particleRadius": 0.10000000149011612, + "position": { + "x": 0.046639442443847656, + "y": 0, + "z": 0.096012115478515625 + }, + "queryAACube": { + "scale": 2.8874151706695557, + "x": -1.3970681428909302, + "y": -1.4437075853347778, + "z": -1.3476954698562622 + }, + "radiusFinish": 0.10000000149011612, + "radiusSpread": 41, + "radiusStart": 0.10000000149011612, + "rotation": { + "w": 0.048456072807312012, + "x": 0.16173362731933594, + "y": -0.74504339694976807, + "z": -0.64526373147964478 + }, + "speedSpread": 2, + "textures": "http://hifi-content.s3.amazonaws.com/alan/dev/Particles/Fireball.jpg", + "type": "ParticleEffect" + }, + { + "clientOnly": 0, + "color": { + "blue": 21, + "green": 76, + "red": 230 + }, + "created": "2016-11-04T23:39:20Z", + "cutoff": 90, + "dimensions": { + "x": 11.288655281066895, + "y": 11.288655281066895, + "z": 11.288655281066895 + }, + "id": "{170ce4af-d870-4355-8a70-f53c90815a2e}", + "intensity": 408.86239624023438, + "name": "Torch Light", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "x": 0, + "y": 0.2410125732421875, + "z": 0 + }, + "queryAACube": { + "scale": 19.552524566650391, + "x": -9.7762622833251953, + "y": -9.5352497100830078, + "z": -9.7762622833251953 + }, + "rotation": { + "w": -0.9611891508102417, + "x": 0.090958699584007263, + "y": 0.20282170176506042, + "z": -0.16319164633750916 + }, + "script": "atp:/firepit/flicker.js", + "type": "Light" + } + ], + "Version": 64 +} diff --git a/hifi-content/faye/plp/greenButtonEntityScript.js b/hifi-content/faye/plp/greenButtonEntityScript.js new file mode 100644 index 000000000..980d1d20c --- /dev/null +++ b/hifi-content/faye/plp/greenButtonEntityScript.js @@ -0,0 +1,51 @@ +// greenButtonEntityScript.js +// +// Created by Faye Li on November 3, 2016 +// +(function() { + print("green button v0.35"); + var _this; + var CLICK_SOUND_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/gameTable/woodenTapClick.wav"; + var myChannel = "MakeStation-Channel"; + + function GreenButton() { + _this = this; + } + + GreenButton.prototype = { + entityID: null, + sound: null, + position: null, + preload: function(entityID) { + print('preload(' + entityID + ')'); + _this.entityID = entityID; + _this.sound = SoundCache.getSound(CLICK_SOUND_URL); + var props = Entities.getEntityProperties(_this.entityID); + _this.position = props.position; + }, + startNearTrigger: function(entityID) { + print('star near trigger'); + _this.click(); + }, + clickDownOnEntity: function(entityID, mouseEvent) { + print('click down on entity'); + _this.click(); + }, + click: function(){ + // plays click sound as audio feedback + var props = Entities.getEntityProperties(_this.entityID); + var options = { position: props.position }; + var injector = Audio.playSound(_this.sound,options); + // TODO: add visual feedback ie. animate a button click + + var message = { + demoID: 1, + demoPosition: _this.position + }; + message = JSON.stringify(message); + Messages.sendMessage(myChannel, message); + } + }; + + return new GreenButton(); +}); diff --git a/hifi-content/faye/plp/greenButtonEntityScript2.js b/hifi-content/faye/plp/greenButtonEntityScript2.js new file mode 100644 index 000000000..79b409fc2 --- /dev/null +++ b/hifi-content/faye/plp/greenButtonEntityScript2.js @@ -0,0 +1,51 @@ +// greenButtonEntityScript.js +// +// Created by Faye Li on November 3, 2016 +// +(function() { + print("green button v0.35"); + var _this; + var CLICK_SOUND_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/gameTable/woodenTapClick.wav"; + var myChannel = "MakeStation-Channel"; + + function GreenButton() { + _this = this; + } + + GreenButton.prototype = { + entityID: null, + sound: null, + position: null, + preload: function(entityID) { + print('preload(' + entityID + ')'); + _this.entityID = entityID; + _this.sound = SoundCache.getSound(CLICK_SOUND_URL); + var props = Entities.getEntityProperties(_this.entityID); + _this.position = props.position; + }, + startNearTrigger: function(entityID) { + print('star near trigger'); + _this.click(); + }, + clickDownOnEntity: function(entityID, mouseEvent) { + print('click down on entity'); + _this.click(); + }, + click: function(){ + // plays click sound as audio feedback + var props = Entities.getEntityProperties(_this.entityID); + var options = { position: props.position }; + var injector = Audio.playSound(_this.sound,options); + // TODO: add visual feedback ie. animate a button click + + var message = { + demoID: 2, + demoPosition: _this.position + }; + message = JSON.stringify(message); + Messages.sendMessage(myChannel, message); + } + }; + + return new GreenButton(); +}); diff --git a/hifi-content/faye/plp/greenButtonEntityScript3.js b/hifi-content/faye/plp/greenButtonEntityScript3.js new file mode 100644 index 000000000..d270ec822 --- /dev/null +++ b/hifi-content/faye/plp/greenButtonEntityScript3.js @@ -0,0 +1,51 @@ +// greenButtonEntityScript.js +// +// Created by Faye Li on November 3, 2016 +// +(function() { + print("green button v0.35"); + var _this; + var CLICK_SOUND_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/gameTable/woodenTapClick.wav"; + var myChannel = "MakeStation-Channel"; + + function GreenButton() { + _this = this; + } + + GreenButton.prototype = { + entityID: null, + sound: null, + position: null, + preload: function(entityID) { + print('preload(' + entityID + ')'); + _this.entityID = entityID; + _this.sound = SoundCache.getSound(CLICK_SOUND_URL); + var props = Entities.getEntityProperties(_this.entityID); + _this.position = props.position; + }, + startNearTrigger: function(entityID) { + print('star near trigger'); + _this.click(); + }, + clickDownOnEntity: function(entityID, mouseEvent) { + print('click down on entity'); + _this.click(); + }, + click: function(){ + // plays click sound as audio feedback + var props = Entities.getEntityProperties(_this.entityID); + var options = { position: props.position }; + var injector = Audio.playSound(_this.sound,options); + // TODO: add visual feedback ie. animate a button click + + var message = { + demoID: 3, + demoPosition: _this.position + }; + message = JSON.stringify(message); + Messages.sendMessage(myChannel, message); + } + }; + + return new GreenButton(); +}); diff --git a/hifi-content/faye/plp/greenButtonEntityScript4.js b/hifi-content/faye/plp/greenButtonEntityScript4.js new file mode 100644 index 000000000..742107f0e --- /dev/null +++ b/hifi-content/faye/plp/greenButtonEntityScript4.js @@ -0,0 +1,50 @@ +// greenButtonEntityScript.js +// +// Created by Faye Li on November 3, 2016 +// +(function() { + var _this; + var CLICK_SOUND_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/gameTable/woodenTapClick.wav"; + var myChannel = "MakeStation-Channel"; + + function GreenButton() { + _this = this; + } + + GreenButton.prototype = { + entityID: null, + sound: null, + position: null, + preload: function(entityID) { + print('preload(' + entityID + ')'); + _this.entityID = entityID; + _this.sound = SoundCache.getSound(CLICK_SOUND_URL); + var props = Entities.getEntityProperties(_this.entityID); + _this.position = props.position; + }, + startNearTrigger: function(entityID) { + print('star near trigger'); + _this.click(); + }, + clickDownOnEntity: function(entityID, mouseEvent) { + print('click down on entity'); + _this.click(); + }, + click: function(){ + // plays click sound as audio feedback + var props = Entities.getEntityProperties(_this.entityID); + var options = { position: props.position }; + var injector = Audio.playSound(_this.sound,options); + // TODO: add visual feedback ie. animate a button click + + var message = { + demoID: 4, + demoPosition: _this.position + }; + message = JSON.stringify(message); + Messages.sendMessage(myChannel, message); + } + }; + + return new GreenButton(); +}); diff --git a/hifi-content/faye/rug.fbx b/hifi-content/faye/rug.fbx new file mode 100644 index 000000000..819f787e9 --- /dev/null +++ b/hifi-content/faye/rug.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8579cb816a7bf0e6c264a9b59fb10fa423582f399916c9f2db331438f3d09253 +size 20371248 diff --git a/hifi-content/faye/rugEntityScript.js b/hifi-content/faye/rugEntityScript.js new file mode 100644 index 000000000..308819ff0 --- /dev/null +++ b/hifi-content/faye/rugEntityScript.js @@ -0,0 +1,41 @@ +(function(){ + var myRugChannel; + print("running rug entity script with relative pos"); + var handleMessages = function(channel, message, sender) { + if (channel === myRugChannel) { + // Don't teleport again if message is sent from yourself (group leader) + if (sender !== MyAvatar.sessionUUID) { + //var vec = JSON.parse(message); + print('recieved message, leader position: ' + message); + var leaderPos = JSON.parse(message); + var beforePos = leaderPos.before; + var afterPos = leaderPos.after; + var relativeVec = Vec3.subtract(MyAvatar.position,beforePos); + //var offset = Quat.getFront(MyAvatar.orientation); + //offset = Vec3.multiply(offset,0.2); + //var newLocation = Vec3.sum(vec, offset); + var newLocation = Vec3.sum(afterPos,relativeVec); + print('Teleport avatar to new location: ' + JSON.stringify(newLocation)); + MyAvatar.goToLocation(newLocation, false); + print('After teleport, unsubsribe from ' + myRugChannel); + Messages.unsubscribe(myRugChannel); + Messages.messageReceived.disconnect(handleMessages); + } + } + }; + this.enterEntity = function(entityID) { + print("enter rug"); + myRugChannel = 'Group-Teleport-'+ entityID; + print('subsribe to ' + myRugChannel); + Messages.subscribe(myRugChannel); + Messages.messageReceived.connect(handleMessages); + }; + this.leaveEntity = function(entityID) { + if (typeof myRugChannel !== "undefined") { + print("leave rug"); + print('unsubsribe from ' + myRugChannel); + Messages.unsubscribe(myRugChannel); + Messages.messageReceived.disconnect(handleMessages); + } + }; +}); \ No newline at end of file diff --git a/hifi-content/faye/selfie/selfieCamEntityScript.js b/hifi-content/faye/selfie/selfieCamEntityScript.js new file mode 100644 index 000000000..932d01b94 --- /dev/null +++ b/hifi-content/faye/selfie/selfieCamEntityScript.js @@ -0,0 +1,40 @@ +// selfieCamEntityScript.js +// +// Created by Si Fi Faye Li on Nov 16, 2016 +// + +(function(){ // BEGIN LOCAL SCOPE + print("selfieCam v0.8"); + var _this; + var myChannel = "Camera-to-Selfie-Channel"; + + function SelfieCam() { + _this = this; + _entityID = null; + } + + SelfieCam.prototype = { + preload: function(entityID) { + _this.entityID = entityID; + }, + startEquip: function(id, params) { + print("start equip"); + var message = { + selfieCamEntityID: _this.entityID, + equipped: true + }; + message = JSON.stringify(message); + Messages.sendMessage(myChannel, message); + }, + releaseEquip: function(id, params) { + print("release equip"); + Camera.setModeString("first person"); + var message = { + equipped: false + }; + message = JSON.stringify(message); + Messages.sendMessage(myChannel, message); + } + }; + return new SelfieCam(); +}); // END LOCAL_SCOPE \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar2.fs b/hifi-content/faye/shader/avatar2.fs new file mode 100644 index 000000000..09a3b6b62 --- /dev/null +++ b/hifi-content/faye/shader/avatar2.fs @@ -0,0 +1,33 @@ +const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0; +const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 1; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) { + discard; + } + vec3 COLOR = PURPLE; + return vec4(COLOR * iShell, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar3.fs b/hifi-content/faye/shader/avatar3.fs new file mode 100644 index 000000000..fbbe473df --- /dev/null +++ b/hifi-content/faye/shader/avatar3.fs @@ -0,0 +1,36 @@ +const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0; +const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 1; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) { + discard; + } + vec3 COLOR = PURPLE; + if (intensity < iMiddle) { + COLOR = BLUE; + } + return vec4(COLOR * iShell, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar4.fs b/hifi-content/faye/shader/avatar4.fs new file mode 100644 index 000000000..f47996136 --- /dev/null +++ b/hifi-content/faye/shader/avatar4.fs @@ -0,0 +1,33 @@ +const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0; +const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 1; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) { + discard; + } + vec3 COLOR = BLUE; + return vec4(COLOR * iShell, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar5.fs b/hifi-content/faye/shader/avatar5.fs new file mode 100644 index 000000000..f8b090ce6 --- /dev/null +++ b/hifi-content/faye/shader/avatar5.fs @@ -0,0 +1,31 @@ +const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0; +const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 1; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + + vec3 COLOR = BLUE; + return vec4(COLOR * iShell, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar6.fs b/hifi-content/faye/shader/avatar6.fs new file mode 100644 index 000000000..b16ab888d --- /dev/null +++ b/hifi-content/faye/shader/avatar6.fs @@ -0,0 +1,33 @@ +const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0; +const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 1; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + vec3 COLOR = BLUE; + if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) { + COLOR = PURPLE; + } + return vec4(COLOR * iShell, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar7.fs b/hifi-content/faye/shader/avatar7.fs new file mode 100644 index 000000000..00a858dc9 --- /dev/null +++ b/hifi-content/faye/shader/avatar7.fs @@ -0,0 +1,36 @@ +const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0; +const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 1; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + vec3 COLOR = BLUE; + if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) { + discard; + } + if (intensity == iMiddle) { + COLOR = PURPLE; + } + return vec4(COLOR * iShell, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/avatar8.fs b/hifi-content/faye/shader/avatar8.fs new file mode 120000 index 000000000..ec998e824 --- /dev/null +++ b/hifi-content/faye/shader/avatar8.fs @@ -0,0 +1 @@ +avatar7.fs \ No newline at end of file diff --git a/hifi-content/faye/shader/blue.fs b/hifi-content/faye/shader/blue.fs new file mode 100644 index 000000000..1ccb40d86 --- /dev/null +++ b/hifi-content/faye/shader/blue.fs @@ -0,0 +1,3 @@ +void main() { + gl_FragColor = vec4(0.4,0.4,0.8,1.0); +} diff --git a/hifi-content/faye/shader/myQuora.fs b/hifi-content/faye/shader/myQuora.fs new file mode 100644 index 000000000..8e9073660 --- /dev/null +++ b/hifi-content/faye/shader/myQuora.fs @@ -0,0 +1,32 @@ +const vec3 COLOR = vec3(24.0, 202.0, 230.0) / 255.0; + +uniform float iWidth = 0.004; +uniform float iMiddle = 0.5; +uniform float iShell = 1.0; +uniform float iSpeed = 1.0; + +vec4 getProceduralColor() { + float intensity = 0.0; + float time = iGlobalTime / 5.0 * iSpeed; + vec3 position = _position.xyz * 1.5 * iWorldScale; + for (int i = 0; i < 3; ++i) { + float modifier = pow(2, i); + vec3 noisePosition = position * modifier; + float noise = snoise(vec4(noisePosition, time)); + noise /= modifier; + intensity += noise; + } + intensity += 1.0; + intensity /= 2.0; + if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) { + discard; + } + return vec4(COLOR, 1); +} + + +float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { + specular = getProceduralColor().rgb; + diffuse = getProceduralColor().rgb; + return 1.0; +} \ No newline at end of file diff --git a/hifi-content/faye/shader/pink.fs b/hifi-content/faye/shader/pink.fs new file mode 100644 index 000000000..bc96052e1 --- /dev/null +++ b/hifi-content/faye/shader/pink.fs @@ -0,0 +1,5 @@ +const vec3 COLOR = vec3(255.0, 175.0, 230.0) / 255.0; + +void main() { + gl_FragColor = vec4(COLOR, 1.0); +} \ No newline at end of file diff --git a/hifi-content/faye/sliderTest.zip b/hifi-content/faye/sliderTest.zip new file mode 100644 index 000000000..72deda28d --- /dev/null +++ b/hifi-content/faye/sliderTest.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98b4f3cdfcb8b9232ae20f96663bf055e0af496e23dd22305033ba06c2e31f3a +size 2098 diff --git a/hifi-content/faye/sombreroAreaEntityScript.js b/hifi-content/faye/sombreroAreaEntityScript.js new file mode 100644 index 000000000..3dc4a9c2f --- /dev/null +++ b/hifi-content/faye/sombreroAreaEntityScript.js @@ -0,0 +1,32 @@ +// +// sombreroAreaEntityScript.js +// +// This is an entity script to be attached to a collionless cube/sphere. +// When an avatar enters the sphere/cube, the script will instantly put a sombrero on you! +// Enjoy! +// +// Created by Si Fi Faye Li on 19 Oct, 2016 +// + + +(function(){ // BEGIN LOCAL_SCOPE + print("running sombrero area entity script"); + var attachment = { + modelURL: "http://hifi-content.s3.amazonaws.com/Examples Content/production/sombrero/Sombrero1.fbx", + jointName: "HeadTop_End", + translation: {"x": 0, "y": 0.020, "z": -0.050}, + rotation: {"x": 0, "y": 0, "z": 0, "w": 1}, + scale: 1, + isSoft: false + }; + this.enterEntity = function(entityID) { + print("enter sombrero area"); + print("attaching sombrero on top of your head!"); + MyAvatar.attach(attachment.modelURL, + attachment.jointName, + attachment.translation, + attachment.rotation, + attachment.scale, + attachment.isSoft); + }; +}); \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/eventBridgeTest.html b/hifi-content/faye/tablet-dev/eventBridgeTest.html new file mode 100644 index 000000000..2e95dd852 --- /dev/null +++ b/hifi-content/faye/tablet-dev/eventBridgeTest.html @@ -0,0 +1,91 @@ + + + + Event Bridge Test + + + + + + +
+
+
Event Bridge Test
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/refresh-icon.svg b/hifi-content/faye/tablet-dev/refresh-icon.svg new file mode 100644 index 000000000..3f55f8a60 --- /dev/null +++ b/hifi-content/faye/tablet-dev/refresh-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/users-debug.html b/hifi-content/faye/tablet-dev/users-debug.html new file mode 100644 index 000000000..57f6484f1 --- /dev/null +++ b/hifi-content/faye/tablet-dev/users-debug.html @@ -0,0 +1,464 @@ + + + + Users Online + + + + + + + +
+

Users Online

+ +
+
+
+

+ +
+
+ +
+ +
+
+ + +
+
+ + + + + + + + + \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/users-dev.html b/hifi-content/faye/tablet-dev/users-dev.html new file mode 100644 index 000000000..847a25db6 --- /dev/null +++ b/hifi-content/faye/tablet-dev/users-dev.html @@ -0,0 +1,501 @@ + + + + Users Online + + + + + + + +
+
Users Online
+ +
+
+
+

+ +
+ +
+ +
+
+ + +
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/users-friends.html b/hifi-content/faye/tablet-dev/users-friends.html new file mode 100644 index 000000000..42d7de7d3 --- /dev/null +++ b/hifi-content/faye/tablet-dev/users-friends.html @@ -0,0 +1,126 @@ + + + + Users Online + + + + + + +
+
+
Users Online (Friends)
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/users.html b/hifi-content/faye/tablet-dev/users.html new file mode 100644 index 000000000..4089e1ca9 --- /dev/null +++ b/hifi-content/faye/tablet-dev/users.html @@ -0,0 +1,511 @@ + + + + Users Online + + + + + + + +
+
Users Online
+ +
+
+
+

+ +
+ +
+ +
+
+ + +
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/hifi-content/faye/tablet-dev/users.js b/hifi-content/faye/tablet-dev/users.js new file mode 100644 index 000000000..04607c9ae --- /dev/null +++ b/hifi-content/faye/tablet-dev/users.js @@ -0,0 +1,67 @@ +"use strict"; + +// +// users.js +// +// Created by Faye Li on 18 Jan 2017. +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +(function() { // BEGIN LOCAL_SCOPE + var USERS_URL = "https://hifi-content.s3.amazonaws.com/faye/tablet-dev/users.html"; + var FRIENDS_WINDOW_URL = "https://metaverse.highfidelity.com/user/friends"; + var FRIENDS_WINDOW_WIDTH = 290; + var FRIENDS_WINDOW_HEIGHT = 500; + var FRIENDS_WINDOW_TITLE = "Add/Remove Friends"; + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var button = tablet.addButton({ + icon: "icons/tablet-icons/people-i.svg", + text: "Users" + }); + + function onClicked() { + tablet.gotoWebScreen(USERS_URL); + } + + function onWebEventReceived(event) { + print("Script received a web event, its type is " + typeof event); + if (typeof event === "string") { + event = JSON.parse(event); + } + if (event.type === "ready") { + // send username to html + var myUsername = GlobalServices.username; + var object = { + "type": "sendUsername", + "data": {"username": myUsername} + }; + print("sending username: " + myUsername); + tablet.emitScriptEvent(JSON.stringify(object)); + } + if (event.type === "manage-friends") { + // open a web overlay to metaverse friends page + var friendsWindow = new OverlayWebWindow({ + title: FRIENDS_WINDOW_TITLE, + width: FRIENDS_WINDOW_WIDTH, + height: FRIENDS_WINDOW_HEIGHT, + visible: false + }); + friendsWindow.setURL(FRIENDS_WINDOW_URL); + friendsWindow.setVisible(true); + friendsWindow.raise(); + } + } + + button.clicked.connect(onClicked); + tablet.webEventReceived.connect(onWebEventReceived); + + function cleanup() { + button.clicked.disconnect(onClicked); + tablet.removeButton(button); + } + + Script.scriptEnding.connect(cleanup); +}()); // END LOCAL_SCOPE diff --git a/hifi-content/faye/tablet-sample-app/quick_start_template.html b/hifi-content/faye/tablet-sample-app/quick_start_template.html new file mode 100644 index 000000000..a7b108a51 --- /dev/null +++ b/hifi-content/faye/tablet-sample-app/quick_start_template.html @@ -0,0 +1,141 @@ + + + + HiFi Tablet App Quick Start Template + + + + + + +
+

HiFi Tablet Sample App

+
+
+

Hello World!

+

Just a template for you to get started with making apps for High Fidelity's Social VR platform. Here's a background, top header bar, font, and some buttons styled and ready for you to use. You may also create your own elements just as you would writing a HTML/CSS/JS web application. Enjoy!

+

+

+

+

+
+ + + + + \ No newline at end of file diff --git a/hifi-content/faye/tiltbrush-exports/Cupcake.fbx b/hifi-content/faye/tiltbrush-exports/Cupcake.fbx new file mode 100644 index 000000000..6ff36be40 --- /dev/null +++ b/hifi-content/faye/tiltbrush-exports/Cupcake.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d20785b0e7a612174d3c27e9b21f39b27372ebc27743af35c91e51bf7bc3dc35 +size 769968 diff --git a/hifi-content/faye/tiltbrush-exports/Untitled_1.fbx b/hifi-content/faye/tiltbrush-exports/Untitled_1.fbx new file mode 100644 index 000000000..b0c241cda --- /dev/null +++ b/hifi-content/faye/tiltbrush-exports/Untitled_1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7c6c2d05a48e6479ab9a2848f1a6ba6a11fe10208f67f4f0cd5e772f775394d +size 628928 diff --git a/hifi-content/faye/tiltbrush-palette/Untitled_2.fbx b/hifi-content/faye/tiltbrush-palette/Untitled_2.fbx new file mode 100644 index 000000000..a0df7cfe4 --- /dev/null +++ b/hifi-content/faye/tiltbrush-palette/Untitled_2.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe5c00b17913efe354a9003d7e1927e04db10bc10ab1574cad92f7e583fb135d +size 785600 diff --git a/hifi-content/faye/tiltbrush-palette/Untitled_3.fbx b/hifi-content/faye/tiltbrush-palette/Untitled_3.fbx new file mode 100644 index 000000000..a8cf7590f --- /dev/null +++ b/hifi-content/faye/tiltbrush-palette/Untitled_3.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efede85e830338ce617672bbab6bb381998a332f1ff0c270874da4882f4b24e0 +size 283744 diff --git a/hifi-content/faye/tiltbrush-palette/Untitled_4.fbx b/hifi-content/faye/tiltbrush-palette/Untitled_4.fbx new file mode 100644 index 000000000..808e614e7 --- /dev/null +++ b/hifi-content/faye/tiltbrush-palette/Untitled_4.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce1e525f665e7d5e3d4a6e412fb2fc165c934710e3ca3fddd2253bb48d71bd16 +size 639456 diff --git a/hifi-content/faye/twitch-stream/selfie_stick.json b/hifi-content/faye/twitch-stream/selfie_stick.json new file mode 100644 index 000000000..2d2ec8874 --- /dev/null +++ b/hifi-content/faye/twitch-stream/selfie_stick.json @@ -0,0 +1,78 @@ +{ + "Entities": [ + { + "collisionless": 1, + "clientOnly": 0, + "color": { + "blue": 0, + "green": 0, + "red": 255 + }, + "created": "2017-03-23T23:06:37Z", + "dimensions": { + "x": 0.20000000298023224, + "y": 0.20000000298023224, + "z": 0.20000000298023224 + }, + "id": "{328bc4ee-14cd-4af3-be90-b862605d629b}", + "lastEdited": 1490310483257291, + "lastEditedBy": "{04ec859a-833f-4250-a0c0-b9941a2d7bab}", + "name": "Lens", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{89d5e848-c061-4a6f-af38-2f676e626146}", + "position": { + "x": 0.03299405425786972, + "y": 0.40769273042678833, + "z": -0.07277381420135498 + }, + "queryAACube": { + "scale": 1.0392304658889771, + "x": -3.5974750518798828, + "y": 0.6147046685218811, + "z": -11.749179840087891 + }, + "rotation": { + "w": 0.99704545736312866, + "x": -1.404390513926046e-05, + "y": -0.076680481433868408, + "z": -1.6383542970288545e-05 + }, + "shape": "Cube", + "type": "Box", + "visible": 0 + }, + { + "clientOnly": 0, + "collisionless": 1, + "created": "2017-03-23T23:04:26Z", + "dimensions": { + "x": 0.04817185178399086, + "y": 0.49896085262298584, + "z": 0.048171848058700562 + }, + "id": "{89d5e848-c061-4a6f-af38-2f676e626146}", + "ignoreForCollisions": 1, + "lastEdited": 1490310501158161, + "lastEditedBy": "{94fde986-bc75-4a6c-9ba9-15e079352ac7}", + "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Camera-Handle.fbx", + "name": "Selfie Stick", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "queryAACube": { + "scale": 0.50359010696411133, + "x": -0.25179505348205566, + "y": -0.25179505348205566, + "z": -0.25179505348205566 + }, + "rotation": { + "w": 0.99705344438552856, + "x": 0, + "y": 0.076665788888931274, + "z": 0 + }, + "shapeType": "static-mesh", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true}}" + } + ], + "Version": 68 +} diff --git a/hifi-content/faye/twitch-stream/twitch_cam.json b/hifi-content/faye/twitch-stream/twitch_cam.json new file mode 100644 index 000000000..13c2c55b0 --- /dev/null +++ b/hifi-content/faye/twitch-stream/twitch_cam.json @@ -0,0 +1,85 @@ +{ + "Entities": [ + { + "clientOnly": 0, + "collisionless": 1, + "color": { + "blue": 149, + "green": 245, + "red": 245 + }, + "created": "2016-12-30T22:07:27Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.0099999997764825821 + }, + "id": "{6ac0f1ea-c1c3-4b75-b7ff-3b83550e3a98}", + "ignoreForCollisions": 1, + "lastEdited": 1483135964306817, + "lastEditedBy": "{d0af913a-89e3-45eb-934c-86d4263ce041}", + "name": "Twitch Cam Lens", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "parentID": "{b14e48a1-6006-4b39-aba5-c2fa48dae12d}", + "position": { + "x": -0.021826073527336121, + "y": -0.25215768814086914, + "z": 0.1746944934129715 + }, + "queryAACube": { + "scale": 0.2142428457736969, + "x": 6.3083634376525879, + "y": -0.02437220886349678, + "z": -33.110965728759766 + }, + "rotation": { + "w": -1.5245474060066044e-05, + "x": -1.52587890625e-05, + "y": 1.000053882598877, + "z": -1.5259953215718269e-05 + }, + "shape": "Cube", + "type": "Box", + "visible": 0 + }, + { + "clientOnly": 0, + "collisionless": 1, + "created": "2016-12-30T22:07:27Z", + "dimensions": { + "x": 0.43360000848770142, + "y": 0.65679997205734253, + "z": 0.42155000567436218 + }, + "gravity": { + "x": 0, + "y": -9, + "z": 0 + }, + "id": "{b14e48a1-6006-4b39-aba5-c2fa48dae12d}", + "ignoreForCollisions": 1, + "lastEdited": 1483135954595970, + "lastEditedBy": "{d0af913a-89e3-45eb-934c-86d4263ce041}", + "modelURL": "http://hifi-content.s3.amazonaws.com/caitlyn/production/lazybonesToybox/cameras/35mm%20camera.fbx?232222", + "name": "Twitch Cam", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "queryAACube": { + "scale": 0.89280432462692261, + "x": -0.4464021623134613, + "y": -0.4464021623134613, + "z": -0.4464021623134613 + }, + "rotation": { + "w": -0.99176013469696045, + "x": 0.0021514892578125, + "y": -0.12660408020019531, + "z": 0.020798087120056152 + }, + "scriptTimestamp": 1479509304846, + "shapeType": "simple-hull", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"wearable\":{\"joints\":{\"LeftHand\":[{\"x\":-0.23937,\"y\":0.334177,\"z\":0.150116},{\"x\":-0.31183,\"y\":0.535888,\"z\":-0.37311,\"w\":-0.69021}],\"RightHand\":[{\"x\":0.11031082272529602,\"y\":0.19449540972709656,\"z\":0.0405043363571167},{\"x\":0.2807741165161133,\"y\":0.6332069635391235,\"z\":0.2997693121433258,\"w\":-0.6557632088661194}]}}}" + } + ], + "Version": 65 +} diff --git a/hifi-content/faye/vrhackathonsf/assets/potion_bottle.fbx b/hifi-content/faye/vrhackathonsf/assets/potion_bottle.fbx new file mode 100644 index 000000000..2e4e52067 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/assets/potion_bottle.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3efd998517cfb05deb360d9e65ae1cb57944a9bf74f0512518ee7f4229e29121 +size 30144 diff --git a/hifi-content/faye/vrhackathonsf/bs.js b/hifi-content/faye/vrhackathonsf/bs.js new file mode 100644 index 000000000..a0448a085 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/bs.js @@ -0,0 +1 @@ +(function() {}()); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/elevatarLeverEntityScript.js b/hifi-content/faye/vrhackathonsf/elevatarLeverEntityScript.js new file mode 100644 index 000000000..4d1f81735 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/elevatarLeverEntityScript.js @@ -0,0 +1,190 @@ +// +// elevatorLeverEntityScript.js +// +// Created by Faye Li on December 3, 2016 +// + +(function() { + var TOGGLE_SOUND_URL = "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp_switch_2.wav"; + var leverChannel = "Lever-Channel"; + var SEARCH_RADIUS = 100; + + var _this; + + Lever = function() { + _this = this; + }; + + Lever.prototype = { + preload: function(entityID) { + this.entityID = entityID; + this.props = Entites.getEntityProperties(this.entityID); + this.position = this.props.position; + this.toggleSound = SoundCache.getSound(TOGGLE_SOUND_URL); + + setEntityCustomData('grabbableKey', this.entityID, { + wantsTrigger: true + }); + + }, + + toggle: function() { + print("lever toggle") + print(JSON.stringify(this.position)); + + // plays audio with audio injector + Audio.playSound(_this.toggleSound, { + volume: 0.5, + position: this.position + }); + + // TODO: animates lever + }, + + clickReleaseOnEntity: function(entityID, mouseEvent) { + if (!mouseEvent.isLeftButton) { + return; + } + this.toggle(); + }, + + startNearTrigger: function() { + this.toggle(); + }, + + // getLights: function() { + // print('getting lights') + // var props = Entities.getEntityProperties(_this.entityID); + // //track is parent of switch and fixtures. lamps are children of fixtures. + // var childrenOfTrack = Entities.getChildrenIDs(props.parentID); + // print('getting lights2 ') + // //dont count us since we're a switch + // var fixtures = childrenOfTrack.filter(function(item) { + // return item !== props.id + // }); + + // _this.fixtures = fixtures; + + // print('fixtures' + fixtures) + + // var lights = []; + + // fixtures.forEach(function(fixture) { + + // //now we got the light, just one child but it comes back as an array + // var results = Entities.getChildrenIDs(fixture); + // results.forEach(function(result) { + // lights.push(result); + // }); + // }); + + // return lights; + + // }, + + // masterLightOn: function(masterLight) { + // _this.lights = _this.getLights(); + + + // _this.fixtures.forEach(function(fixture) { + // var data = { + // "Tex.light-off": "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp1.fbx/justlamp.fbm/bulb-tex-off.jpg", + // "Tex.light.on": "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp1.fbx/justlamp.fbm/bulb-tex-on.jpg", + // "Texture": "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp1.fbx/justlamp.fbm/bulb-tex-on.jpg" + // }; + // Entities.editEntity(fixture, { + // textures: JSON.stringify(data) + // }) + // print('fixture on') + // }); + + // print('lights? on ' + _this.lights) + // _this.lights.forEach(function(light) { + // Entities.editEntity(light, { + // visible: true + // }); + // }); + // }, + + // masterLightOff: function(masterLight) { + // _this.lights = _this.getLights(); + + // _this.fixtures.forEach(function(fixture) { + // var data = { + // "Tex.light-off": "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp1.fbx/justlamp.fbm/bulb-tex-off.jpg", + // "Tex.light.on": "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp1.fbx/justlamp.fbm/bulb-tex-off.jpg", + // "Texture": "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp1.fbx/justlamp.fbm/bulb-tex-off.jpg" + // }; + + // Entities.editEntity(fixture, { + // textures: JSON.stringify(data) + // }) + // print('turned a fixture off') + // }); + + + + // print('lights? off ' + _this.lights) + // _this.lights.forEach(function(light) { + // Entities.editEntity(light, { + // visible: false + // }); + // }); + // }, + + // toggleLock: function() { + + // print('toggle lock') + + // _this._switch = getEntityCustomData('home-switch', _this.entityID, { + // state: 'off' + // }); + + // if (this._switch.state === 'off') { + + // _this.masterLightOn(); + + // setEntityCustomData('home-switch', _this.entityID, { + // state: 'on' + // }); + + // Entities.editEntity(this.entityID, { + // "animation": { + // "currentFrame": 1, + // "firstFrame": 1, + // "hold": 1, + // "lastFrame": 2, + // "url": "http://hifi-content.s3.amazonaws.com/james/tracklight/lightswitch.fbx" + // }, + // }); + + // } else { + + // _this.masterLightOff(); + + // setEntityCustomData('home-switch', _this.entityID, { + // state: 'off' + // }); + + // Entities.editEntity(_this.entityID, { + // "animation": { + // "currentFrame": 3, + // "firstFrame": 3, + // "hold": 1, + // "lastFrame": 4, + // "url": "http://hifi-content.s3.amazonaws.com/james/tracklight/lightswitch.fbx" + // }, + // }); + // } + + // _this.position = Entities.getEntityProperties(_this.entityID, "position").position; + // Audio.playSound(_this.switchSound, { + // volume: 0.5, + // position: _this.position + // }); + + // }, + }; + + return new Lever(); +}); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/gateLockEntityScript.js b/hifi-content/faye/vrhackathonsf/gateLockEntityScript.js new file mode 100644 index 000000000..c10d95c91 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/gateLockEntityScript.js @@ -0,0 +1,33 @@ +// +// gateLockEntityScript.js +// +// Created by Faye Li on December 3, 2016 +// + +(function() { + var gateLockToMainChannel = "Gate-Lock-To-Main-Channel"; + var utilitiesScript = Script.resolvePath('http://hifi-content.s3.amazonaws.com/james/tracklight/utils.js'); + Script.include(utilitiesScript); + + function unlockGate() { + print("gate lock sending message"); + Messages.sendMessage(gateLockToMainChannel, "pls unlock gate"); + } + + this.preload = function(entityID) { + setEntityCustomData('grabbableKey', entityID, { + wantsTrigger: true + }); + } + + this.clickReleaseOnEntity = function(entityID, mouseEvent) { + if (!mouseEvent.isLeftButton) { + return; + } + unlockGate(); + }; + + this.startNearTrigger = function() { + unlockGate(); + }; +}); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/leverAreaEntityScript.js b/hifi-content/faye/vrhackathonsf/leverAreaEntityScript.js new file mode 100644 index 000000000..57115ab7e --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/leverAreaEntityScript.js @@ -0,0 +1,17 @@ +// +// leverAreaEntityScript.js +// +// Created by Faye Li on December 3, 2016 +// + +(function() { + var leverAreatoMainChannel = "Lever-Area-To-Main-Channel"; + this.enterEntity = function(entityID) { + print("enter lever area entity"); + }; + this.leaveEntity = function(entityID) { + print("leave lever area entity"); + var message = "yay"; + Messages.sendMessage(leverAreatoMainChannel, message); + }; +}); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/leverEntityScript.js b/hifi-content/faye/vrhackathonsf/leverEntityScript.js new file mode 100644 index 000000000..a989ef857 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/leverEntityScript.js @@ -0,0 +1,106 @@ +// +// leverEntityScript.js +// +// Created by Faye Li on December 3, 2016 +// + +(function() { + var utilitiesScript = Script.resolvePath('http://hifi-content.s3.amazonaws.com/james/tracklight/utils.js'); + Script.include(utilitiesScript); + + var LEVER_ANIMATION_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/jazmin/production/Hackathon/1216/models/lever_with_keys.fbx"; + var TOGGLE_SOUND_URL = "http://hifi-content.s3.amazonaws.com/james/tracklight/lamp_switch_2.wav"; + + var leverToMainChannel = "Lever-To-Main-Channel"; + var mainToLeverChannel = "Main-To-Lever-Channel"; + var SEARCH_RADIUS = 100; + + var _this; + + Lever = function() { + _this = this; + }; + + Lever.prototype = { + preload: function(entityID) { + print("lever preload"); + this.entityID = entityID; + this.props = Entities.getEntityProperties(this.entityID); + this.position = this.props.position; + this.toggleSound = SoundCache.getSound(TOGGLE_SOUND_URL); + + setEntityCustomData('grabbableKey', this.entityID, { + wantsTrigger: true + }); + Messages.subscribe(mainToLeverChannel); + Messages.messageReceived.connect(_this.handleMessages); + }, + + handleMessages: function(channel, message, sender) { + // only run this once on my copy (person running the main program) + if (channel === mainToLeverChannel && sender == MyAvatar.sessionUUID) { + print("lever recieved message from main: " + message); + var currentState = getEntityCustomData('leverState', _this.entityID); + if (message === "toggle lever up" && currentState === "down") { + _this.toggle(); + } + } + }, + + toggle: function() { + print("lever toggle"); + + // plays audio with audio injector + Audio.playSound(_this.toggleSound, { + volume: 0.5, + position: this.position + }); + + // TODO: animates lever + var currentState = getEntityCustomData('leverState', _this.entityID, "up"); + if (currentState === "up") { + setEntityCustomData('leverState', _this.entityID, "down"); + Entities.editEntity(_this.entityID, { + "animation": { + "currentFrame": 1, + "firstFrame": 1, + "hold": 1, + "lastFrame": 2, + "url": LEVER_ANIMATION_URL + }, + }); + Messages.sendMessage(leverToMainChannel, "show key"); + } else if (currentState === "down") { + setEntityCustomData('leverState', _this.entityID, "up"); + Entities.editEntity(_this.entityID, { + "animation": { + "currentFrame": 3, + "firstFrame": 3, + "hold": 1, + "lastFrame": 4, + "url": LEVER_ANIMATION_URL + }, + }); + Messages.sendMessage(leverToMainChannel, "hide key"); + } + }, + + clickReleaseOnEntity: function(entityID, mouseEvent) { + if (!mouseEvent.isLeftButton) { + return; + } + this.toggle(); + }, + + startNearTrigger: function() { + this.toggle(); + }, + unload: function() { + print("lever unload"); + Messages.unsubscribe(mainToLeverChannel); + Messages.messageReceived.disconnect(_this.handleMessages); + } + }; + + return new Lever(); +}); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/magicBoxEntityScript.js b/hifi-content/faye/vrhackathonsf/magicBoxEntityScript.js new file mode 100644 index 000000000..1a7e0299d --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/magicBoxEntityScript.js @@ -0,0 +1,31 @@ +// +// magicBoxEntityScript.js +// +// Created by Faye Li on December 3, 2016 +// + +(function() { + var spellToMagicBoxChannel = "Spell-To-Magic-Box-Channel"; + + function scaleAvatar() { + for (var i = 0; i < 5; i++){ + MyAvatar.decreaseSize(); + } + } + + function handleMessages(channel, message, sender) { + // only make other avatars other than me small + if (channel === spellToMagicBoxChannel && sender !== MyAvatar.sessionUUID) { + scaleAvatar(); + } + } + + this.preload = function(entityID) { + Messages.subscribe(spellToMagicBoxChannel); + Messages.messageReceived.connect(handleMessages); + }; + this.unload = function(entityID) { + MyAvatar.resetSize(); + Messages.messageReceived.disconnect(handleMessages); + } +}); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/potionBottleEntityScript.js b/hifi-content/faye/vrhackathonsf/potionBottleEntityScript.js new file mode 100644 index 000000000..1f5812c56 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/potionBottleEntityScript.js @@ -0,0 +1,40 @@ +// +// potionBottleEntityScript.js +// +// Created by Faye Li on December 3, 2016 +// + +(function() { + function showDrinkingFx () { + print("show drinking fx"); + //TODO: Particle fx + + //TODO: Audio fx + } + + function enableGestureRecognizer () { + print("enable Gesture Recognizer"); + Settings.setValue("hackathon-spell-enabled", true); + } + + this.preload = function(entityID) { + Settings.setValue("hackathon-spell-enabled", false); + }; + + this.startNearGrab = function(entityId) { + showDrinkingFx(); + enableGestureRecogniser(); + }; + + this.clickReleaseOnEntity = function(entityID, mouseEvent) { + if (!mouseEvent.isLeftButton) { + return; + } + showDrinkingFx(); + enableGestureRecognizer(); + }; + + this.unload = function(entityID) { + Settings.setValue("hackathon-spell-enabled", false); + }; +}); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/speechRecognizerWonder.js b/hifi-content/faye/vrhackathonsf/speechRecognizerWonder.js new file mode 100644 index 000000000..c90ede869 --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/speechRecognizerWonder.js @@ -0,0 +1,15 @@ +(function() { + var SECRET_COMMAND = "WONDER"; + var speechToMainChannel ="Speech-To-Main-Channel"; + SpeechRecognizer.addCommand(SECRET_COMMAND); + SpeechRecognizer.commandRecognized.connect(function(command){ + if (command === SECRET_COMMAND) { + print("I hear you!"); + Messages.sendMessage(speechToMainChannel, "wonder"); + } + }); + function cleanup () { + SpeechRecognizer.removeCommand(SECRET_COMMAND); + } + Script.scriptEnding.connect(cleanup); +}()); \ No newline at end of file diff --git a/hifi-content/faye/vrhackathonsf/spell.js b/hifi-content/faye/vrhackathonsf/spell.js new file mode 100644 index 000000000..c6cb58efc --- /dev/null +++ b/hifi-content/faye/vrhackathonsf/spell.js @@ -0,0 +1,28 @@ +(function() { + var enabled = false; + var spellToMagicBoxChannel = "Spell-To-Magic-Box-Channel"; + var MAGICBOX_SCRIPT_URL = "https://hifi-content.s3.amazonaws.com/faye/vrhackathonsf/magicBoxEntityScript.js"; + var magicBoxID; + enabled = Settings.getValue("hackathon-spell-enabled"); + if (enabled) { + print("creating magic box"); + var pos = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation()))) + var props = { + name: "Magic-Box", + type: "Box", + position: pos, + script: MAGICBOX_SCRIPT_URL + } + magicBoxID = Entities.addEntity(props); + + // set a bit of delay so that entity server have time to do its thing + Script.setTimeout(function() { + Messages.sendMessage(spellToMagicBoxChannel, "NOT griefing"); + }, 100); + + Script.setTimeout(function() { + Entities.deleteEntity(magicBoxID); + }, 30000); //reset the other avatar to default size afer waiting for 30 seconds + } + +}()); \ No newline at end of file