start inner tank

This commit is contained in:
James B. Pollack 2016-03-01 17:51:05 -08:00
parent 1bcd85d106
commit 5cb792183e
2 changed files with 13 additions and 21 deletions

View file

@ -7,6 +7,8 @@ var TANK_DIMENSIONS = {
z: 3.5914 z: 3.5914
}; };
var INNER_TANK_SCALE = 0.8;
var INNER_TANK_DIMENSIONS = Vec3.multiply(INNER_TANK_SCALE,TANK_DIMENSIONS);
var TANK_WIDTH = TANK_DIMENSIONS.z; var TANK_WIDTH = TANK_DIMENSIONS.z;
var TANK_HEIGHT = TANK_DIMENSIONS.y; var TANK_HEIGHT = TANK_DIMENSIONS.y;

View file

@ -156,7 +156,7 @@
updateDebugSphere: function(position) { updateDebugSphere: function(position) {
Entities.editEntity(_this.debugSphere, { Entities.editEntity(_this.debugSphere, {
visible:true, visible: true,
position: position position: position
}) })
}, },
@ -164,9 +164,9 @@
debugSphereOff: function() { debugSphereOff: function() {
// Entities.deleteEntity(_this.debugSphere); // Entities.deleteEntity(_this.debugSphere);
Entities.editEntity(_this.debugSphere, { Entities.editEntity(_this.debugSphere, {
visible: false visible: false
}) })
//_this.debugSphere = null; //_this.debugSphere = null;
}, },
@ -232,12 +232,10 @@
_this.updateDebugSphere(intersection.intersection); _this.updateDebugSphere(intersection.intersection);
} }
} }
print('INT DIST: ' + intersection.distance);
if (intersection.distance > 1.5) { if (intersection.distance > 1.5) {
print('NOT CLOSE ENOUGH TO THE TANK') if (WANT_LOOK_DEBUG_SPHERE === true) {
if (WANT_LOOK_DEBUG_SPHERE === true) { _this.debugSphereOff();
_this.debugSphereOff(); }
}
return return
} }
// print('intersection:: ' + JSON.stringify(intersection)); // print('intersection:: ' + JSON.stringify(intersection));
@ -454,18 +452,10 @@
z: 0 z: 0
}; };
var center = _this.currentProperties.position; //var center = _this.currentProperties.position;
var bounds = Entities.getEntityProperties(_this.entityID, "boundingBox").boundingBox;
lowerCorner = { lowerCorner = bounds.brn;
x: center.x - (TANK_WIDTH / 2), upperCorner = bounds.tfl;
y: center.y,
z: center.z - (TANK_WIDTH / 2)
};
upperCorner = {
x: center.x + (TANK_WIDTH / 2),
y: center.y + TANK_HEIGHT,
z: center.z + (TANK_WIDTH / 2)
};
//createEntitiesAtCorners(lowerCorner,upperCorner); //createEntitiesAtCorners(lowerCorner,upperCorner);