More files

This commit is contained in:
Dale Glass 2022-02-13 23:26:00 +01:00
parent 82832e6da8
commit 001a5d68da
82 changed files with 5031 additions and 0 deletions

BIN
hifi-content/faye/ZBL_lexx01_door_door.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_door_frame.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_floor.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_roof.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_wall_Tsplit.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_wall_aperture.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_wall_corner.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_wall_portal.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_wall_roof_triangle.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_wall_straight.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/ZBL_lexx01_window.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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);
};
});

View file

@ -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

Binary file not shown.

View file

@ -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();
});

View file

@ -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);
}
};
})

BIN
hifi-content/faye/earth.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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);

BIN
hifi-content/faye/frontflip/frontFlip.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/fst/butterflyAvatar.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g><g><path fill="#ffffff" d="M21.93,37.62l-7.22,25.29l7.23-25.28L21.93,37.62z"/><path d="M8.02,73.99c0,0.02,0.011,0.029,0.011,0.04c0.029,0.05,0.06,0.09,0.1,0.14C8.09,74.12,8.05,74.06,8.02,73.99z M21.93,37.62l-7.22,25.29l7.23-25.28L21.93,37.62z"/></g><g><path d="M81.05,33.52v0.01l7.2-5.4v-0.01L81.05,33.52z"/></g><g><path fill="#ffffff" d="M81.05,33.52v0.01l7.2-5.4v-0.01L81.05,33.52z"/><path d="M92.24,23.92c-0.01-0.06-0.021-0.12-0.03-0.18c-0.02-0.11-0.05-0.21-0.09-0.31c-0.021-0.07-0.05-0.13-0.08-0.19 c-0.04-0.09-0.09-0.17-0.15-0.25c-0.04-0.07-0.09-0.13-0.149-0.19c-0.05-0.06-0.11-0.12-0.181-0.18 c-0.119-0.11-0.27-0.2-0.42-0.28L50.9,2.22C50.87,2.2,50.84,2.19,50.81,2.18c-0.029-0.02-0.06-0.03-0.079-0.04 c-0.021-0.01-0.04-0.01-0.061-0.02c-0.03-0.01-0.06-0.02-0.09-0.03c-0.04-0.02-0.08-0.02-0.12-0.03 c-0.02-0.01-0.05-0.02-0.08-0.02c0,0-0.01,0-0.02,0C50.24,2.01,50.12,2,50,2s-0.24,0.01-0.36,0.04c-0.01,0-0.01,0-0.02,0 c-0.03,0-0.05,0.01-0.08,0.02c-0.04,0.01-0.08,0.01-0.12,0.03c-0.03,0.01-0.06,0.02-0.09,0.03c-0.021,0.01-0.04,0.01-0.061,0.02 c-0.029,0.01-0.06,0.02-0.079,0.04c-0.03,0.01-0.051,0.02-0.08,0.03L49.1,2.22L8.86,22.34c-0.15,0.08-0.301,0.17-0.42,0.28 C8.37,22.68,8.31,22.74,8.26,22.8C8.2,22.86,8.15,22.92,8.11,22.99C8.05,23.07,8,23.15,7.96,23.24c-0.03,0.06-0.06,0.12-0.08,0.19 c-0.04,0.1-0.07,0.2-0.09,0.31c-0.01,0.06-0.021,0.12-0.03,0.18c-0.01,0.07-0.01,0.13-0.01,0.2V73c0,0.09,0.01,0.19,0.02,0.28 c0,0.01,0,0.01,0,0.02c0.011,0.061,0.021,0.11,0.04,0.16c0,0.021,0,0.04,0.011,0.06c0,0.021,0.01,0.03,0.01,0.04 c0.02,0.07,0.05,0.141,0.08,0.21c0,0.021,0.01,0.04,0.02,0.051c0.011,0.04,0.03,0.069,0.051,0.1C7.99,73.95,8,73.97,8.02,73.99 c0.03,0.069,0.07,0.13,0.11,0.18c0.101,0.15,0.23,0.28,0.37,0.39c0.06,0.051,0.12,0.091,0.18,0.12 c0.051,0.04,0.101,0.07,0.16,0.101c0.01,0.01,0.01,0.01,0.021,0.01L49,97.73l0.01,0.01C49.32,97.91,49.66,98,50,98 c0.35,0,0.69-0.09,1-0.27l40.14-22.94c0.15-0.07,0.301-0.17,0.42-0.28c0.07-0.06,0.141-0.13,0.2-0.2 c0.05-0.05,0.09-0.109,0.13-0.17c0.021-0.02,0.03-0.04,0.051-0.069c0.02-0.03,0.029-0.051,0.04-0.08 c0.029-0.05,0.06-0.11,0.09-0.17c0.05-0.11,0.09-0.221,0.12-0.34c0.02-0.07,0.029-0.141,0.04-0.211c0.01-0.09,0.02-0.18,0.02-0.27 V24.12C92.25,24.05,92.25,23.99,92.24,23.92z M86.45,24.47l-7.51,5.64L60.13,11.3L86.45,24.47z M50,6.83l23.92,23.92H26.08 L50,6.83z M39.87,11.3l-18.8,18.81l-7.521-5.64L39.87,11.3z M11.75,28.12l7.2,5.4v0.01l-7.2,25.19V28.12z M14.71,62.91l7.22-25.29 l0.011,0.01L46.02,76.16L12.3,71.34L14.71,62.91z M48,92.55L19.84,76.46L48,80.48V92.55z M50,74.97L37.09,54.32L24.86,34.75H75.14 L50,74.97z M52,92.55V80.48l28.16-4.021L52,92.55z M53.98,76.16L78.06,37.63l8.03,28.09l1.61,5.62L53.98,76.16z M88.25,58.72 l-7.2-25.19v-0.01l7.2-5.4V58.72z"/></g><g><path d="M11.75,28.12v0.01l7.2,5.39L11.75,28.12z"/></g><g><path fill="#000000" d="M11.75,28.12v0.01l7.2,5.39L11.75,28.12z"/><path d="M8.02,73.99C8,73.97,7.99,73.95,7.98,73.92c0.01,0.04,0.029,0.07,0.05,0.11c0.029,0.05,0.06,0.09,0.1,0.14 C8.09,74.12,8.05,74.06,8.02,73.99z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -0,0 +1 @@
../../samuel/gemstone.html

View file

