mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:17:02 +02:00
quiet print messages
This commit is contained in:
parent
0c92c52d26
commit
82789113a8
9 changed files with 792 additions and 648 deletions
|
@ -18,21 +18,46 @@
|
|||
var self = this;
|
||||
|
||||
this.preload = function(entityId) {
|
||||
|
||||
this.entityId = entityId;
|
||||
this.data = JSON.parse(Entities.getEntityProperties(this.entityId, "userData").userData);
|
||||
this.buttonImageURL = baseURL + "GUI/GUI_jump_off.png";
|
||||
this.addExitButton();
|
||||
this.isRiding = false;
|
||||
self.mouseIsConnected = false;
|
||||
if (this.data && this.data.isDynein) {
|
||||
this.rotation = 180;
|
||||
} else {
|
||||
this.rotation = 0;
|
||||
this.initialize(entityId);
|
||||
self.initTimeout = null;
|
||||
}
|
||||
|
||||
this.initialize = function(entityId) {
|
||||
//print(' should initialize' + entityId)
|
||||
var properties = Entities.getEntityProperties(entityId);
|
||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
||||
self.initTimeout = Script.setTimeout(function() {
|
||||
//print(' no user data yet, try again in one second')
|
||||
self.initialize(entityId);
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
//print(' userdata before parse attempt' + properties.userData)
|
||||
self.userData = null;
|
||||
try {
|
||||
self.userData = JSON.parse(properties.userData);
|
||||
} catch (err) {
|
||||
//print(' error parsing json');
|
||||
//print(' properties are:' + properties.userData);
|
||||
return;
|
||||
}
|
||||
|
||||
self.data = self.userData;
|
||||
self.buttonImageURL = baseURL + "GUI/GUI_jump_off.png";
|
||||
self.addExitButton();
|
||||
self.isRiding = false;
|
||||
self.mouseIsConnected = false;
|
||||
if (self.data && self.data.isDynein) {
|
||||
self.rotation = 180;
|
||||
} else {
|
||||
self.rotation = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.addExitButton = function() {
|
||||
this.windowDimensions = Controller.getViewportDimensions();
|
||||
this.buttonWidth = 75;
|
||||
|
@ -53,14 +78,16 @@
|
|||
}
|
||||
|
||||
this.clickReleaseOnEntity = function(entityId, mouseEvent) {
|
||||
|
||||
//print('CLICKED ON MOTOR PROTEIN')
|
||||
return;
|
||||
if (mouseEvent.isLeftButton && !self.isRiding) {
|
||||
print("GET ON");
|
||||
//print("GET ON");
|
||||
self.isRiding = true;
|
||||
if (!self.entityId) {
|
||||
self.entityId = entityId;
|
||||
}
|
||||
self.entityLocation = Entities.getEntityProperties(this.entityId, "position").position;
|
||||
self.entityLocation = Entities.getEntityProperties(self.entityId, "position").position;
|
||||
self.targetLocation = Vec3.sum(self.entityLocation, TARGET_OFFSET);
|
||||
Overlays.editOverlay(self.exitButton, {
|
||||
visible: true
|
||||
|
@ -117,7 +144,7 @@
|
|||
y: event.y
|
||||
});
|
||||
if (event.isLeftButton && clickedOverlay === self.exitButton) {
|
||||
print("GET OFF");
|
||||
//print("GET OFF");
|
||||
Script.update.disconnect(this.update);
|
||||
self.reset();
|
||||
}
|
||||
|
@ -138,7 +165,10 @@
|
|||
self.reset();
|
||||
|
||||
if (self.mouseIsConnected === true) {
|
||||
Controller.mousePressEvent.disconnect(this.onMousePress);
|
||||
Controller.mousePressEvent.disconnect(self.onMousePress);
|
||||
}
|
||||
if (self.initTimeout !== null) {
|
||||
Script.clearTimeout(self.initTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
//
|
||||
|
@ -8,7 +7,7 @@
|
|||
|
||||
(function() {
|
||||
|
||||
var version = 2;
|
||||
var version = 10;
|
||||
var added = false;
|
||||
this.frame = 0;
|
||||
var utilsScript = Script.resolvePath('utils.js');
|
||||
|
@ -19,20 +18,45 @@
|
|||
|
||||
this.preload = function(entityId) {
|
||||
this.entityId = entityId;
|
||||
this.initialize(entityId);
|
||||
this.initTimeout = null;
|
||||
}
|
||||
|
||||
this.initialize = function(entityId) {
|
||||
// print(' should initialize' + entityId)
|
||||
var properties = Entities.getEntityProperties(entityId);
|
||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
||||
self.initTimeout = Script.setTimeout(function() {
|
||||
// print(' no user data yet, try again in one second')
|
||||
self.initialize(entityId);
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
// print(' userdata before parse attempt' + properties.userData)
|
||||
self.userData = null;
|
||||
try {
|
||||
self.userData = JSON.parse(properties.userData);
|
||||
} catch (err) {
|
||||
// print(' error parsing json');
|
||||
// print(' properties are:' + properties.userData);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var mySavedSettings = Settings.getValue(entityId);
|
||||
|
||||
if (mySavedSettings.buttons !== undefined) {
|
||||
// print('NAV preload buttons'+ mySavedSettings.buttons)
|
||||
//print(' preload buttons' + mySavedSettings.buttons)
|
||||
mySavedSettings.buttons.forEach(function(b) {
|
||||
// print('NAV deleting button'+ b)
|
||||
//print(' deleting button' + b)
|
||||
Overlays.deleteOverlay(b);
|
||||
})
|
||||
Settings.setValue(entityId, '')
|
||||
}
|
||||
|
||||
|
||||
self.getUserData();
|
||||
this.buttonImageURL = baseURL + "GUI/GUI_" + self.userData.name + ".png?" + version;
|
||||
self.buttonImageURL = baseURL + "GUI/GUI_" + self.userData.name + ".png?" + version;
|
||||
//print('BUTTON IMAGE URL:' + self.buttonImageURL)
|
||||
if (self.button === undefined) {
|
||||
// print('NAV NO BUTTON ADDING ONE!!')
|
||||
self.button = true;
|
||||
|
@ -43,11 +67,12 @@
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.addButton = function() {
|
||||
|
||||
|
||||
self.getUserData();
|
||||
this.windowDimensions = Controller.getViewportDimensions();
|
||||
this.buttonWidth = 150;
|
||||
this.buttonHeight = 50;
|
||||
|
@ -107,7 +132,7 @@
|
|||
}
|
||||
|
||||
this.lookAtTarget = function() {
|
||||
self.getUserData();
|
||||
|
||||
var direction = Vec3.normalize(Vec3.subtract(self.userData.entryPoint, self.userData.target));
|
||||
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||
x: 1,
|
||||
|
@ -125,16 +150,6 @@
|
|||
MyAvatar.headYaw = 0;
|
||||
|
||||
}
|
||||
|
||||
this.getUserData = function() {
|
||||
this.properties = Entities.getEntityProperties(this.entityId);
|
||||
if (self.properties.userData) {
|
||||
this.userData = JSON.parse(this.properties.userData);
|
||||
} else {
|
||||
this.userData = {};
|
||||
}
|
||||
}
|
||||
|
||||
var buttonDeleter;
|
||||
var deleterCount = 0;
|
||||
this.unload = function() {
|
||||
|
@ -144,6 +159,11 @@
|
|||
|
||||
Controller.mousePressEvent.disconnect(this.onClick);
|
||||
// Script.update.disconnect(this.update);
|
||||
|
||||
|
||||
if (this.initTimeout !== null) {
|
||||
Script.clearTimeout(this.initTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
Controller.mousePressEvent.connect(this.onClick);
|
||||
|
|
|
@ -12,9 +12,35 @@
|
|||
this.preload = function(entityId) {
|
||||
self.soundPlaying = false;
|
||||
self.entityId = entityId;
|
||||
self.getUserData();
|
||||
this.initTimeout = null;
|
||||
this.initialize(entityId);
|
||||
}
|
||||
|
||||
this.initialize = function(entityID) {
|
||||
//print(' should initialize' + entityID)
|
||||
var properties = Entities.getEntityProperties(entityID);
|
||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
||||
self.initTimeout = Script.setTimeout(function() {
|
||||
//print(' no user data yet, try again in one second')
|
||||
self.initialize(entityID);
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
//print(' userdata before parse attempt' + properties.userData)
|
||||
self.userData = null;
|
||||
try {
|
||||
self.userData = JSON.parse(properties.userData);
|
||||
} catch (err) {
|
||||
//print(' error parsing json');
|
||||
//print(' properties are:' + properties.userData);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//print(' USERDATA NAME ' + self.userData.name)
|
||||
self.soundURL = baseURL + "Audio/" + self.userData.name + ".wav?" + version;
|
||||
print("creating WAV name location is " + baseURL + "Audio/" + self.userData.name + ".wav");
|
||||
//print(" creating WAV name location is " + baseURL + "Audio/" + self.userData.name + ".wav");
|
||||
//print(' self soundURL' + self.soundURL)
|
||||
|
||||
self.soundOptions = {
|
||||
stereo: true,
|
||||
|
@ -23,39 +49,35 @@
|
|||
volume: 0.035
|
||||
};
|
||||
|
||||
this.sound = SoundCache.getSound(self.soundURL);
|
||||
|
||||
}
|
||||
|
||||
this.getUserData = function() {
|
||||
self.properties = Entities.getEntityProperties(self.entityId);
|
||||
if (self.properties.userData) {
|
||||
self.userData = JSON.parse(this.properties.userData);
|
||||
} else {
|
||||
self.userData = {};
|
||||
self.sound = SoundCache.getSound(self.soundURL);
|
||||
}
|
||||
}
|
||||
|
||||
this.enterEntity = function(entityID) {
|
||||
print("entering audio zone");
|
||||
//print("entering audio zone");
|
||||
if (self.sound.downloaded) {
|
||||
print("playing background audio named " + self.userData.name + "which has been downloaded");
|
||||
//print("playing background audio named " + self.userData.name + "which has been downloaded");
|
||||
this.soundPlaying = Audio.playSound(self.sound, self.soundOptions);
|
||||
|
||||
} else {
|
||||
print("sound is not downloaded");
|
||||
//print("sound is not downloaded");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.leaveEntity = function(entityID) {
|
||||
print("leaving audio area " + self.userData.name);
|
||||
//print("leaving audio area " + self.userData.name);
|
||||
if (self.soundPlaying !== false) {
|
||||
print("not null");
|
||||
print("Stopped sound " + self.userData.name);
|
||||
//print("not null");
|
||||
//print("Stopped sound " + self.userData.name);
|
||||
self.soundPlaying.stop();
|
||||
} else {
|
||||
print("Sound not playing");
|
||||
//print("Sound not playing");
|
||||
}
|
||||
}
|
||||
|
||||
this.unload = function() {
|
||||
if (this.initTimeout !== null) {
|
||||
Script.clearTimeout(this.initTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,23 +10,49 @@
|
|||
var self = this;
|
||||
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
|
||||
|
||||
|
||||
|
||||
this.preload = function(entityId) {
|
||||
this.entityId = entityId;
|
||||
this.initialize(entityId)
|
||||
this.initTimeout = null;
|
||||
}
|
||||
|
||||
this.initialize = function(entityId) {
|
||||
print(' should initialize' + entityId)
|
||||
var properties = Entities.getEntityProperties(entityId);
|
||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
||||
self.initTimeout = Script.setTimeout(function() {
|
||||
print(' no user data yet, try again in one second')
|
||||
self.initialize(entityId);
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
print(' userdata before parse attempt' + properties.userData)
|
||||
self.userData = null;
|
||||
try {
|
||||
self.userData = JSON.parse(properties.userData);
|
||||
} catch (err) {
|
||||
print(' error parsing json');
|
||||
print(' properties are:' + properties.userData);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
self.addButton();
|
||||
this.buttonShowing = false;
|
||||
self.getUserData();
|
||||
this.showDistance = self.userData.showDistance;
|
||||
this.soundURL = baseURL + "Audio/" + self.userData.soundName + ".wav";
|
||||
print("distance = " + self.userData.showDistance + ", sound = " + this.soundURL);
|
||||
this.soundOptions = {
|
||||
self.buttonShowing = false;
|
||||
self.showDistance = self.userData.showDistance;
|
||||
self.soundURL = baseURL + "Audio/" + self.userData.soundName + ".wav";
|
||||
// print("distance = " + self.userData.showDistance + ", sound = " + self.soundURL);
|
||||
self.soundOptions = {
|
||||
stereo: true,
|
||||
loop: false,
|
||||
localOnly: true,
|
||||
volume: 0.5
|
||||
volume: 0.75
|
||||
};
|
||||
this.sound = SoundCache.getSound(this.soundURL);
|
||||
self.sound = SoundCache.getSound(this.soundURL);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.addButton = function() {
|
||||
|
@ -48,15 +74,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
this.getUserData = function() {
|
||||
this.properties = Entities.getEntityProperties(this.entityId);
|
||||
if (self.properties.userData) {
|
||||
this.userData = JSON.parse(this.properties.userData);
|
||||
} else {
|
||||
this.userData = {};
|
||||
}
|
||||
}
|
||||
|
||||
this.update = function(deltaTime) {
|
||||
|
||||
self.distance = Vec3.distance(MyAvatar.position, Entities.getEntityProperties(self.entityId).position);
|
||||
|
@ -94,6 +111,9 @@
|
|||
Overlays.deleteOverlay(self.button);
|
||||
Controller.mousePressEvent.disconnect(this.onClick);
|
||||
Script.update.disconnect(this.update);
|
||||
if (this.initTimeout !== null) {
|
||||
Script.clearTimeout(this.initTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
Controller.mousePressEvent.connect(this.onClick);
|
||||
|
|
|
@ -14,20 +14,47 @@
|
|||
this.preload = function(entityId) {
|
||||
this.soundPlaying = null;
|
||||
this.entityId = entityId;
|
||||
self.getUserData();
|
||||
this.labelURL = baseURL + "GUI/labels_" + self.userData.name + ".png?" + version;
|
||||
this.showDistance = self.userData.showDistance;
|
||||
this.soundURL = baseURL + "Audio/" + self.userData.name + ".wav";
|
||||
this.soundOptions = {
|
||||
self.initTimeout = null;
|
||||
this.initialize(entityId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.initialize = function(entityId) {
|
||||
print(' should initialize' + entityId)
|
||||
var properties = Entities.getEntityProperties(entityId);
|
||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
||||
self.initTimeout = Script.setTimeout(function() {
|
||||
//print(' no user data yet, try again in one second')
|
||||
self.initialize(entityId);
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
//print(' userdata before parse attempt' + properties.userData)
|
||||
self.userData = null;
|
||||
try {
|
||||
self.userData = JSON.parse(properties.userData);
|
||||
} catch (err) {
|
||||
//print(' error parsing json');
|
||||
//print(' properties are:' + properties.userData);
|
||||
return;
|
||||
}
|
||||
|
||||
self.labelURL = baseURL + "GUI/labels_" + self.userData.name + ".png?" + version;
|
||||
self.showDistance = self.userData.showDistance;
|
||||
self.soundURL = baseURL + "Audio/" + self.userData.name + ".wav";
|
||||
self.soundOptions = {
|
||||
stereo: true,
|
||||
loop: false,
|
||||
localOnly: true,
|
||||
volume: 0.035,
|
||||
position: this.position
|
||||
position: properties.position
|
||||
};
|
||||
this.sound = SoundCache.getSound(this.soundURL);
|
||||
this.buttonImageURL = baseURL + "GUI/GUI_audio.png?" + version;
|
||||
self.sound = SoundCache.getSound(self.soundURL);
|
||||
self.buttonImageURL = baseURL + "GUI/GUI_audio.png?" + version;
|
||||
self.addButton();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.addButton = function() {
|
||||
|
@ -78,9 +105,8 @@
|
|||
|
||||
this.enterEntity = function(entityID) {
|
||||
|
||||
// self.getUserData();
|
||||
print("entering entity and showing" + self.labelURL);
|
||||
//self.buttonShowing = true;
|
||||
// print("entering entity and showing" + self.labelURL);
|
||||
|
||||
Overlays.editOverlay(self.button, {
|
||||
visible: true
|
||||
});
|
||||
|
@ -92,9 +118,8 @@
|
|||
|
||||
|
||||
this.leaveEntity = function(entityID) {
|
||||
// self.getUserData();
|
||||
// print("leaving entity " + self.userData.name);
|
||||
//self.buttonShowing = false;
|
||||
|
||||
print(Overlays);
|
||||
Overlays.editOverlay(self.button, {
|
||||
visible: false
|
||||
|
@ -110,16 +135,16 @@
|
|||
y: event.y
|
||||
});
|
||||
if (clickedOverlay == self.button) {
|
||||
print("button was clicked");
|
||||
//print("button was clicked");
|
||||
if (self.sound.downloaded) {
|
||||
print("play sound");
|
||||
// print("play sound");
|
||||
|
||||
Overlays.editOverlay(self.button, {
|
||||
visible: false
|
||||
});
|
||||
this.soundPlaying = Audio.playSound(self.sound, self.soundOptions);
|
||||
} else {
|
||||
print("not downloaded");
|
||||
// print("not downloaded");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +154,9 @@
|
|||
if (this.soundPlaying !== null) {
|
||||
this.soundPlaying.stop();
|
||||
}
|
||||
|
||||
if (self.initTimeout !== null) {
|
||||
Script.clearTimeout(self.initTimeout);
|
||||
}
|
||||
Controller.mousePressEvent.disconnect(this.onClick);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ getEntityUserData = function(id) {
|
|||
try {
|
||||
results = JSON.parse(properties.userData);
|
||||
} catch (err) {
|
||||
print('error parsing json');
|
||||
print('properties are:'+ properties.userData);
|
||||
// print('error parsing json');
|
||||
// print('properties are:'+ properties.userData);
|
||||
}
|
||||
}
|
||||
return results ? results : {};
|
||||
|
|
|
@ -14,64 +14,76 @@
|
|||
this.entered = true;
|
||||
|
||||
this.preload = function(entityID) {
|
||||
|
||||
this.entityId = entityID;
|
||||
this.initialize(entityID);
|
||||
this.initTimeout = null;
|
||||
}
|
||||
|
||||
this.initialize = function(entityID) {
|
||||
// print(' should initialize')
|
||||
var properties = Entities.getEntityProperties(entityID);
|
||||
portalDestination = properties.userData;
|
||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
||||
self.initTimeout = Script.setTimeout(function() {
|
||||
// print(' no user data yet, try again in one second')
|
||||
self.initialize(entityID);
|
||||
}, 1000)
|
||||
} else {
|
||||
// print(' has userData')
|
||||
self.portalDestination = properties.userData;
|
||||
animationURL = properties.modelURL;
|
||||
this.soundOptions = {
|
||||
self.soundOptions = {
|
||||
stereo: true,
|
||||
loop: false,
|
||||
localOnly: false,
|
||||
position: this.position,
|
||||
volume: 0.035
|
||||
position: properties.position,
|
||||
volume: 0.5
|
||||
};
|
||||
|
||||
this.teleportSound = SoundCache.getSound("https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/whoosh.wav");
|
||||
//print('Script.clearTimeout PRELOADING A ZOOM ENTITY')
|
||||
print(" portal destination is " + portalDestination);
|
||||
self.teleportSound = SoundCache.getSound("https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/whoosh.wav");
|
||||
// print(" portal destination is " + self.portalDestination);
|
||||
}
|
||||
}
|
||||
|
||||
this.enterEntity = function(entityID) {
|
||||
print('Script.clearTimeout ENTERED A BOUNDARY ENTITY, SHOULD ZOOM', entityID)
|
||||
// print(' ENTERED A BOUNDARY ENTITY, SHOULD ZOOM', entityID)
|
||||
|
||||
var data = JSON.parse(Entities.getEntityProperties(this.entityId).userData);
|
||||
|
||||
|
||||
// print(' DATA IS::' + data)
|
||||
if (data != null) {
|
||||
print("Teleporting to (" + data.location.x + ", " + data.location.y + ", " + data.location.z + ")");
|
||||
// print("Teleporting to (" + data.location.x + ", " + data.location.y + ", " + data.location.z + ")");
|
||||
if (self.teleportSound.downloaded) {
|
||||
//print("play sound");
|
||||
MyAvatar.position = data.location;
|
||||
Audio.playSound(self.teleportSound, self.soundOptions);
|
||||
|
||||
} else {
|
||||
//print("not downloaded");
|
||||
}
|
||||
|
||||
this.lookAt(data.target, data.location);
|
||||
|
||||
// this.lookAt(data.target, data.location);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.lookAt = function(targetPosition, avatarPosition) {
|
||||
var direction = Vec3.normalize(Vec3.subtract(MyAvatar.position, targetPosition));
|
||||
// this.lookAt = function(targetPosition, avatarPosition) {
|
||||
// print('GOING TO')
|
||||
// var direction = Vec3.normalize(Vec3.subtract(MyAvatar.position, targetPosition));
|
||||
|
||||
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||
x: 1,
|
||||
y: 0,
|
||||
z: 0
|
||||
});
|
||||
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
|
||||
x: 0,
|
||||
y: 1,
|
||||
z: 0
|
||||
});
|
||||
|
||||
MyAvatar.goToLocation(avatarPosition, true, yaw);
|
||||
MyAvatar.headYaw = 0;
|
||||
}
|
||||
// var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||
// x: 1,
|
||||
// y: 0,
|
||||
// z: 0
|
||||
// });
|
||||
// var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
|
||||
// x: 0,
|
||||
// y: 1,
|
||||
// z: 0
|
||||
// });
|
||||
// print('JBP ZOOM DEBUG YO')
|
||||
// MyAvatar.goToLocation(avatarPosition, true, yaw);
|
||||
// MyAvatar.headYaw = 0;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
@ -81,9 +93,18 @@
|
|||
animationSettings: '{ "frameIndex": 1, "running": false }'
|
||||
});
|
||||
this.entered = false;
|
||||
if (this.initTimeout !== null) {
|
||||
Script.clearTimeout(this.initTimeout);
|
||||
}
|
||||
//playSound();
|
||||
}
|
||||
|
||||
this.unload = function() {
|
||||
if (this.initTimeout !== null) {
|
||||
Script.clearTimeout(this.initTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
this.hoverEnterEntity = function(entityID) {
|
||||
Entities.editEntity(entityID, {
|
||||
animationURL: animationURL,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
var version = 1005;
|
||||
var version = 1015;
|
||||
var cellLayout;
|
||||
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
|
||||
|
@ -79,8 +79,7 @@ var locations = {
|
|||
}, 1000]
|
||||
};
|
||||
|
||||
var scenes = [
|
||||
{
|
||||
var scenes = [{
|
||||
name: "Cells",
|
||||
objects: "",
|
||||
location: locations.cells[0],
|
||||
|
@ -115,7 +114,12 @@ var scenes = [
|
|||
},
|
||||
radius: 500,
|
||||
number: 10,
|
||||
script: "moveRandomly.js?" + version,
|
||||
userData: JSON.stringify({
|
||||
target: locations.cellLayout[1],
|
||||
location: locations.cellLayout[0],
|
||||
baseURL: baseLocation
|
||||
}),
|
||||
script: "zoom.js?" + version,
|
||||
visible: true
|
||||
}],
|
||||
boundary: {
|
||||
|
@ -534,8 +538,7 @@ var scenes = [
|
|||
location: locations.mitochondria[1],
|
||||
target: locations.mitochondria[0]
|
||||
}
|
||||
}
|
||||
];
|
||||
}];
|
||||
|
||||
|
||||
function ImportScene(scene) {
|
||||
|
@ -637,6 +640,7 @@ function createLayoutLights() {
|
|||
})
|
||||
|
||||
}
|
||||
|
||||
function CreateNavigationButton(scene, number) {
|
||||
// print('NAV NAVIGATION CREATING NAV!!' +scene.name + " " + number)
|
||||
|
||||
|
@ -811,7 +815,7 @@ function CreateInstances(scene) {
|
|||
}, idBounds, 150);
|
||||
|
||||
}
|
||||
print('Script.clearTimeout SCRIPT AT CREATE ENTITY: ' + script)
|
||||
//print('SCRIPT AT CREATE ENTITY: ' + script)
|
||||
CreateEntity(scene.instances[i].model, position, rotation, scene.instances[i].dimensions, url, script, scene.instances[i].userData, scene.instances[i].visible);
|
||||
}
|
||||
}
|
||||
|
@ -890,7 +894,7 @@ function getPointOnSphereOfRadius(radius, number, totalNumber) {
|
|||
// print("inc " + inc + " off " + off + " y " + y + " r " + r + " phi " + phi);
|
||||
|
||||
if (isNaN(r)) {
|
||||
print("r is not a number");
|
||||
//print("r is not a number");
|
||||
r = 1;
|
||||
}
|
||||
|
||||
|
@ -913,7 +917,7 @@ function CreateEntity(name, position, rotation, dimensions, url, script, userDat
|
|||
scriptLocation = baseLocation + "Scripts/" + script;
|
||||
}
|
||||
|
||||
print('Script.clearTimeout SCRIPT LOCATION IN CREATE ENTITY' + scriptLocation)
|
||||
//print(' SCRIPT LOCATION IN CREATE ENTITY' + scriptLocation)
|
||||
Entities.addEntity({
|
||||
type: "Model",
|
||||
name: name,
|
||||
|
|
Loading…
Reference in a new issue