aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-extras/src
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2016-08-21 23:33:20 +0200
committerJulien Gouesse <[email protected]>2016-08-21 23:33:20 +0200
commitfaa8e2d970e22a516f818eb20a8e69f919c323e8 (patch)
treedcc0719f2a789205762f5d8bc1cd7b452f4a5ed2 /ardor3d-extras/src
parent5b6f48749c2b0552f1dc91bd652b20363c89eef9 (diff)
Fixes the support of textures in the PLY importer
Diffstat (limited to 'ardor3d-extras/src')
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/ply/PlyGeometryStore.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/ply/PlyGeometryStore.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/ply/PlyGeometryStore.java
index 6f5273c..f09364f 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/ply/PlyGeometryStore.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/ply/PlyGeometryStore.java
@@ -161,6 +161,12 @@ public class PlyGeometryStore {
matchConditions.add(MatchCondition.Color);
}
_geometryTool.minimizeVerts(line, matchConditions);
+
+ final TextureState tState = getTextureState();
+ if (tState != null) {
+ line.setRenderState(tState);
+ }
+
line.updateModelBound();
_totalLines++;
_plyEdgeInfoList = null;
@@ -186,7 +192,6 @@ public class PlyGeometryStore {
final FloatBuffer colors = hasColors ? BufferUtils.createFloatBuffer(vertexCount * 4) : null;
final FloatBuffer uvs = hasTexCoords ? BufferUtils.createFloatBuffer(vertexCount * 2) : null;
- // FIXME handle material indices if any
int dummyVertexIndex = 0;
final List<IndexMode> indexModeList = new ArrayList<>();
final List<Integer> indexLengthList = new ArrayList<>();
@@ -280,6 +285,12 @@ public class PlyGeometryStore {
} else {
// FIXME unsure about minimizeVerts preserving the index modes
}
+
+ final TextureState tState = getTextureState();
+ if (tState != null) {
+ mesh.setRenderState(tState);
+ }
+
mesh.updateModelBound();
_root.attachChild(mesh);
_totalMeshes++;