public static IndexBuffer wrapIndexBuffer(Buffer buf) { if (buf instanceof ByteBuffer) { return new IndexByteBuffer((ByteBuffer) buf); } else if (buf instanceof ShortBuffer) { return new IndexShortBuffer((ShortBuffer) buf); } else if (buf instanceof IntBuffer) { return new IndexIntBuffer((IntBuffer) buf); } else { throw new UnsupportedOperationException("Index buffer type unsupported: "+ buf.getClass()); } }
/** * Creates an index buffer that can contain the given amount * of vertices. * Returns {@link IndexShortBuffer} * * @param vertexCount The amount of vertices to contain * @param indexCount The amount of indices * to contain. * @return A new index buffer */ public static IndexBuffer createIndexBuffer(int vertexCount, int indexCount){ if (vertexCount > 65535){ return new IndexIntBuffer(BufferUtils.createIntBuffer(indexCount)); }else{ return new IndexShortBuffer(BufferUtils.createShortBuffer(indexCount)); } }
ShortBuffer sb = BufferUtils.createShortBuffer(newFaces.size() * 3); m.setBuffer(VertexBuffer.Type.Index, 3, sb); indexBuf = new IndexShortBuffer(sb);
ShortBuffer sb = BufferUtils.createShortBuffer(indexes.size()); jmeMesh.setBuffer(VertexBuffer.Type.Index, 3, sb); indexBuf = new IndexShortBuffer(sb);
newIndexBuf = new IndexIntBuffer(BufferUtils.createIntBuffer(numIndices)); } else { newIndexBuf = new IndexShortBuffer(BufferUtils.createShortBuffer(numIndices));
public static IndexBuffer wrapIndexBuffer(Buffer buf) { if (buf instanceof ByteBuffer) { return new IndexByteBuffer((ByteBuffer) buf); } else if (buf instanceof ShortBuffer) { return new IndexShortBuffer((ShortBuffer) buf); } else if (buf instanceof IntBuffer) { return new IndexIntBuffer((IntBuffer) buf); } else { throw new UnsupportedOperationException("Index buffer type unsupported: "+ buf.getClass()); } }
public static IndexBuffer wrapIndexBuffer(Buffer buf) { if (buf instanceof ByteBuffer) { return new IndexByteBuffer((ByteBuffer) buf); } else if (buf instanceof ShortBuffer) { return new IndexShortBuffer((ShortBuffer) buf); } else if (buf instanceof IntBuffer) { return new IndexIntBuffer((IntBuffer) buf); } else { throw new UnsupportedOperationException("Index buffer type unsupported: "+ buf.getClass()); } }
/** * Creates an index buffer that can contain the given amount * of vertices. * Returns {@link IndexShortBuffer} * * @param vertexCount The amount of vertices to contain * @param indexCount The amount of indices * to contain. * @return A new index buffer */ public static IndexBuffer createIndexBuffer(int vertexCount, int indexCount){ if (vertexCount > 65535){ return new IndexIntBuffer(BufferUtils.createIntBuffer(indexCount)); }else{ return new IndexShortBuffer(BufferUtils.createShortBuffer(indexCount)); } }
/** * Creates an index buffer that can contain the given amount * of vertices. * Returns {@link IndexShortBuffer} * * @param vertexCount The amount of vertices to contain * @param indexCount The amount of indices * to contain. * @return A new index buffer */ public static IndexBuffer createIndexBuffer(int vertexCount, int indexCount){ if (vertexCount > 65535){ return new IndexIntBuffer(BufferUtils.createIntBuffer(indexCount)); }else{ return new IndexShortBuffer(BufferUtils.createShortBuffer(indexCount)); } }
ShortBuffer sb = BufferUtils.createShortBuffer(newFaces.size() * 3); m.setBuffer(VertexBuffer.Type.Index, 3, sb); indexBuf = new IndexShortBuffer(sb);
ShortBuffer sb = BufferUtils.createShortBuffer(newFaces.size() * 3); m.setBuffer(VertexBuffer.Type.Index, 3, sb); indexBuf = new IndexShortBuffer(sb);
ShortBuffer sb = BufferUtils.createShortBuffer(indexes.size()); jmeMesh.setBuffer(VertexBuffer.Type.Index, 3, sb); indexBuf = new IndexShortBuffer(sb);
newIndexBuf = new IndexIntBuffer(BufferUtils.createIntBuffer(numIndices)); } else { newIndexBuf = new IndexShortBuffer(BufferUtils.createShortBuffer(numIndices));
newIndexBuf = new IndexIntBuffer(BufferUtils.createIntBuffer(numIndices)); } else { newIndexBuf = new IndexShortBuffer(BufferUtils.createShortBuffer(numIndices));