mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:43:08 +02:00
query octree right away
This commit is contained in:
parent
03f90c2070
commit
e3fe20c818
2 changed files with 49 additions and 0 deletions
|
@ -39,6 +39,7 @@ var DEFAULT_SOUND_DATA = {
|
||||||
intervalSpread: 0 // amount of randomness to add to the interval
|
intervalSpread: 0 // amount of randomness to add to the interval
|
||||||
};
|
};
|
||||||
var MIN_INTERVAL = 0.2;
|
var MIN_INTERVAL = 0.2;
|
||||||
|
EntityViewer.queryOctree();
|
||||||
|
|
||||||
function messageReceived(channel, message, sender) {
|
function messageReceived(channel, message, sender) {
|
||||||
print("EBL MESSAGE RECIEVED");
|
print("EBL MESSAGE RECIEVED");
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
//
|
||||||
|
// ACAudioSearchAndInject.js
|
||||||
|
// audio
|
||||||
|
//
|
||||||
|
// Created by Eric Levin 2/1/2016
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
|
||||||
|
// This AC script constantly searches for entities with a special userData field that specifies audio settings, and then
|
||||||
|
// injects the sound with the specified URL with other specified settings (playback volume) or playback at interval, or random interval
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
Script.include("https://rawgit.com/highfidelity/hifi/master/examples/libraries/utils.js");
|
||||||
|
|
||||||
|
var SOUND_DATA_KEY = "soundKey";
|
||||||
|
var MESSAGE_CHANNEL = "Hifi-Sound-Entity";
|
||||||
|
|
||||||
|
// Map of all sound entities in domain- key is entity id, value is sound data
|
||||||
|
var soundEntityMap = {};
|
||||||
|
// Map of sound urls so a sound that's already been downloaded from one entity is not re-downloaded if
|
||||||
|
// another entity with same sound url is discovered
|
||||||
|
var soundUrls = {};
|
||||||
|
|
||||||
|
Agent.isAvatar = true;
|
||||||
|
|
||||||
|
EntityViewer.setPosition({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
EntityViewer.setKeyholeRadius(60000);
|
||||||
|
Entities.setPacketsPerSecond(6000);
|
||||||
|
EntityViewer.queryOctree();
|
||||||
|
|
||||||
|
var DEFAULT_SOUND_DATA = {
|
||||||
|
volume: 0.5,
|
||||||
|
loop: false,
|
||||||
|
interval: -1, // An interval of -1 means this sound only plays once (if it's non-looping) (In seconds)
|
||||||
|
intervalSpread: 0 // amount of randomness to add to the interval
|
||||||
|
};
|
||||||
|
var MIN_INTERVAL = 0.2;
|
||||||
|
|
||||||
|
var avatars = AvatarList.getAvatarIdentifiers();
|
||||||
|
print("EBL AVATARS " + JSON.stringify(avatars));
|
||||||
|
|
Loading…
Reference in a new issue