cleanup and parenting

This commit is contained in:
James B. Pollack 2016-03-01 12:02:07 -08:00
parent ba2e977968
commit 24da3b1019
2 changed files with 11 additions and 2 deletions

View file

@ -115,6 +115,7 @@ function createBubbleSystem() {
};
bubbleProperties.type = "ParticleEffect";
bubbleProperties.parentID = fishTank;
bubbleProperties.dimensions = BUBBLE_SYSTEM_DIMENSIONS;
var upVector = Quat.getRight(tankProperties.rotation);

View file

@ -109,7 +109,9 @@
unload: function() {
print(' UNLOAD')
Script.update.disconnect(_this.update);
_this.overlayLineOff();
if (WANT_LOOK_DEBUG === true) {
_this.overlayLineOff();
}
if (baton) {
print('BATON RELEASE ')
baton.release(function() {});
@ -173,7 +175,10 @@
direction: front
};
_this.overlayLineOn(pickRay.origin, Vec3.sum(pickRay.origin, Vec3.multiply(front, _this.overlayLineDistance)), INTERSECT_COLOR);
if (WANT_LOOK_DEBUG === true) {
_this.overlayLineOn(pickRay.origin, Vec3.sum(pickRay.origin, Vec3.multiply(front, _this.overlayLineDistance)), INTERSECT_COLOR);
};
var intersection = Entities.findRayIntersection(pickRay, true, [_this.entityID]);
@ -262,6 +267,8 @@
var SWIMMING_SPEED = 0.5;
var FISH_DAMPING = 0.25;
var WANT_LOOK_DEBUG = false;
var THROTTLE = false;
var THROTTLE_RATE = 100;
var sinceLastUpdate = 0;
@ -515,6 +522,7 @@
type: "Model",
modelURL: fish.length % 2 === 0 ? FISH_MODEL_URL : FISH_MODEL_TWO_URL,
position: position,
parentID: _this.entityID,
rotation: {
x: 0,
y: 0,