public static IndexBufferData<?> convertQuadIndicesToTriangles(final IndexBufferData<?> quadIndices, final int vertexCount) { final int[] indices = new int[quadIndices.getBufferLimit()]; for (int i = 0; i < indices.length; i++) { indices[i] = quadIndices.get(i); } return convertQuadIndicesToTriangles(indices, vertexCount); }
/** * Create a new int[] array and populate it with the given IndexBufferData's contents. * * @param buff * the IndexBufferData to read from * @return a new int array populated from the IndexBufferData */ public static int[] getIntArray(final IndexBufferData<?> buff) { if (buff == null || buff.getBufferLimit() == 0) { return null; } buff.getBuffer().rewind(); final int[] inds = new int[buff.getBufferLimit()]; for (int x = 0; x < inds.length; x++) { inds[x] = buff.get(); } return inds; }
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof ShortBufferData) { _buffer.put((ShortBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
private void setIndexData() { final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(6 * _meshData.getVertexCount(), _meshData.getVertexCount() - 1); for (int i = _radialSamples; i < _meshData.getVertexCount() + (_radialSamples); i++) { indices.put(i); indices.put(i - _radialSamples); indices.put(i + 1); indices.put(i + 1); indices.put(i - _radialSamples); indices.put(i - _radialSamples + 1); } for (int i = 0, len = indices.getBufferCapacity(); i < len; i++) { int ind = indices.get(i); if (ind < 0) { ind += _meshData.getVertexCount(); indices.put(i, ind); } if (ind >= _meshData.getVertexCount()) { ind -= _meshData.getVertexCount(); indices.put(i, ind); } } indices.getBuffer().rewind(); _meshData.setIndices(indices); }
result[i] = getIndices().get(getVertexIndex(primitiveIndex, i, section)); } else { result[i] = getVertexIndex(primitiveIndex, i, section);
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof ByteBufferData) { _buffer.put((ByteBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
/** * Create a new int[] array and populate it with the given IndexBufferData's contents. * * @param buff * the IndexBufferData to read from * @return a new int array populated from the IndexBufferData */ public static int[] getIntArray(final IndexBufferData<?> buff) { if (buff == null || buff.getBufferLimit() == 0) { return null; } buff.getBuffer().rewind(); final int[] inds = new int[buff.getBufferLimit()]; for (int x = 0; x < inds.length; x++) { inds[x] = buff.get(); } return inds; }
private void setIndexData() { final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(6 * _meshData.getVertexCount(), _meshData.getVertexCount() - 1); for (int i = _radialSamples; i < _meshData.getVertexCount() + (_radialSamples); i++) { indices.put(i); indices.put(i - _radialSamples); indices.put(i + 1); indices.put(i + 1); indices.put(i - _radialSamples); indices.put(i - _radialSamples + 1); } for (int i = 0, len = indices.getBufferCapacity(); i < len; i++) { int ind = indices.get(i); if (ind < 0) { ind += _meshData.getVertexCount(); indices.put(i, ind); } if (ind >= _meshData.getVertexCount()) { ind -= _meshData.getVertexCount(); indices.put(i, ind); } } indices.getBuffer().rewind(); _meshData.setIndices(indices); }
result[i] = getIndices().get(getVertexIndex(primitiveIndex, i, section)); } else { result[i] = getVertexIndex(primitiveIndex, i, section);
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof IntBufferData) { _buffer.put((IntBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
final int[] indices = new int[size]; for (int j = 0; j < size; j++) { indices[j] = ib.get(j + offset) + vertexOffset;
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof IntBufferData) { _buffer.put((IntBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
final int[] indices = new int[size]; for (int j = 0; j < size; j++) { indices[j] = ib.get(j + offset) + vertexOffset;
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof ByteBufferData) { _buffer.put((ByteBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
getIndices().get(getVertexIndex(primitiveIndex, i, section))); } else {
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof ShortBufferData) { _buffer.put((ShortBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
getIndices().get(getVertexIndex(primitiveIndex, i, section))); } else {
getIndices().get(getVertexIndex(primitiveIndex, i, section))); } else {// non-indexed geometry BufferUtils.populateFromBuffer(result[i], getTextureBuffer(textureIndex),
mData.getIndices() != null ? mData.getIndices().get(vertIndex) : vertIndex);
.getIndices().get(vertIndex) : vertIndex);