It seems to work now

This commit is contained in:
Thomas FORGIONE
2015-06-18 14:46:09 +02:00
parent b94725ab7c
commit 547162e9bb
4 changed files with 33 additions and 32 deletions

View File

@@ -81,19 +81,7 @@ mesh.Mesh.prototype.addNormal = function(normal) {
}
mesh.Mesh.prototype.isFinished = function() {
// return this.faceIndex === this.faces.length;
for (var i = 0; i < this.faces.length; i++) {
if (!(this.faces[i].sent)) {
return false;
}
}
return true;
return this.faceIndex === this.faces.length;
}
// Vertex

View File

@@ -85,13 +85,13 @@ geo.MeshStreamer.prototype.loadFromFile = function(path, callback) {
// Create faces (two if Face4)
var faces = currentMesh.addFaces(line);
faces[0].index = currentMesh.faces.length - (faces.length === 2 ? 1 : 2);
faces[0].index = self.faces.length;
faces[0].meshIndex = self.meshes.length - 1;
self.faces.push(faces[0]);
if (faces.length === 2) {
faces[1].index = currentMesh.faces.length - 1;
faces[1].index = self.faces.length;
faces[1].meshIndex = self.meshes.length - 1;
self.faces.push(faces[1]);
@@ -189,9 +189,10 @@ geo.MeshStreamer.prototype.nextElements = function(_camera) {
z: camera.target.z - camera.position.z
}
var sent = 0;;
var sent = 0;
var data = [];
var mightBeCompletetlyFinished = true;
for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {