private void gatherVertexData(Mesh mesh, List<Vertex> vertexLookup) { //in case the model is currently animating with software animation //attempting to retrieve the bind position instead of the position. VertexBuffer position = mesh.getBuffer(VertexBuffer.Type.BindPosePosition); if (position == null) { position = mesh.getBuffer(VertexBuffer.Type.Position); } FloatBuffer pos = (FloatBuffer) position.getDataReadOnly(); pos.rewind(); while (pos.remaining() != 0) { Vertex v = new Vertex(); v.position.setX(pos.get()); v.position.setY(pos.get()); v.position.setZ(pos.get()); v.isSeam = false; Vertex existingV = findSimilar(v); if (existingV != null) { //vertex position already exists existingV.isSeam = true; v.isSeam = true; } else { vertexList.add(v); } vertexLookup.add(v); } pos.rewind(); }
private void gatherVertexData(Mesh mesh, List<Vertex> vertexLookup) { //in case the model is currently animating with software animation //attempting to retrieve the bind position instead of the position. VertexBuffer position = mesh.getBuffer(VertexBuffer.Type.BindPosePosition); if (position == null) { position = mesh.getBuffer(VertexBuffer.Type.Position); } FloatBuffer pos = (FloatBuffer) position.getDataReadOnly(); pos.rewind(); while (pos.remaining() != 0) { Vertex v = new Vertex(); v.position.setX(pos.get()); v.position.setY(pos.get()); v.position.setZ(pos.get()); v.isSeam = false; Vertex existingV = findSimilar(v); if (existingV != null) { //vertex position already exists existingV.isSeam = true; v.isSeam = true; } else { vertexList.add(v); } vertexLookup.add(v); } pos.rewind(); }