@ -0,0 +1,140 @@
<!--
// gemstoneMagicMaker.html
//
// 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
-->
<html>
<head>
<title>Gemstone Magic Maker</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
}
.content {
margin-top: 90px;
padding: 30px;
}
input[type=button] {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 6px;
border-radius: 5px;
border: none;
color: #fff;
background-color: #000;
background: linear-gradient(#343434 20%, #000 100%);
cursor: pointer;
}
input[type=button].red {
color: #fff;
background-color: #94132e;
background: linear-gradient(#d42043 20%, #94132e 100%);
}
input[type=button].blue {
color: #fff;
background-color: #1080b8;
background: linear-gradient(#00b4ef 20%, #1080b8 100%);
}
input[type=button].white {
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
}
input[type=button]:enabled:hover {
background: linear-gradient(#000, #000);
border: none;
}
input[type=button].red:enabled:hover {
background: linear-gradient(#d42043, #d42043);
border: none;
}
input[type=button].blue:enabled:hover {
background: linear-gradient(#00b4ef, #00b4ef);
border: none;
}
input[type=button].white:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
input[type=button]:active {
background: linear-gradient(#343434, #343434);
}
input[type=button].red:active {
background: linear-gradient(#94132e, #94132e);
}
input[type=button].blue:active {
background: linear-gradient(#1080b8, #1080b8);
}
input[type=button].white:active {
background: linear-gradient(#afafaf, #afafaf);
}
input[type=button]:disabled {
color: #252525;
background: linear-gradient(#575757 20%, #252525 100%);
}
input[type=button][pressed=pressed] {
color: #00b4ef;
}
</style>
</head>
<body>
<div class="top-bar">
<h4>Gemstone Magic Maker</h4>
</div>
<div class="content">
<p>Pick a gemstone from our curated collection:<p>
<p><input type="button" value="Gemstone 1"></p>
<p><input type="button" class="white" value="Gemstone 2"></p>
<p><input type="button" class="red" value="Gemstone 3"></p>
<p><input type="button" class="blue" value="Gemstone 4"></p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
function main() {
console.log("ready");
}
$(document).ready(main);
</script>
</body>
</html>

View file

@ -0,0 +1,5 @@
(function() {
for (var i = 0; i < 5; i++){
MyAvatar.increaseSize();
}
}());

View file

@ -0,0 +1,3 @@
(function() {
Menu.setIsOptionChecked("Mute Microphone", !Menu.isOptionChecked("Mute Microphone"));
}());

View file

@ -0,0 +1,3 @@
(function() {
Users.toggleIgnoreRadius();
}());

View file

@ -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
}

View file

@ -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
}

View file

@ -0,0 +1,152 @@
<html>
<head>
<title>Photo Booth</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="../../../../../system/html/css/edit-style.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/9.7.2/css/bootstrap-slider.min.css">
<style>
body {
margin: 0;
padding: 0;
width: 100%;
color: white;
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-family: Raleway-Bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
font-size: 16px;
}
.content {
margin-top: 90px;
padding: 30px;
}
.slider {
margin-left: 70px;
}
#camera-toggle {
font-family: Raleway-Bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 0px;
border-radius: 5px;
border: none;
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
cursor: pointer;
}
.dropdown li {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="top-bar">
<div>Photobooth</div>
</div>
<div class="content">
<div id="properties-list">
<div class="property url refresh">
<label>Model URL</label>
<input type="text" id="model-url"></input>
<input type="button" id="reload-model-button" class="glyph" value="F">
</div>
<div class="property">
<label>Rotate Model</label>
<input
id="rotate-slider"
type="text"
data-provide="slider"
data-slider-ticks="[-180, 0, 180]"
data-slider-ticks-labels='["clockwise", "centre", "anti-clockwise"]'
data-slider-min="-180"
data-slider-max="180"
data-slider-step="1"
data-slider-value="0"
data-slider-tooltip="show"
>
</div>
<div class="property">
<label>Camera</label>
<div class="dropdown">
<button id="camera-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
First Person Camera
<span class="glyphicon glyphicon-menu-down"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li>First Person Camera</li>
<li>Main Camera</li>
<li>Left Camera</li>
<li>Right Camera</li>
</ul>
</div>
</div>
<div class="property">
<input id="picture-button" type="button" class="blue" value="Take Picture">
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/9.7.2/bootstrap-slider.min.js"></script>
<script>
// Helper function to emit web events to photoboothApp.js
function emit(eventType, eventData) {
var eventObject = {
"app": "photobooth",
"type": eventType,
"data": eventData
};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
}
$(document).ready(function() {
// Send a ready event to hifi
emit("ready", null);
// Send an event when camera selection changes
$(".dropdown-menu li").click(function() {
console.log("clicked " + this.textContent);
$("#camera-toggle").text(this.textContent + " ");
$("#camera-toggle").append("<span class='glyphicon glyphicon-menu-down'></span>");
emit("onSelectCamera", {value: this.textContent});
});
// Send an event to hifi to trigger snapshot
$("#picture-button").click(function() {
emit("onClickPictureButton", null);
});
// Send an event to hifi for loading the given model URL
$("#reload-model-button").click(function() {
emit("onClickReloadModelButton", {value: $("#model-url").val()});
});
$("#rotate-slider").slider().on("slide", function(e){
console.log("slided " + e.value);
emit("onRotateSlider", {value: e.value});
});
});
</script>
</body>
</html>

View file

@ -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

BIN
hifi-content/faye/plp/assets/arrow.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/plp/assets/mini-cooper.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/plp/assets/mini-cooper_1.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/plp/assets/original-wheel.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/plp/assets/plain-ring.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/plp/assets/volkeswagon-vw-beetle.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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
}

View file

@ -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();
});

View file

@ -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();
});

View file

@ -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();
});

View file

@ -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();
});

BIN
hifi-content/faye/rug.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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);
}
};
});

View file

@ -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

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -0,0 +1 @@
avatar7.fs

View file

@ -0,0 +1,3 @@
void main() {
gl_FragColor = vec4(0.4,0.4,0.8,1.0);
}

View file

@ -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;
}

View file

@ -0,0 +1,5 @@
const vec3 COLOR = vec3(255.0, 175.0, 230.0) / 255.0;
void main() {
gl_FragColor = vec4(COLOR, 1.0);
}

BIN
hifi-content/faye/sliderTest.zip (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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);
};
});

View file

