Merge branch 'master' of github.com:highfidelity/hifi into linux-clang-build

This commit is contained in:
Seth Alves 2017-10-09 09:50:50 -07:00
commit 3ca8334e3e
108 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,101 @@
//
// testEars.js
//
// Positions and orients your listening position at a virtual head created in front of you.
//
// Created by David Rowe on 7 Oct 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 () {
"use strict";
var overlays = [
{
// Head
type: "sphere",
properties: {
dimensions: { x: 0.2, y: 0.3, z: 0.25 },
position: { x: 0, y: 0, z: -2 },
rotation: Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }),
color: { red: 128, green: 128, blue: 128 },
alpha: 1.0,
solid: true
}
},
{
// Left ear
type: "sphere",
properties: {
dimensions: { x: 0.04, y: 0.10, z: 0.08 },
localPosition: { x: -0.1, y: 0, z: 0.05 },
localRotation: Quat.fromVec3Degrees({ x: 0, y: 0, z: 0 }),
color: { red: 255, green: 0, blue: 0 }, // Red for "port".
alpha: 1.0,
solid: true
}
},
{
// Right ear
type: "sphere",
properties: {
dimensions: { x: 0.04, y: 0.10, z: 0.08 },
localPosition: { x: 0.1, y: 0, z: 0.05 },
localRotation: Quat.fromVec3Degrees({ x: 0, y: 0, z: 0 }),
color: { red: 0, green: 255, blue: 0 }, // Green for "starboard".
alpha: 1.0,
solid: true
}
},
{
// Nose
type: "sphere",
properties: {
dimensions: { x: 0.04, y: 0.04, z: 0.04 },
localPosition: { x: 0, y: 0, z: -0.125 },
localRotation: Quat.fromVec3Degrees({ x: 0, y: -0.08, z: 0 }),
color: { red: 160, green: 160, blue: 160 },
alpha: 1.0,
solid: true
}
}
],
originalListenerMode;
function setUp() {
var i, length;
originalListenerMode = MyAvatar.audioListenerMode;
for (i = 0, length = overlays.length; i < length; i++) {
if (i === 0) {
overlays[i].properties.position = Vec3.sum(MyAvatar.getHeadPosition(),
Vec3.multiplyQbyV(MyAvatar.orientation, overlays[i].properties.position));
overlays[i].properties.rotation = Quat.multiply(MyAvatar.orientation, overlays[i].properties.rotation);
} else {
overlays[i].properties.parentID = overlays[0].id;
}
overlays[i].id = Overlays.addOverlay(overlays[i].type, overlays[i].properties);
}
MyAvatar.audioListenerMode = MyAvatar.audioListenerModeCustom;
MyAvatar.customListenPosition = overlays[0].properties.position;
MyAvatar.customListenOrientation = overlays[0].properties.orientation;
}
function tearDown() {
var i, length;
for (i = 0, length = overlays.length; i < length; i++) {
Overlays.deleteOverlay(overlays[i].id);
}
MyAvatar.audioListenerMode = originalListenerMode;
}
Script.setTimeout(setUp, 2000); // Delay so that overlays display if script runs at Interface start.
Script.scriptEnding.connect(tearDown);
}());

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View file

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View file

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View file

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 770 B

After

Width:  |  Height:  |  Size: 770 B

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Some files were not shown because too many files have changed in this diff Show more