public void multiply(float amount) { multipliers.add(amount); }
float originalVertexValue = loader.getVertices().get(i); float adjustedVertexValue = (float) (originalVertexValue * loader.getUnitsPerMeter()); verticesMesh.add(adjustedVertexValue);
public void multiply(float amount) { this.multipliers.add(amount); }
public void addPostMultiply(float amount) { postModifiers.add(amount); }
public void add(float amount) { modifiers.add(amount); }
public void add( float[] vals ) { synchronized( mutex ) { list.add( vals ); } } public void add( float[] vals, int offset, int length ) {
public void add( float[] vals, int offset, int length ) { synchronized( mutex ) { list.add( vals, offset, length ); } }
public void appendTo(ChunkMesh chunk, int offsetX, int offsetY, int offsetZ, Vector4f colorOffset, ChunkMesh.RenderType renderType, ChunkVertexFlag flags) { ChunkMesh.VertexElements elements = chunk.getVertexElements(renderType); for (Vector2f texCoord : texCoords) { elements.tex.add(texCoord.x); elements.tex.add(texCoord.y); } int nextIndex = elements.vertexCount; for (int vIdx = 0; vIdx < vertices.length; ++vIdx) { elements.color.add(colorOffset.x); elements.color.add(colorOffset.y); elements.color.add(colorOffset.z); elements.color.add(colorOffset.w); elements.vertices.add(vertices[vIdx].x + offsetX); elements.vertices.add(vertices[vIdx].y + offsetY); elements.vertices.add(vertices[vIdx].z + offsetZ); elements.normals.add(normals[vIdx].x); elements.normals.add(normals[vIdx].y); elements.normals.add(normals[vIdx].z); elements.flags.add(flags.getValue()); } elements.vertexCount += vertices.length; for (int index : indices) { elements.indices.add(index + nextIndex); } }
public MeshBuilder addColor(Color c1, Color... colors) { meshData.getColors().add(c1.rf()); meshData.getColors().add(c1.gf()); meshData.getColors().add(c1.bf()); meshData.getColors().add(c1.af()); for (Color c : colors) { meshData.getColors().add(c.rf()); meshData.getColors().add(c.gf()); meshData.getColors().add(c.bf()); meshData.getColors().add(c.af()); } return this; }
meshData.getVertices().add(vertices[i].x); meshData.getVertices().add(vertices[i].y); meshData.getVertices().add(vertices[i].z); meshData.getColors().add(activeColor.x); meshData.getColors().add(activeColor.y); meshData.getColors().add(activeColor.z); meshData.getColors().add(activeColor.w); meshData.getNormals().add(activeNormal.x); meshData.getNormals().add(activeNormal.y); meshData.getNormals().add(activeNormal.z); meshData.getTexCoord0().add(texCoords[i].x); meshData.getTexCoord0().add(texCoords[i].y); meshData.getTexCoord1().add(lighting.x); meshData.getTexCoord1().add(lighting.y); meshData.getTexCoord1().add(lighting.z);
@Override public TFloatList getAsFloatArray() { TFloatList result = new TFloatArrayList(size()); for (JsonElement element : array) { result.add(element.getAsFloat()); } return result; }
private void addMeshPart(BlockMeshPart part, boolean doubleSided) { for (int i = 0; i < part.size(); ++i) { Vector3f vertex = part.getVertex(i); meshData.getVertices().add(vertex.x); meshData.getVertices().add(vertex.y); meshData.getVertices().add(vertex.z); meshData.getColors().add(activeColor.x); meshData.getColors().add(activeColor.y); meshData.getColors().add(activeColor.z); meshData.getColors().add(activeColor.w); meshData.getNormals().add(normal.x); meshData.getNormals().add(normal.y); meshData.getNormals().add(normal.z); meshData.getTexCoord0().add(uv.x); meshData.getTexCoord0().add(uv.y); meshData.getTexCoord1().add(lighting.x); meshData.getTexCoord1().add(lighting.y); meshData.getTexCoord1().add(lighting.z);
@Override public TFloatList getAsFloatArray() { if (data.getFloatCount() != 0) { TFloatList result = new TFloatArrayList(data.getFloatCount()); for (int i = 0; i < data.getFloatCount(); ++i) { result.add(data.getFloat(i)); } return result; } else { TFloatList result = new TFloatArrayList(data.getDoubleCount()); for (int i = 0; i < data.getDoubleCount(); ++i) { result.add((float) data.getDouble(i)); } return result; } }
/** {@inheritDoc} */ public TFloatList inverseGrep(TFloatProcedure condition) { TFloatList ret = new TFloatLinkedList(); for (TFloatLink l = head; got(l); l = l.getNext()) { if (!condition.execute(l.getValue())) ret.add(l.getValue()); } return ret; }
/** {@inheritDoc} */ public TFloatList grep(TFloatProcedure condition) { TFloatList ret = new TFloatLinkedList(); for (TFloatLink l = head; got(l); l = l.getNext()) { if (condition.execute(l.getValue())) ret.add(l.getValue()); } return ret; }
verticesParam.add(vertexX); verticesParam.add(vertexY); verticesParam.add(vertexZ); } else if (zUp) { verticesParam.add(vertexX); verticesParam.add(vertexZ); verticesParam.add(vertexY); // negated compared to z in yUp colorsParam.add(vertexColor); float normalZ = faceInput.vertexNormalSource.floatValues[index * normalStride + 2]; if (yUp) { normalsParam.add(normalX); normalsParam.add(normalY); normalsParam.add(normalZ); } else if (zUp) { normalsParam.add(normalX); normalsParam.add(normalZ); normalsParam.add(normalY); float normalZ = faceInput.normalSource.floatValues[index * normalStride + 2]; if (yUp) { normalsParam.add(normalX); normalsParam.add(normalY); normalsParam.add(normalZ); } else if (zUp) { normalsParam.add(normalX); normalsParam.add(normalZ); normalsParam.add(normalY);
/** {@inheritDoc} */ public TFloatList inverseGrep(TFloatProcedure condition) { TFloatList ret = new TFloatLinkedList(); for (TFloatLink l = head; got(l); l = l.getNext()) { if (!condition.execute(l.getValue())) ret.add(l.getValue()); } return ret; }