model viewer: don't render faces with type & 2

This commit is contained in:
Adam
2017-03-28 18:26:45 -04:00
parent caf5015cdf
commit 3c0ed845f9
2 changed files with 7 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ public class ModelLoader
} }
def.computeNormals(); def.computeNormals();
def.computeTextureUVCoordinates();
return def; return def;
} }

View File

@@ -249,6 +249,11 @@ public class ModelViewer
{ {
for (int i = 0; i < md.faceCount; ++i) for (int i = 0; i < md.faceCount; ++i)
{ {
byte faceRenderType = md.faceRenderTypes[i];
if ((faceRenderType & 2) != 0)
continue; // what is this?
int vertexA = md.faceVertexIndices1[i]; int vertexA = md.faceVertexIndices1[i];
int vertexB = md.faceVertexIndices2[i]; int vertexB = md.faceVertexIndices2[i];
int vertexC = md.faceVertexIndices3[i]; int vertexC = md.faceVertexIndices3[i];
@@ -278,7 +283,7 @@ public class ModelViewer
int vertexCy = md.vertexPositionsY[vertexC]; int vertexCy = md.vertexPositionsY[vertexC];
int vertexCz = md.vertexPositionsZ[vertexC]; int vertexCz = md.vertexPositionsZ[vertexC];
short textureId = md.faceTextures[i]; short textureId = md.faceTextures != null ? md.faceTextures[i] : -1;
Color color; Color color;
float[] u = null; float[] u = null;
@@ -611,9 +616,6 @@ public class ModelViewer
ModelLoader loader = new ModelLoader(); ModelLoader loader = new ModelLoader();
md = loader.load(id, b); md = loader.load(id, b);
md.computeNormals();
md.computeTextureUVCoordinates();
models[id] = md; models[id] = md;
return md; return md;
} }