Removed asserts from LodGenerator.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10706 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 20d5565cb7
commit aa55fb6c61
  1. 48
      engine/src/tools/jme3tools/optimize/LodGenerator.java

@ -274,7 +274,7 @@ public class LodGenerator {
gatherVertexData(mesh, vertexLookup);
gatherIndexData(mesh, vertexLookup);
computeCosts();
assert (assertValidMesh());
// assert (assertValidMesh());
}
@ -333,7 +333,7 @@ public class LodGenerator {
} else {
tri.vertexId[i] = ((ShortBuffer) b).get();
}
assert (tri.vertexId[i] < vertexLookup.size());
// assert (tri.vertexId[i] < vertexLookup.size());
tri.vertex[i] = vertexLookup.get(tri.vertexId[i]);
//debug only;
tri.vertex[i].index = tri.vertexId[i];
@ -364,8 +364,8 @@ public class LodGenerator {
logger.log(Level.FINE, "Found isolated vertex {0} It will be excluded from Lod level calculations.", vertex);
}
}
assert (vertexList.size() == collapseCostSet.size());
assert (checkCosts());
// assert (vertexList.size() == collapseCostSet.size());
// assert (checkCosts());
}
//Debug only
@ -383,16 +383,16 @@ public class LodGenerator {
private void computeVertexCollapseCost(Vertex vertex) {
vertex.collapseCost = UNINITIALIZED_COLLAPSE_COST;
assert (!vertex.edges.isEmpty());
// assert (!vertex.edges.isEmpty());
for (Edge edge : vertex.edges) {
edge.collapseCost = computeEdgeCollapseCost(vertex, edge);
assert (edge.collapseCost != UNINITIALIZED_COLLAPSE_COST);
// assert (edge.collapseCost != UNINITIALIZED_COLLAPSE_COST);
if (vertex.collapseCost > edge.collapseCost) {
vertex.collapseCost = edge.collapseCost;
vertex.collapseTo = edge.destination;
}
}
assert (vertex.collapseCost != UNINITIALIZED_COLLAPSE_COST);
// assert (vertex.collapseCost != UNINITIALIZED_COLLAPSE_COST);
collapseCostSet.add(vertex);
}
@ -515,7 +515,7 @@ public class LodGenerator {
}
}
assert (cost >= 0);
// assert (cost >= 0);
return cost * src.position.distanceSquared(dest.position);
}
@ -641,7 +641,7 @@ public class LodGenerator {
buf.rewind();
for (Triangle triangle : triangleList) {
if (!triangle.isRemoved) {
assert (indexCount != 0);
// assert (indexCount != 0);
if (isShortBuffer) {
for (int m = 0; m < 3; m++) {
((ShortBuffer) buf).put((short) triangle.vertexId[m]);
@ -766,7 +766,7 @@ public class LodGenerator {
}
private void addEdge(Vertex v, Edge edge) {
assert (edge.destination != v);
// assert (edge.destination != v);
for (Edge ed : v.edges) {
if (ed.equals(edge)) {
@ -827,7 +827,7 @@ public class LodGenerator {
return;
}
}
assert (false);
// assert (false);
}
private void updateVertexCollapseCost(Vertex vertex) {
@ -836,15 +836,15 @@ public class LodGenerator {
for (Edge edge : vertex.edges) {
edge.collapseCost = computeEdgeCollapseCost(vertex, edge);
assert (edge.collapseCost != UNINITIALIZED_COLLAPSE_COST);
// assert (edge.collapseCost != UNINITIALIZED_COLLAPSE_COST);
if (collapseCost > edge.collapseCost) {
collapseCost = edge.collapseCost;
collapseTo = edge.destination;
}
}
if (collapseCost != vertex.collapseCost || vertex.collapseTo != collapseTo) {
assert (vertex.collapseTo != null);
assert (find(collapseCostSet, vertex));
// assert (vertex.collapseTo != null);
// assert (find(collapseCostSet, vertex));
collapseCostSet.remove(vertex);
if (collapseCost != UNINITIALIZED_COLLAPSE_COST) {
vertex.collapseCost = collapseCost;
@ -852,7 +852,7 @@ public class LodGenerator {
collapseCostSet.add(vertex);
}
}
assert (vertex.collapseCost != UNINITIALIZED_COLLAPSE_COST);
// assert (vertex.collapseCost != UNINITIALIZED_COLLAPSE_COST);
}
private boolean hasSrcID(int srcID, List<CollapsedEdge> cEdges) {
@ -871,14 +871,14 @@ public class LodGenerator {
if (src.edges.isEmpty()) {
return false;
}
assert (assertValidVertex(dest));
assert (assertValidVertex(src));
// assert (assertValidVertex(dest));
// assert (assertValidVertex(src));
assert (src.collapseCost != NEVER_COLLAPSE_COST);
assert (src.collapseCost != UNINITIALIZED_COLLAPSE_COST);
assert (!src.edges.isEmpty());
assert (!src.triangles.isEmpty());
assert (src.edges.contains(new Edge(dest)));
// assert (src.collapseCost != NEVER_COLLAPSE_COST);
// assert (src.collapseCost != UNINITIALIZED_COLLAPSE_COST);
// assert (!src.edges.isEmpty());
// assert (!src.triangles.isEmpty());
// assert (src.edges.contains(new Edge(dest)));
// It may have vertexIDs and triangles from different submeshes(different vertex buffers),
// so we need to connect them correctly based on deleted triangle's edge.
@ -916,8 +916,8 @@ public class LodGenerator {
}
}
assert (!tmpCollapsedEdges.isEmpty());
assert (!dest.edges.contains(new Edge(src)));
// assert (!tmpCollapsedEdges.isEmpty());
// assert (!dest.edges.contains(new Edge(src)));
for (Iterator<Triangle> it = src.triangles.iterator(); it.hasNext();) {

Loading…
Cancel
Save