@ -0,0 +1,91 @@
<!--
// eventBridgeTest.html
//
// 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
-->
<html>
<head>
<title>Event Bridge Test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
width: 100%;
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
}
.top-bar .container {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 30px;
margin-right: 30px;
height: 100%;
}
#refresh-button {
width: 24px;
height: 24px;
}
.main {
padding: 30px;
}
#users-list div {
padding-top: 4px;
padding-bottom: 4px;
}
</style>
</head>
<body>
<div class="top-bar">
<div class="container">
<div>Event Bridge Test</div>
</div>
</div>
<div class="main">
<div id="dev-div"></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
function onScriptEventReceived(event) {
$("#dev-div").append("<p>Received a script event, its type is " + typeof event + "</p>");
if (typeof event === "object") {
$("#dev-div").append("<p> The object is: " + JSON.stringify(event) + "<p>");
}
if (typeof event === "string") {
$("#dev-div").append("<p> The string is: " + event + "</p>");
}
}
$(document).ready(function() {
console.log("eventBridgeTest.html ready");
$("#dev-div").append("<p>ready</p>");
// Listen for events from hifi
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
// Send two ready events to hifi, one as string, another as object
var eventObject = {"data": "readyEventObject"};
EventBridge.emitWebEvent(eventObject);
var eventString = "readyEventString";
EventBridge.emitWebEvent(eventString);
});
</script>
</body>
</html>

View file

@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 128 128" height="128px" id="Layer_1" version="1.1" viewBox="0 0 128 128" width="128px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M18.233,81.666l-0.016,0.003c0.006,0.012,0.01,0.022,0.016,0.036c0.008,0.101,0.026,0.195,0.04,0.293 c0.002,0.017,0,0.029,0.002,0.045l3.929,25.514c0.476,3.098,3.374,5.221,6.47,4.743c3.098-0.476,5.222-3.372,4.746-6.471 l-0.611-3.965c0.712,0.587,1.43,1.169,2.175,1.714c10.106,7.42,23.111,10.987,36.486,8.926c13.372-2.056,24.702-9.37,32.109-19.487 c3.662-4.988,6.353-10.695,7.922-16.793l-15.479-4.262c-1.044,4.191-2.882,8.109-5.405,11.552 c-5.012,6.824-12.566,11.713-21.593,13.105c-9.027,1.388-17.705-1.002-24.536-6.004c-0.841-0.616-1.645-1.282-2.424-1.976 l4.488,0.435c2.872,0.276,5.445-2.025,5.748-5.144c0.3-3.12-1.783-5.873-4.655-6.15l-23.659-2.291 c-2.568-0.248-4.884,1.572-5.564,4.188c-0.05,0.185-0.076,0.374-0.109,0.565c-0.021,0.132-0.061,0.255-0.074,0.39 c-0.004,0.041,0.002,0.077-0.001,0.114c-0.013,0.174-0.004,0.351-0.002,0.528C18.235,81.406,18.224,81.539,18.233,81.666z" fill="#ffffff"/><path d="M109.767,46.334l0.015-0.002c-0.006-0.013-0.01-0.024-0.016-0.037c-0.008-0.1-0.027-0.195-0.04-0.293 c-0.002-0.015,0-0.029-0.002-0.044l-3.928-25.513c-0.477-3.097-3.373-5.221-6.472-4.744c-3.097,0.477-5.221,3.373-4.744,6.47 l0.612,3.967c-0.715-0.587-1.433-1.169-2.177-1.715c-10.106-7.419-23.112-10.989-36.484-8.926 c-13.374,2.055-24.703,9.371-32.109,19.487c-3.664,4.989-6.355,10.696-7.922,16.794l15.479,4.26 c1.042-4.19,2.882-8.108,5.403-11.551c5.012-6.824,12.569-11.712,21.595-13.105c9.027-1.386,17.703,1.002,24.536,6.002 c0.841,0.618,1.645,1.284,2.423,1.976l-4.487-0.434c-2.872-0.278-5.445,2.026-5.747,5.144c-0.303,3.119,1.782,5.873,4.653,6.15 l23.659,2.291c2.568,0.248,4.884-1.572,5.564-4.188c0.05-0.184,0.076-0.374,0.107-0.565c0.022-0.132,0.063-0.255,0.075-0.391 c0.006-0.038-0.003-0.075,0-0.112c0.014-0.175,0.007-0.353,0.003-0.53C109.764,46.595,109.774,46.462,109.767,46.334z" fill="#ffffff"/></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,464 @@
<!--
// users.html
//
// 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
-->
<html>
<head>
<title>Users Online</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
}
#refresh-button {
width: 24px;
height: 24px;
}
.main {
margin-top: 90px;
padding: 30px;
}
#user-info-div {
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 40px;
}
#visibility-toggle {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 0px;
border-radius: 5px;
border: none;
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
cursor: pointer;
}
#visibility-toggle:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
#visibility-toggle:active {
background: linear-gradient(#afafaf, #afafaf);
}
#visibility-toggle span {
padding-left: 10px;
}
.tabs {
list-style: none;
padding: 0;
margin: 0;
}
.tabs li {
display: inline-block;
padding: 10px 15px;
}
.tabs li.current {
background: rgba(255,255,255,0.15);
}
.tab-content {
display: none;
}
.tab-content.current {
display: inherit;
background: rgba(255,255,255,0.15);
}
.tab-content ul {
list-style: none;
padding: 15px 0px 15px 15px;
margin: 0;
}
.tab-content ul li {
padding: 2px 0px;
}
input[type=button] {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 6px;
border-radius: 5px;
border: none;
color: #fff;
background-color: #000;
background: linear-gradient(#343434 20%, #000 100%);
cursor: pointer;
}
input[type=button].red {
color: #fff;
background-color: #94132e;
background: linear-gradient(#d42043 20%, #94132e 100%);
}
input[type=button].blue {
color: #fff;
background-color: #1080b8;
background: linear-gradient(#00b4ef 20%, #1080b8 100%);
}
input[type=button].white {
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
}
input[type=button]:enabled:hover {
background: linear-gradient(#000, #000);
border: none;
}
input[type=button].red:enabled:hover {
background: linear-gradient(#d42043, #d42043);
border: none;
}
input[type=button].blue:enabled:hover {
background: linear-gradient(#00b4ef, #00b4ef);
border: none;
}
input[type=button].white:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
input[type=button]:active {
background: linear-gradient(#343434, #343434);
}
input[type=button].red:active {
background: linear-gradient(#94132e, #94132e);
}
input[type=button].blue:active {
background: linear-gradient(#1080b8, #1080b8);
}
input[type=button].white:active {
background: linear-gradient(#afafaf, #afafaf);
}
input[type=button]:disabled {
color: #252525;
background: linear-gradient(#575757 20%, #252525 100%);
}
input[type=button][pressed=pressed] {
color: #00b4ef;
}
#friends-button {
margin: 0px 0px 15px 10px;
}
/*Vertically Center Modal*/
.modal {
color: black;
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -4px;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.dropdown-menu {
width: 280px;
}
.dropdown-menu li {
color: #333;
padding: 10px;
}
.dropdown-menu .divider {
padding: 0px;
}
.dropdown-menu li:hover {
background: #dcdcdc;
}
.dropdown-menu li h6 {
font-weight: bold;
}
.dropdown-menu li p {
font-size: 11px;
}
</style>
</head>
<body>
<div class="top-bar">
<h4>Users Online</h4>
<img id="refresh-button" onclick="pollUsers()" src="https://hifi-content.s3.amazonaws.com/faye/tablet-dev/refresh-icon.svg"></img>
</div>
<div class="main">
<div id="user-info-div">
<h4></h4>
<div class="dropdown">
<button id="visibility-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Online
<span class="glyphicon glyphicon-menu-down"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="visibility-toggle">
<li class="visibility-option" data-visibility="all">
<h6>Online</h6>
<p>You will be shown online to everyone else. Anybody will be able to find you from the users online list and jump to your current location.</p>
</li>
<li role="separator" class="divider"></li>
<li class="visibility-option" data-visibility="friends">
<h6>Available to Friends Only</h6>
<p>You will be shown online only to users you have added as friends. Other users may still interact with you in the same domain, but they won't be able to find you from the users online list.</p>
</li>
<li role="separator" class="divider"></li>
<li class="visibility-option" data-visibility="none">
<h6>Appear Offline</h6>
<p>No one will be able to find you from the users online list. However, this does not prevent other users in the same domain from interacting with you. For a complete "Do not disturb" mode, you may want to go to your own private domain and set allow entering to no one.</p>
</li>
</ul>
</div>
</div>
<div id="dev-div"></div>
<ul class="tabs">
<li tab-id="tab-1" class="current">Everyone (0)</li>
<li tab-id="tab-2">Friends (0)</li>
</ul>
<div id="tab-1" class="tab-content current">
<ul></ul>
</div>
<div id="tab-2" class="tab-content">
<ul></ul>
<input type="button" class="blue" id="friends-button" value="Add/Remove Friends">
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Jump to username @ Placename</h4>
</div>
<div class="modal-body">
This will teleport you to a new location and possibly another domain. Are you sure?
</div>
<div class="modal-footer">
<input type="button" data-dismiss="modal" value="Cancel">
<input type="button" data-dismiss="modal" id="jump-to-confirm-button" value="OK">
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script>
var METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/v1/users?status=online";
var FRIENDS_FILTER = "&filter=friends";
var myUsername = null;
var myVisibility = null;
function displayUsers(data, element) {
element.empty();
for (var i = 0; i < data.users.length; i++) {
// Don't display users who aren't in a domain
if (typeof data.users[i].location.root.name === "undefined") {
console.log(data.users[i].username + "is online but not in a domain");
$("#dev-div").append("<p>" + data.users[i].username + "is online but not in a domain</p>");
} else {
$("#dev-div").append("<li>" + data.users[i].username + " @ " + data.users[i].location.root.name + "</li>");
if (data.users[i].username === myUsername) {
$("#user-info-div h4").text(data.users[i].username + " @ " + data.users[i].location.root.name);
} else {
console.log(data.users[i].username + " @ " + data.users[i].location.root.name);
// Create a list item and put user info in data-* attributes, also make it trigger the jump to confirmation modal
$("<li></li>", {
"data-toggle": "modal",
"data-target": "#myModal",
"data-username": data.users[i].username,
"data-placename": data.users[i].location.root.name,
text: data.users[i].username + " @ " + data.users[i].location.root.name
}).appendTo(element);
}
}
}
}
function processData(data, type) {
var num = data.users.length;
if (type === "everyone") {
$(".tabs li:nth-child(1)").text("Everyone (" + num + ")");
displayUsers(data, $("#tab-1 ul"));
} else if (type === "friends") {
$(".tabs li:nth-child(2)").text("Friends (" + num + ")");
displayUsers(data, $("#tab-2 ul"));
}
}
function pollUsers() {
$("#dev-div").append("<p>polling users..</p>");
$.ajax({
url: METAVERSE_API_URL,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling everyone sucess</p>");
processData(response.data, "everyone");
}
});
$.ajax({
url: METAVERSE_API_URL + FRIENDS_FILTER,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling friends sucess</p>");
processData(response.data, "friends");
}
});
}
function onScriptEventReceived(event) {
$("#dev-div").append("<p>Received a script event, its type is " + typeof event + "</p>");
if (typeof event === "string") {
// Parse the string into an object
event = JSON.parse(event);
}
if (event.type === "user-info") {
myUsername = event.data.username;
myVisibility = event.data.visibility;
$("#user-info-div h4").text(myUsername);
var buttonText = "Online";
if (myVisibility === "none") {
buttonText = "Appear Offline";
} else if (myVisibility === "friends") {
buttonText = "Available To Friends Only";
}
$("#visibility-toggle").html(buttonText + "<span class='glyphicon glyphicon-menu-down'></span>")
}
}
$(document).ready(function() {
$("#dev-div").append("<p>ready</p>");
// Auto-load user lists when page loads
pollUsers();
// Click listener for tabs
$(".tabs li").click(function() {
var tabID = $(this).attr("tab-id");
$(".tab-content").removeClass("current");
$("#" + tabID).addClass("current");
$(".tabs li").removeClass("current");
$(this).addClass("current");
});
// Jump to user: Fill confirmation modal with data of the selected user
$("#myModal").on("show.bs.modal", function (event) {
// Get the element that triggered the modal
var li = $(event.relatedTarget);
// Extract info from data-* attributes
var username = li.data("username");
var placename = li.data("placename");
// Write info to the modal
var modal = $(this);
modal.find(".modal-title").text("Jump to " + username + " @ " + placename);
$("#jump-to-confirm-button").data("username", username);
})
$("#jump-to-confirm-button").click(function() {
var jumpToObject = {
"type": "jump-to",
"data": {
"username": $(this).data("username")
}
}
EventBridge.emitWebEvent(JSON.stringify(jumpToObject));
});
// Click listener for toggling who can see me
$(".visibility-option").click(function() {
myVisibility = $(this).data("visibility");
var newButtonText = $(this).find("h6").text();
$("#visibility-toggle").html(newButtonText + "<span class='glyphicon glyphicon-menu-down'></span>");
var visibilityObject = {
"type": "toggle-visibility",
"data": {
"visibility": myVisibility
}
}
EventBridge.emitWebEvent(JSON.stringify(visibilityObject));
});
// Listen for events from hifi
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
// Send a ready event to hifi
var eventObject = {"type": "ready"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
// Click listener for add/remove friends button
$("#friends-button").click(function() {
// Send a manage friends event to hifi
eventObject = {"type": "manage-friends"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,501 @@
<!--
// users.html
//
// 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
-->
<html>
<head>
<title>Users Online</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
justify-content: space-between;
}
#refresh-button {
width: 24px;
height: 24px;
}
.main {
padding: 30px;
margin-top: 90px;
}
#user-info-div {
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 40px;
}
#visibility-toggle {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 0px;
border-radius: 5px;
border: none;
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
cursor: pointer;
}
#visibility-toggle:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
#visibility-toggle:active {
background: linear-gradient(#afafaf, #afafaf);
}
#visibility-toggle span {
padding-left: 10px;
}
.tabs {
list-style: none;
padding: 0;
margin: 0;
}
.tabs li {
display: inline-block;
padding: 10px 15px;
}
.tabs li.current {
background: rgba(255,255,255,0.15);
}
.tab-content {
display: none;
}
.tab-content.current {
display: inherit;
background: rgba(255,255,255,0.15);
}
.tab-content ul {
list-style: none;
padding: 15px 0px 15px 15px;
margin: 0;
}
.tab-content ul li {
padding: 2px 0px;
}
input[type=button] {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 6px;
border-radius: 5px;
border: none;
color: #fff;
background-color: #000;
background: linear-gradient(#343434 20%, #000 100%);
cursor: pointer;
}
input[type=button].red {
color: #fff;
background-color: #94132e;
background: linear-gradient(#d42043 20%, #94132e 100%);
}
input[type=button].blue {
color: #fff;
background-color: #1080b8;
background: linear-gradient(#00b4ef 20%, #1080b8 100%);
}
input[type=button].white {
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
}
input[type=button]:enabled:hover {
background: linear-gradient(#000, #000);
border: none;
}
input[type=button].red:enabled:hover {
background: linear-gradient(#d42043, #d42043);
border: none;
}
input[type=button].blue:enabled:hover {
background: linear-gradient(#00b4ef, #00b4ef);
border: none;
}
input[type=button].white:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
input[type=button]:active {
background: linear-gradient(#343434, #343434);
}
input[type=button].red:active {
background: linear-gradient(#94132e, #94132e);
}
input[type=button].blue:active {
background: linear-gradient(#1080b8, #1080b8);
}
input[type=button].white:active {
background: linear-gradient(#afafaf, #afafaf);
}
input[type=button]:disabled {
color: #252525;
background: linear-gradient(#575757 20%, #252525 100%);
}
input[type=button][pressed=pressed] {
color: #00b4ef;
}
#friends-button {
margin: 0px 0px 15px 10px;
}
/*Vertically Center Modal*/
.modal {
color: black;
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -4px;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.dropdown-menu {
width: 350px;
border: 0;
display: block;
float: none;
position: inherit;
}
.dropdown-menu li {
color: #333;
padding: 10px;
}
.dropdown-menu .divider {
padding: 0px;
}
.dropdown-menu li:hover {
background: #dcdcdc;
}
.dropdown-menu li h5 {
font-weight: bold;
}
.dropdown-menu li p {
font-size: 14px;
}
</style>
</head>
<body>
<div class="top-bar">
<div>Users Online</div>
<img id="refresh-button" onclick="pollUsers()" src="https://hifi-content.s3.amazonaws.com/faye/tablet-dev/refresh-icon.svg"></img>
</div>
<div class="main">
<div id="user-info-div">
<h4></h4>
<button id="visibility-toggle" data-toggle="modal" data-target="#myModal2" aria-haspopup="true" aria-expanded="false">
Online
<span class="glyphicon glyphicon-menu-down"></span>
</button>
</div>
<ul class="tabs">
<li tab-id="tab-1" class="current">Everyone (0)</li>
<li tab-id="tab-2">Friends (0)</li>
</ul>
<div id="tab-1" class="tab-content current">
<ul></ul>
</div>
<div id="tab-2" class="tab-content">
<ul></ul>
<input type="button" class="blue" id="friends-button" value="Add/Remove Friends">
</div>
</div>
<!-- Modal for jump to-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Jump to username @ Placename</h4>
</div>
<div class="modal-body">
This will teleport you to a new location and possibly another domain. Are you sure?
</div>
<div class="modal-footer">
<input type="button" data-dismiss="modal" value="Cancel">
<input type="button" data-dismiss="modal" id="jump-to-confirm-button" value="OK">
</div>
</div>
</div>
</div>
<!-- Modal for visibility-->
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Change your visibility setting</h4>
</div>
<div class="modal-body">
<ul class="dropdown-menu" aria-labelledby="visibility-toggle">
<li class="visibility-option" data-visibility="all">
<h5>Online</h5>
<p>You will be shown online to everyone else. Anybody will be able to find you from the users online list and jump to your current location.</p>
</li>
<li role="separator" class="divider"></li>
<li class="visibility-option" data-visibility="friends">
<h5>Available to Friends Only</h5>
<p>You will be shown online only to users you have added as friends. Other users may still interact with you in the same domain, but they won't be able to find you from the users online list.</p>
</li>
<li role="separator" class="divider"></li>
<li class="visibility-option" data-visibility="none">
<h5>Appear Offline</h5>
<p>No one will be able to find you from the users online list. However, this does not prevent other users in the same domain from interacting with you. For a complete "Do not disturb" mode, you may want to go to your own private domain and set allow entering to no one.</p>
</li>
</ul>
</div>
<div class="modal-footer">
<input type="button" data-dismiss="modal" value="OK">
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script>
var METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/v1/users?status=online";
var FRIENDS_FILTER = "&filter=friends";
var myUsername = null;
var myVisibility = null;
function displayUsers(data, element) {
element.empty();
for (var i = 0; i < data.users.length; i++) {
// Don't display users who aren't in a domain
if (typeof data.users[i].location.root.name === "undefined") {
console.log(data.users[i].username + "is online but not in a domain");
$("#dev-div").append("<p>" + data.users[i].username + "is online but not in a domain</p>");
} else {
$("#dev-div").append("<li>" + data.users[i].username + " @ " + data.users[i].location.root.name + "</li>");
if (data.users[i].username === myUsername) {
$("#user-info-div h4").text(data.users[i].username + " @ " + data.users[i].location.root.name);
} else {
console.log(data.users[i].username + " @ " + data.users[i].location.root.name);
// Create a list item and put user info in data-* attributes, also make it trigger the jump to confirmation modal
$("<li></li>", {
"data-toggle": "modal",
"data-target": "#myModal",
"data-username": data.users[i].username,
"data-placename": data.users[i].location.root.name,
text: data.users[i].username + " @ " + data.users[i].location.root.name
}).appendTo(element);
}
}
}
}
function processData(data, type) {
// Filter out yourself from the users list
var removeIndex = data.users.map(function(user) { return user.username }).indexOf(myUsername);
if (removeIndex >= 0) {
data.users.splice(removeIndex,1);
}
// Sort array alphabetically by username
data.users.sort(function(a, b) {
var nameA = a.username.toLowerCase();
var nameB = b.username.toLowerCase();
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
});
var num = data.users.length;
if (type === "everyone") {
$(".tabs li:nth-child(1)").text("Everyone (" + num + ")");
displayUsers(data, $("#tab-1 ul"));
} else if (type === "friends") {
$(".tabs li:nth-child(2)").text("Friends (" + num + ")");
displayUsers(data, $("#tab-2 ul"));
}
}
function pollUsers() {
$("#dev-div").append("<p>polling users..</p>");
$.ajax({
url: METAVERSE_API_URL,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling everyone sucess</p>");
processData(response.data, "everyone");
}
});
$.ajax({
url: METAVERSE_API_URL + FRIENDS_FILTER,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling friends sucess</p>");
processData(response.data, "friends");
}
});
}
function onScriptEventReceived(event) {
$("#dev-div").append("<p>Received a script event, its type is " + typeof event + "</p>");
if (typeof event === "string") {
// Parse the string into an object
event = JSON.parse(event);
}
if (event.type === "user-info") {
myUsername = event.data.username;
myVisibility = event.data.visibility;
$("#user-info-div h4").text(myUsername);
var buttonText = "Online";
if (myVisibility === "none") {
buttonText = "Appear Offline";
} else if (myVisibility === "friends") {
buttonText = "Available To Friends Only";
}
$("#visibility-toggle").html(buttonText + "<span class='glyphicon glyphicon-menu-down'></span>")
}
}
$(document).ready(function() {
$("#dev-div").append("<p>ready</p>");
// Auto-load user lists when page loads
pollUsers();
// Click listener for tabs
$(".tabs li").click(function() {
var tabID = $(this).attr("tab-id");
$(".tab-content").removeClass("current");
$("#" + tabID).addClass("current");
$(".tabs li").removeClass("current");
$(this).addClass("current");
});
// Jump to user: Fill confirmation modal with data of the selected user
$("#myModal").on("show.bs.modal", function (event) {
// Get the element that triggered the modal
var li = $(event.relatedTarget);
// Extract info from data-* attributes
var username = li.data("username");
var placename = li.data("placename");
// Write info to the modal
var modal = $(this);
modal.find(".modal-title").text("Jump to " + username + " @ " + placename);
$("#jump-to-confirm-button").data("username", username);
})
$("#jump-to-confirm-button").click(function() {
var jumpToObject = {
"type": "jump-to",
"data": {
"username": $(this).data("username")
}
}
EventBridge.emitWebEvent(JSON.stringify(jumpToObject));
});
// Click listener for toggling who can see me
$(".visibility-option").click(function() {
myVisibility = $(this).data("visibility");
var newButtonText = $(this).find("h5").text();
$("#visibility-toggle").html(newButtonText + "<span class='glyphicon glyphicon-menu-down'></span>");
var visibilityObject = {
"type": "toggle-visibility",
"data": {
"visibility": myVisibility
}
}
EventBridge.emitWebEvent(JSON.stringify(visibilityObject));
});
// Listen for events from hifi
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
// Send a ready event to hifi
var eventObject = {"type": "ready"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
// Click listener for add/remove friends button
$("#friends-button").click(function() {
// Send a manage friends event to hifi
eventObject = {"type": "manage-friends"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,126 @@
<!--
// users.html
//
// 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
-->
<html>
<head>
<title>Users Online</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
width: 100%;
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
}
.top-bar .container {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 30px;
margin-right: 30px;
height: 100%;
}
#refresh-button {
width: 24px;
height: 24px;
}
.main {
padding: 30px;
}
#users-list div {
padding-top: 4px;
padding-bottom: 4px;
}
</style>
</head>
<body>
<div class="top-bar">
<div class="container">
<div>Users Online (Friends)</div>
<img id="refresh-button" onclick="pollUsers()" src="https://hifi-content.s3.amazonaws.com/faye/tablet-dev/refresh-icon.svg"></img>
</div>
</div>
<div class="main">
<div id="users-list"></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
var METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/v1/users?status=online&filter=friends";
var myUsername = null;
function displayUsers(data) {
$("#users-list").empty();
for (var i = 0; i < data.users.length; i++) {
// Don't display users who aren't in a domain
if (typeof data.users[i].location.root.name === "undefined") {
console.log(data.users[i].username + "is online but not in a domain");
$("#dev-div").append("<p>" + data.users[i].username + "is online but not in a domain</p>");
} else {
$("#dev-div").append("<div>" + data.users[i].username + " @ " + data.users[i].location.root.name + "</div>");
// Don't display yourself
if (data.users[i].username !== myUsername) {
console.log(data.users[i].username + " @ " + data.users[i].location.root.name);
$("#users-list").append("<div>" + data.users[i].username + " @ " + data.users[i].location.root.name + "</div>");
}
}
}
}
function pollUsers() {
// TODO: better transition visual such as spin wheel or loading bar
$("#dev-div").append("<p>polling users..</p>");
$.ajax({
url: METAVERSE_API_URL,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling sucess</p>");
displayUsers(response.data);
}
});
}
function onScriptEventReceived(event) {
$("#dev-div").append("<p>Received a script event, its type is " + typeof event + "</p>");
if (typeof event === "string") {
// Parse the string into an object
event = JSON.parse(event);
}
if (event.type === "sendUsername") {
myUsername = event.data.username;
$("#dev-div").append("<p>myUsername is " + myUsername + "</p>");
consoloe.log("myUsername is " + myUsername);
}
}
$(document).ready(function() {
$("#dev-div").append("<p>ready</p>");
// Listen for events from hifi
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
// Send a ready event to hifi
var eventObject = {"type": "ready"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
});
</script>
</body>
</html>

View file

@ -0,0 +1,511 @@
<!--
// users.html
//
// 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
-->
<html>
<head>
<title>Users Online</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
justify-content: space-between;
}
#refresh-button {
width: 24px;
height: 24px;
}
.main {
padding: 30px;
margin-top: 90px;
}
#user-info-div {
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 40px;
}
#visibility-toggle {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 0px;
border-radius: 5px;
border: none;
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
cursor: pointer;
}
#visibility-toggle:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
#visibility-toggle:active {
background: linear-gradient(#afafaf, #afafaf);
}
#visibility-toggle span {
padding-left: 10px;
}
.tabs {
list-style: none;
padding: 0;
margin: 0;
}
.tabs li {
display: inline-block;
padding: 10px 15px;
}
.tabs li.current {
background: rgba(255,255,255,0.15);
}
.tab-content {
display: none;
}
.tab-content.current {
display: inherit;
background: rgba(255,255,255,0.15);
}
.tab-content ul {
list-style: none;
padding: 15px 0px 15px 15px;
margin: 0;
}
.tab-content ul li {
padding: 2px 0px;
}
input[type=button] {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 6px;
border-radius: 5px;
border: none;
color: #fff;
background-color: #000;
background: linear-gradient(#343434 20%, #000 100%);
cursor: pointer;
}
input[type=button].red {
color: #fff;
background-color: #94132e;
background: linear-gradient(#d42043 20%, #94132e 100%);
}
input[type=button].blue {
color: #fff;
background-color: #1080b8;
background: linear-gradient(#00b4ef 20%, #1080b8 100%);
}
input[type=button].white {
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
}
input[type=button]:enabled:hover {
background: linear-gradient(#000, #000);
border: none;
}
input[type=button].red:enabled:hover {
background: linear-gradient(#d42043, #d42043);
border: none;
}
input[type=button].blue:enabled:hover {
background: linear-gradient(#00b4ef, #00b4ef);
border: none;
}
input[type=button].white:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
input[type=button]:active {
background: linear-gradient(#343434, #343434);
}
input[type=button].red:active {
background: linear-gradient(#94132e, #94132e);
}
input[type=button].blue:active {
background: linear-gradient(#1080b8, #1080b8);
}
input[type=button].white:active {
background: linear-gradient(#afafaf, #afafaf);
}
input[type=button]:disabled {
color: #252525;
background: linear-gradient(#575757 20%, #252525 100%);
}
input[type=button][pressed=pressed] {
color: #00b4ef;
}
#friends-button {
margin: 0px 0px 15px 10px;
}
/*Vertically Center Modal*/
.modal {
color: black;
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -4px;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.dropdown-menu {
width: 350px;
border: 0;
display: block;
float: none;
position: inherit;
}
.dropdown-menu li {
color: #333;
padding: 10px;
}
.dropdown-menu .divider {
padding: 0px;
}
.dropdown-menu li.current {
background: #dcdcdc;
}
.dropdown-menu li h5 {
font-weight: bold;
}
.dropdown-menu li p {
font-size: 14px;
}
</style>
</head>
<body>
<div class="top-bar">
<div>Users Online</div>
<img id="refresh-button" onclick="pollUsers()" src="https://hifi-content.s3.amazonaws.com/faye/tablet-dev/refresh-icon.svg"></img>
</div>
<div class="main">
<div id="user-info-div">
<h4></h4>
<button id="visibility-toggle" data-toggle="modal" data-target="#myModal2" aria-haspopup="true" aria-expanded="false">
Online
<span class="glyphicon glyphicon-menu-down"></span>
</button>
</div>
<ul class="tabs">
<li tab-id="tab-1" class="current">Everyone (0)</li>
<li tab-id="tab-2">Friends (0)</li>
</ul>
<div id="tab-1" class="tab-content current">
<ul></ul>
</div>
<div id="tab-2" class="tab-content">
<ul></ul>
<input type="button" class="blue" id="friends-button" value="Add/Remove Friends">
</div>
</div>
<!-- Modal for jump to-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Jump to username @ Placename</h4>
</div>
<div class="modal-body">
This will teleport you to a new location and possibly another domain. Are you sure?
</div>
<div class="modal-footer">
<input type="button" data-dismiss="modal" value="Cancel">
<input type="button" data-dismiss="modal" id="jump-to-confirm-button" value="OK">
</div>
</div>
</div>
</div>
<!-- Modal for visibility-->
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Change your visibility setting</h4>
</div>
<div class="modal-body">
<ul class="dropdown-menu" aria-labelledby="visibility-toggle">
<li class="visibility-option" data-visibility="all">
<h5>Online</h5>
<p>You will be shown online to everyone else. Anybody will be able to find you from the users online list and jump to your current location.</p>
</li>
<li role="separator" class="divider"></li>
<li class="visibility-option" data-visibility="friends">
<h5>Available to Friends Only</h5>
<p>You will be shown online only to users you have added as friends. Other users may still interact with you in the same domain, but they won't be able to find you from the users online list.</p>
</li>
<li role="separator" class="divider"></li>
<li class="visibility-option" data-visibility="none">
<h5>Appear Offline</h5>
<p>No one will be able to find you from the users online list. However, this does not prevent other users in the same domain from interacting with you. For a complete "Do not disturb" mode, you may want to go to your own private domain and set allow entering to no one.</p>
</li>
</ul>
</div>
<div class="modal-footer">
<input type="button" data-dismiss="modal" value="OK">
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script>
var METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/v1/users?status=online";
var FRIENDS_FILTER = "&filter=friends";
var myUsername = null;
var myVisibility = null;
function displayUsers(data, element) {
element.empty();
for (var i = 0; i < data.users.length; i++) {
// Display users who aren't in a domain differently
if (typeof data.users[i].location.root === "undefined" || typeof data.users[i].location.root.name === "undefined") {
console.log(data.users[i].username + "is online but not in a domain");
$("#dev-div").append("<p>" + data.users[i].username + "is online but not in a domain</p>");
$("<li></li>", {
"data-toggle": "modal",
"data-target": "#myModal",
"data-username": data.users[i].username,
"data-placename": "",
text: data.users[i].username
}).appendTo(element);
} else {
$("#dev-div").append("<li>" + data.users[i].username + " @ " + data.users[i].location.root.name + "</li>");
console.log(data.users[i].username + " @ " + data.users[i].location.root.name);
// Create a list item and put user info in data-* attributes, also make it trigger the jump to confirmation modal
$("<li></li>", {
"data-toggle": "modal",
"data-target": "#myModal",
"data-username": data.users[i].username,
"data-placename": data.users[i].location.root.name,
text: data.users[i].username + " @ " + data.users[i].location.root.name
}).appendTo(element);
}
}
}
function isOtherUsers(user) {
return user.username != myUsername;
}
function processData(data, type) {
// Filter out yourself from the users list
data.users = data.users.filter(isOtherUsers);
// Sort array alphabetically by username
data.users.sort(function(a, b) {
var nameA = a.username.toLowerCase();
var nameB = b.username.toLowerCase();
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
});
var num = data.users.length;
if (type === "everyone") {
$(".tabs li:nth-child(1)").text("Everyone (" + num + ")");
displayUsers(data, $("#tab-1 ul"));
} else if (type === "friends") {
$(".tabs li:nth-child(2)").text("Friends (" + num + ")");
displayUsers(data, $("#tab-2 ul"));
}
}
function pollUsers() {
$("#dev-div").append("<p>polling users..</p>");
$.ajax({
url: METAVERSE_API_URL,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling everyone sucess</p>");
processData(response.data, "everyone");
}
});
$.ajax({
url: METAVERSE_API_URL + FRIENDS_FILTER,
success: function(response) {
console.log(response);
$("#dev-div").append("<p>polling friends sucess</p>");
processData(response.data, "friends");
}
});
}
function onScriptEventReceived(event) {
$("#dev-div").append("<p>Received a script event, its type is " + typeof event + "</p>");
if (typeof event === "string") {
// Parse the string into an object
event = JSON.parse(event);
}
if (event.type === "user-info") {
myUsername = event.data.username;
myVisibility = event.data.visibility;
$("#user-info-div h4").text(myUsername);
var buttonText = "Online";
if (myVisibility === "none") {
buttonText = "Appear Offline";
} else if (myVisibility === "friends") {
buttonText = "Available To Friends Only";
}
$("#visibility-toggle").html(buttonText + "<span class='glyphicon glyphicon-menu-down'></span>")
}
}
$(document).ready(function() {
$("#dev-div").append("<p>ready</p>");
// Auto-load user lists when page loads
pollUsers();
// Click listener for tabs
$(".tabs li").click(function() {
var tabID = $(this).attr("tab-id");
$(".tab-content").removeClass("current");
$("#" + tabID).addClass("current");
$(".tabs li").removeClass("current");
$(this).addClass("current");
});
// Jump to user: Fill confirmation modal with data of the selected user
$("#myModal").on("show.bs.modal", function (event) {
// Get the element that triggered the modal
var li = $(event.relatedTarget);
// Extract info from data-* attributes
var username = li.data("username");
var placename = li.data("placename");
// Write info to the modal
var modal = $(this);
if (placename === "") {
modal.find(".modal-title").text("Jump to " + username);
} else {
modal.find(".modal-title").text("Jump to " + username + " @ " + placename);
}
$("#jump-to-confirm-button").data("username", username);
})
$("#jump-to-confirm-button").click(function() {
var jumpToObject = {
"type": "jump-to",
"data": {
"username": $(this).data("username")
}
}
EventBridge.emitWebEvent(JSON.stringify(jumpToObject));
});
// Click listener for toggling who can see me
$(".visibility-option").click(function() {
$(".visibility-option").removeClass("current");
$(this).addClass("current");
myVisibility = $(this).data("visibility");
var newButtonText = $(this).find("h5").text();
$("#visibility-toggle").html(newButtonText + "<span class='glyphicon glyphicon-menu-down'></span>");
var visibilityObject = {
"type": "toggle-visibility",
"data": {
"visibility": myVisibility
}
}
EventBridge.emitWebEvent(JSON.stringify(visibilityObject));
});
// Listen for events from hifi
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
// Send a ready event to hifi
var eventObject = {"type": "ready"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
// Click listener for add/remove friends button
$("#friends-button").click(function() {
// Send a manage friends event to hifi
eventObject = {"type": "manage-friends"};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
});
});
</script>
</body>
</html>

View file

@ -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

View file

@ -0,0 +1,141 @@
<!--
// quick_start_template.html
//
// 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
-->
<html>
<head>
<title>HiFi Tablet App Quick Start Template</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700"" rel="stylesheet">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-weight: bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
}
.content {
margin-top: 90px;
padding: 30px;
}
input[type=button] {
font-family: 'Raleway';
font-weight: bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 6px;
border-radius: 5px;
border: none;
color: #fff;
background-color: #000;
background: linear-gradient(#343434 20%, #000 100%);
cursor: pointer;
}
input[type=button].red {
color: #fff;
background-color: #94132e;
background: linear-gradient(#d42043 20%, #94132e 100%);
}
input[type=button].blue {
color: #fff;
background-color: #1080b8;
background: linear-gradient(#00b4ef 20%, #1080b8 100%);
}
input[type=button].white {
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
}
input[type=button]:enabled:hover {
background: linear-gradient(#000, #000);
border: none;
}
input[type=button].red:enabled:hover {
background: linear-gradient(#d42043, #d42043);
border: none;
}
input[type=button].blue:enabled:hover {
background: linear-gradient(#00b4ef, #00b4ef);
border: none;
}
input[type=button].white:enabled:hover {
background: linear-gradient(#fff, #fff);
border: none;
}
input[type=button]:active {
background: linear-gradient(#343434, #343434);
}
input[type=button].red:active {
background: linear-gradient(#94132e, #94132e);
}
input[type=button].blue:active {
background: linear-gradient(#1080b8, #1080b8);
}
input[type=button].white:active {
background: linear-gradient(#afafaf, #afafaf);
}
input[type=button]:disabled {
color: #252525;
background: linear-gradient(#575757 20%, #252525 100%);
}
input[type=button][pressed=pressed] {
color: #00b4ef;
}
</style>
</head>
<body>
<div class="top-bar">
<h4>HiFi Tablet Sample App</h4>
</div>
<div class="content">
<h4>Hello World!</h4>
<p>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!</p>
<p><input type="button" value="Button"></p>
<p><input type="button" class="white" value="Button"></p>
<p><input type="button" class="red" value="Button"></p>
<p><input type="button" class="blue" value="Button"></p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
function main() {
console.log("ready");
}
$(document).ready(main);
</script>
</body>
</html>

BIN
hifi-content/faye/tiltbrush-exports/Cupcake.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/tiltbrush-exports/Untitled_1.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/tiltbrush-palette/Untitled_2.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/tiltbrush-palette/Untitled_3.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
hifi-content/faye/tiltbrush-palette/Untitled_4.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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
}

View file

@ -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
}

BIN
hifi-content/faye/vrhackathonsf/assets/potion_bottle.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1 @@
(function() {}());

View file

@ -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();
});

View file

@ -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();
};
});

View file

@ -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);
};
});

View file

@ -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();
});

View file

@ -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);
}
});

View file

@ -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);
};
});

View file

@ -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);
}());

View file

@ -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
}
}());