/** Copies the indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all the * Mesh's indices. * @param indices the array to copy the indices to * @param destOffset the offset in the indices array to start copying */ public void getIndices (short[] indices, int destOffset) { getIndices(0, indices, destOffset); }
/** Copies the indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all the * Mesh's indices. * @param indices the array to copy the indices to * @param destOffset the offset in the indices array to start copying */ public void getIndices (short[] indices, int destOffset) { getIndices(0, indices, destOffset); }
/** Copies the indices from the Mesh to the short array. The short array must be large enough to hold all the Mesh's indices. * @param indices the array to copy the indices to */ public void getIndices (short[] indices) { getIndices(indices, 0); }
/** Copies the remaining indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all * the remaining indices. * @param srcOffset the zero-based offset of the first index to fetch * @param indices the array to copy the indices to * @param destOffset the offset in the indices array to start copying */ public void getIndices (int srcOffset, short[] indices, int destOffset) { getIndices(srcOffset, -1, indices, destOffset); }
/** Copies the remaining indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all * the remaining indices. * @param srcOffset the zero-based offset of the first index to fetch * @param indices the array to copy the indices to * @param destOffset the offset in the indices array to start copying */ public void getIndices (int srcOffset, short[] indices, int destOffset) { getIndices(srcOffset, -1, indices, destOffset); }
/** Copies the indices from the Mesh to the short array. The short array must be large enough to hold all the Mesh's indices. * @param indices the array to copy the indices to */ public void getIndices (short[] indices) { getIndices(indices, 0); }
@Override public void setMesh (Mesh mesh, Model model) { super.setMesh(mesh, model); vertexSize = mesh.getVertexSize() / 4; positionOffset = mesh.getVertexAttribute(Usage.Position).offset / 4; int indicesCount = mesh.getNumIndices(); if (indicesCount > 0) { indices = new short[indicesCount]; mesh.getIndices(indices); triangleCount = indices.length / 3; } else indices = null; vertexCount = mesh.getNumVertices(); vertices = new float[vertexCount * vertexSize]; mesh.getVertices(vertices); }
@Override public void setMesh (Mesh mesh, Model model) { super.setMesh(mesh, model); vertexSize = mesh.getVertexSize() / 4; positionOffset = mesh.getVertexAttribute(Usage.Position).offset / 4; int indicesCount = mesh.getNumIndices(); if (indicesCount > 0) { indices = new short[indicesCount]; mesh.getIndices(indices); triangleCount = indices.length / 3; } else indices = null; vertexCount = mesh.getNumVertices(); vertices = new float[vertexCount * vertexSize]; mesh.getVertices(vertices); }
if (indicesCount > 0) { short[] indices = new short[indicesCount]; mesh.getIndices(indices);
if (indicesCount > 0) { short[] indices = new short[indicesCount]; mesh.getIndices(indices);
@Override public void addMesh (Mesh mesh, int indexOffset, int numIndices) { if (!attributes.equals(mesh.getVertexAttributes())) throw new GdxRuntimeException("Vertex attributes do not match"); if (numIndices <= 0) return; // silently ignore an empty mesh part // FIXME don't triple copy, instead move the copy to jni int numFloats = mesh.getNumVertices() * stride; tmpVertices.clear(); tmpVertices.ensureCapacity(numFloats); tmpVertices.size = numFloats; mesh.getVertices(tmpVertices.items); tmpIndices.clear(); tmpIndices.ensureCapacity(numIndices); tmpIndices.size = numIndices; mesh.getIndices(indexOffset, numIndices, tmpIndices.items, 0); addMesh(tmpVertices.items, tmpIndices.items, 0, numIndices); }
@Override public void addMesh (Mesh mesh, int indexOffset, int numIndices) { if (!attributes.equals(mesh.getVertexAttributes())) throw new GdxRuntimeException("Vertex attributes do not match"); if (numIndices <= 0) return; // silently ignore an empty mesh part // FIXME don't triple copy, instead move the copy to jni int numFloats = mesh.getNumVertices() * stride; tmpVertices.clear(); tmpVertices.ensureCapacity(numFloats); tmpVertices.size = numFloats; mesh.getVertices(tmpVertices.items); tmpIndices.clear(); tmpIndices.ensureCapacity(numIndices); tmpIndices.size = numIndices; mesh.getIndices(indexOffset, numIndices, tmpIndices.items, 0); addMesh(tmpVertices.items, tmpIndices.items, 0, numIndices); }
if (numIndices > 0) { indices = new short[numIndices]; getIndices(indices); if (removeDuplicates || newVertexSize != vertexSize) { float[] tmp = new float[vertices.length];
if (numIndices > 0) { indices = new short[numIndices]; getIndices(indices); if (removeDuplicates || newVertexSize != vertexSize) { float[] tmp = new float[vertices.length];
mesh.getIndices(renderable.meshPart.offset, renderable.meshPart.size, indices, 0);
mesh.getIndices(renderable.meshPart.offset, renderable.meshPart.size, indices, 0);
/** Copies the remaining indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all * the remaining indices. * @param srcOffset the zero-based offset of the first index to fetch * @param indices the array to copy the indices to * @param destOffset the offset in the indices array to start copying */ public void getIndices (int srcOffset, short[] indices, int destOffset) { getIndices(srcOffset, -1, indices, destOffset); }
/** Copies the indices from the Mesh to the short array. The short array must be large enough to hold all the Mesh's indices. * @param indices the array to copy the indices to */ public void getIndices (short[] indices) { getIndices(indices, 0); }
/** Copies the indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all the * Mesh's indices. * @param indices the array to copy the indices to * @param destOffset the offset in the indices array to start copying */ public void getIndices (short[] indices, int destOffset) { getIndices(0, indices, destOffset); }
@Override public void setMesh (Mesh mesh, Model model) { super.setMesh(mesh, model); vertexSize = mesh.getVertexSize() / 4; positionOffset = mesh.getVertexAttribute(Usage.Position).offset / 4; int indicesCount = mesh.getNumIndices(); if (indicesCount > 0) { indices = new short[indicesCount]; mesh.getIndices(indices); triangleCount = indices.length / 3; } else indices = null; vertexCount = mesh.getNumVertices(); vertices = new float[vertexCount * vertexSize]; mesh.getVertices(vertices); }