diff --git a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java index 2e703065e..65adbe23d 100644 --- a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java +++ b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java @@ -178,11 +178,11 @@ public class GeometryBatchFactory { } } } else if (Type.Position.ordinal() == bufType) { - FloatBuffer inPos = (FloatBuffer) inBuf.getData(); + FloatBuffer inPos = (FloatBuffer) inBuf.getDataReadOnly(); FloatBuffer outPos = (FloatBuffer) outBuf.getData(); doTransformVerts(inPos, globalVertIndex, outPos, worldMatrix); } else if (Type.Normal.ordinal() == bufType || Type.Tangent.ordinal() == bufType) { - FloatBuffer inPos = (FloatBuffer) inBuf.getData(); + FloatBuffer inPos = (FloatBuffer) inBuf.getDataReadOnly(); FloatBuffer outPos = (FloatBuffer) outBuf.getData(); doTransformNorms(inPos, globalVertIndex, outPos, worldMatrix); } else { @@ -229,8 +229,7 @@ public class GeometryBatchFactory { numOfVertices = g.getVertexCount(); } for (int i = 0; i < lodLevels; i++) { - ShortBuffer buffer = (ShortBuffer) g.getMesh().getLodLevel(i).getData(); - buffer.rewind(); + ShortBuffer buffer = (ShortBuffer) g.getMesh().getLodLevel(i).getDataReadOnly(); //System.out.println("buffer: " + buffer.capacity() + " limit: " + lodSize[i] + " " + index); for (int j = 0; j < buffer.capacity(); j++) { lodData[i][bufferPos[i] + j] = buffer.get() + numOfVertices * curGeom;