mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:38:27 +02:00
ignore 0,0,0 positions so we have accurate unload for bubbles
This commit is contained in:
parent
dfa43e84bf
commit
5df483b35f
3 changed files with 21 additions and 23 deletions
|
@ -12,8 +12,8 @@
|
||||||
// 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
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
Script.include("../utilities.js");
|
Script.include("../../utilities.js");
|
||||||
Script.include("../libraries/utils.js");
|
Script.include("../../libraries/utils.js");
|
||||||
|
|
||||||
var POP_SOUNDS = [
|
var POP_SOUNDS = [
|
||||||
SoundCache.getSound("http://hifi-public.s3.amazonaws.com/james/bubblewand/sounds/pop0.wav"),
|
SoundCache.getSound("http://hifi-public.s3.amazonaws.com/james/bubblewand/sounds/pop0.wav"),
|
||||||
|
@ -34,16 +34,17 @@
|
||||||
var checkPositionInterval;
|
var checkPositionInterval;
|
||||||
this.preload = function(entityID) {
|
this.preload = function(entityID) {
|
||||||
// print('bubble preload')
|
// print('bubble preload')
|
||||||
// var _t = this;
|
_t.entityID = entityID;
|
||||||
// _t.entityID = entityID;
|
//properties = Entities.getEntityProperties(entityID);
|
||||||
// properties = Entities.getEntityProperties(entityID);
|
|
||||||
// _t.loadShader(entityID);
|
// _t.loadShader(entityID);
|
||||||
Script.update.connect(_t.internalUpdate);
|
Script.update.connect(_t.internalUpdate);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.internalUpdate = function() {
|
this.internalUpdate = function() {
|
||||||
|
var tmpProperties = Entities.getEntityProperties(_t.entityID);
|
||||||
properties = Entities.getEntityProperties(_t.entityID)
|
if (tmpProperties.position.x !== 0 && tmpProperties.position.y !== 0 && tmpProperties.position.z !== 0) {
|
||||||
|
properties = tmpProperties;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadShader = function(entityID) {
|
this.loadShader = function(entityID) {
|
||||||
|
@ -65,11 +66,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.unload = function(entityID) {
|
this.unload = function(entityID) {
|
||||||
|
|
||||||
Script.update.disconnect(this.internalUpdate);
|
Script.update.disconnect(this.internalUpdate);
|
||||||
properties = Entities.getEntityProperties(entityID)
|
|
||||||
var position = properties.position;
|
var position = properties.position;
|
||||||
// this.endOfBubble(position);
|
_t.endOfBubble(position);
|
||||||
print('UNLOAD PROPS' + JSON.stringify(position));
|
print('UNLOAD PROPS' + JSON.stringify(position));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,15 +10,15 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Script.include("../utilities.js");
|
Script.include("../../utilities.js");
|
||||||
Script.include("../libraries/utils.js");
|
Script.include("../../libraries/utils.js");
|
||||||
|
|
||||||
var wandModel = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx' ;
|
var wandModel = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx';
|
||||||
var wandCollisionShape = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/collisionHull.obj' ;
|
var wandCollisionShape = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/collisionHull.obj';
|
||||||
var scriptURL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/scripts/wand.js?' + randInt(0, 10000);
|
//var scriptURL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/scripts/wand.js?' + randInt(0, 10000);
|
||||||
|
|
||||||
//for local testing
|
//for local testing
|
||||||
//var scriptURL = "http://localhost:8080/scripts/wand.js?" + randInt(0, 10000);
|
var scriptURL = "http://localhost:8080/wand.js?" + randInt(0, 10000);
|
||||||
|
|
||||||
//create the wand in front of the avatar
|
//create the wand in front of the avatar
|
||||||
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation())));
|
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation())));
|
||||||
|
|
|
@ -16,14 +16,13 @@ function convertRange(value, r1, r2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
Script.include("../utilities.js");
|
Script.include("../../utilities.js");
|
||||||
Script.include("../libraries/utils.js");
|
Script.include("../../libraries/utils.js");
|
||||||
|
|
||||||
var bubbleModel = "http://hifi-public.s3.amazonaws.com/james/bubblewand/models/bubble/bubble.fbx";
|
var bubbleModel = "http://hifi-public.s3.amazonaws.com/james/bubblewand/models/bubble/bubble.fbx";
|
||||||
var popSound = SoundCache.getSound("http://hifi-public.s3.amazonaws.com/james/bubblewand/sounds/pop.wav");
|
var popSound = SoundCache.getSound("http://hifi-public.s3.amazonaws.com/james/bubblewand/sounds/pop.wav");
|
||||||
var bubbleScript = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/scripts/bubble.js?' + randInt(1, 10000);
|
//var bubbleScript = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/scripts/bubble.js?' + randInt(1, 10000);
|
||||||
//for local testing
|
//for local testing
|
||||||
// var bubbleScript = 'http://localhost:8080/scripts/bubble.js?' + randInt(1, 10000);
|
var bubbleScript = 'http://localhost:8080/bubble.js?' + randInt(1, 10000);
|
||||||
|
|
||||||
var POP_SOUNDS = [
|
var POP_SOUNDS = [
|
||||||
SoundCache.getSound("http://hifi-public.s3.amazonaws.com/james/bubblewand/sounds/pop0.wav"),
|
SoundCache.getSound("http://hifi-public.s3.amazonaws.com/james/bubblewand/sounds/pop0.wav"),
|
||||||
|
@ -319,8 +318,8 @@ Script.include("../libraries/utils.js");
|
||||||
y: 0.01,
|
y: 0.01,
|
||||||
z: 0.01
|
z: 0.01
|
||||||
},
|
},
|
||||||
collisionsWillMove: false, //true
|
collisionsWillMove: true, //true
|
||||||
ignoreForCollisions: true, //false
|
ignoreForCollisions: false, //false
|
||||||
gravity: BUBBLE_GRAVITY,
|
gravity: BUBBLE_GRAVITY,
|
||||||
collisionSoundURL: POP_SOUNDS[randInt(0, 4)],
|
collisionSoundURL: POP_SOUNDS[randInt(0, 4)],
|
||||||
shapeType: "sphere",
|
shapeType: "sphere",
|
||||||
|
|
Loading…
Reference in a new issue