mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +02:00
cleanup and headers
This commit is contained in:
parent
de45fef3fc
commit
3a5f7f1cbe
2 changed files with 38 additions and 25 deletions
|
@ -1,3 +1,16 @@
|
||||||
|
//
|
||||||
|
// createTank.js
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// created by James b. Pollack @imgntn on 3/9/2016
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Adds a fish tank and base, decorations, particle bubble systems, and a bubble sound. Attaches a script that does fish swimming.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
var fishTank, tankBase, bubbleSystem, secondBubbleSystem, innerContainer, bubbleInjector, lowerCorner, upperCorner, urchin, rocks;
|
var fishTank, tankBase, bubbleSystem, secondBubbleSystem, innerContainer, bubbleInjector, lowerCorner, upperCorner, urchin, rocks;
|
||||||
|
|
||||||
var CLEANUP = true;
|
var CLEANUP = true;
|
||||||
|
@ -42,7 +55,6 @@ var TANK_BASE_DIMENSIONS = {
|
||||||
var BASE_VERTICAL_OFFSET = 0.42;
|
var BASE_VERTICAL_OFFSET = 0.42;
|
||||||
|
|
||||||
var BUBBLE_SYSTEM_FORWARD_OFFSET = TANK_DIMENSIONS.x + 0.06;
|
var BUBBLE_SYSTEM_FORWARD_OFFSET = TANK_DIMENSIONS.x + 0.06;
|
||||||
//depth of tank
|
|
||||||
var BUBBLE_SYSTEM_LATERAL_OFFSET = 0.025;
|
var BUBBLE_SYSTEM_LATERAL_OFFSET = 0.025;
|
||||||
var BUBBLE_SYSTEM_VERTICAL_OFFSET = -0.25;
|
var BUBBLE_SYSTEM_VERTICAL_OFFSET = -0.25;
|
||||||
|
|
||||||
|
@ -56,7 +68,6 @@ var BUBBLE_SOUND_URL = "http://hifi-content.s3.amazonaws.com/DomainContent/Home/
|
||||||
var bubbleSound = SoundCache.getSound(BUBBLE_SOUND_URL);
|
var bubbleSound = SoundCache.getSound(BUBBLE_SOUND_URL);
|
||||||
|
|
||||||
var URCHIN_FORWARD_OFFSET = -TANK_DIMENSIONS.x;
|
var URCHIN_FORWARD_OFFSET = -TANK_DIMENSIONS.x;
|
||||||
//depth of tank
|
|
||||||
var URCHIN_LATERAL_OFFSET = -0.15;
|
var URCHIN_LATERAL_OFFSET = -0.15;
|
||||||
var URCHIN_VERTICAL_OFFSET = -0.17;
|
var URCHIN_VERTICAL_OFFSET = -0.17;
|
||||||
|
|
||||||
|
@ -69,7 +80,6 @@ var URCHIN_DIMENSIONS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var ROCKS_FORWARD_OFFSET = 0;
|
var ROCKS_FORWARD_OFFSET = 0;
|
||||||
//depth of tank
|
|
||||||
var ROCKS_LATERAL_OFFSET = 0.0;
|
var ROCKS_LATERAL_OFFSET = 0.0;
|
||||||
var ROCKS_VERTICAL_OFFSET = (-TANK_DIMENSIONS.y / 2) + 0.25;
|
var ROCKS_VERTICAL_OFFSET = (-TANK_DIMENSIONS.y / 2) + 0.25;
|
||||||
|
|
||||||
|
@ -160,8 +170,6 @@ function createBubbleSystems() {
|
||||||
createBubbleSound(finalOffset);
|
createBubbleSound(finalOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getOffsetFromTankCenter(VERTICAL_OFFSET, FORWARD_OFFSET, LATERAL_OFFSET) {
|
function getOffsetFromTankCenter(VERTICAL_OFFSET, FORWARD_OFFSET, LATERAL_OFFSET) {
|
||||||
|
|
||||||
var tankProperties = Entities.getEntityProperties(fishTank);
|
var tankProperties = Entities.getEntityProperties(fishTank);
|
||||||
|
@ -308,6 +316,7 @@ function createTankBase() {
|
||||||
},
|
},
|
||||||
dimensions: TANK_BASE_DIMENSIONS
|
dimensions: TANK_BASE_DIMENSIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
tankBase = Entities.addEntity(properties);
|
tankBase = Entities.addEntity(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,8 +333,8 @@ createUrchin();
|
||||||
createRocks();
|
createRocks();
|
||||||
|
|
||||||
createTankBase();
|
createTankBase();
|
||||||
var customKey = 'hifi-home-fishtank';
|
|
||||||
|
|
||||||
|
var customKey = 'hifi-home-fishtank';
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
fishLoaded: false,
|
fishLoaded: false,
|
||||||
|
@ -339,16 +348,8 @@ var data = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//fisthank initialize has a different UUID than the model that i see
|
|
||||||
Script.setTimeout(function() {
|
Script.setTimeout(function() {
|
||||||
print('CREATE TIMEOUT!!!')
|
|
||||||
print('TANK AT CREATE IS::: ' + fishTank)
|
|
||||||
print('DATA AT CREATE IS:::' + JSON.stringify(data));
|
|
||||||
|
|
||||||
setEntityCustomData(customKey, fishTank, data);
|
setEntityCustomData(customKey, fishTank, data);
|
||||||
// setEntityCustomData('grabbableKey', id, {
|
|
||||||
// grabbable: false
|
|
||||||
// });
|
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
|
||||||
|
|
||||||
|
@ -385,7 +386,6 @@ function setEntityUserData(id, data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME do non-destructive modification of the existing user data
|
|
||||||
function getEntityUserData(id) {
|
function getEntityUserData(id) {
|
||||||
var results = null;
|
var results = null;
|
||||||
var properties = Entities.getEntityProperties(id, "userData");
|
var properties = Entities.getEntityProperties(id, "userData");
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
//
|
||||||
|
// tank.js
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// created by James b. Pollack @imgntn on 3/9/2016
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// looks for fish to swim around, if there are none it makes some. adds an attractor where the person simulating it is looking.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
Script.include('../../../../examples/libraries/virtualBaton.js');
|
Script.include('../../../../examples/libraries/virtualBaton.js');
|
||||||
|
@ -293,16 +306,16 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// flockOfFish.js
|
// flockOfFish.js
|
||||||
// examples
|
// examples
|
||||||
//
|
//
|
||||||
// Philip Rosedale
|
// Philip Rosedale
|
||||||
// Copyright 2016 High Fidelity, Inc.
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
// Fish smimming around in a space in front of you
|
// Fish smimming around in a space in front of you
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
|
||||||
var FISHTANK_USERDATA_KEY = 'hifi-home-fishtank'
|
var FISHTANK_USERDATA_KEY = 'hifi-home-fishtank'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue