int nc = getNumComponentsPerElement(); sb.append("["); for (int e = 0; e < getNumElements(); e++)
/** * Set the values of the given target {@link AccessorData} to the same * values as in the given source {@link AccessorData}. If either of * them has fewer elements (or fewer components per element) than the * other, then the minimum of both will be used, respectively. * * @param target The target {@link AccessorData} * @param source The source {@link AccessorData} */ private static void setElements( AccessorFloatData target, AccessorFloatData source) { int numElements = Math.min(target.getNumElements(), source.getNumElements()); int numComponents = Math.min( target.getNumComponentsPerElement(), source.getNumComponentsPerElement()); for (int e = 0; e < numElements; e++) { for (int c = 0; c < numComponents; c++) { float value = source.get(e, c); target.set(e, c, value); } } }
/** * Returns an array containing the maximum component values of all elements * of this accessor data. This will be an array whose length is the * {@link #getNumComponentsPerElement() number of components per element}. * * @return The minimum values */ public float[] computeMax() { float result[] = new float[getNumComponentsPerElement()]; Arrays.fill(result, -Float.MAX_VALUE); for (int e = 0; e < getNumElements(); e++) { for (int c = 0; c < getNumComponentsPerElement(); c++) { result[c] = Math.max(result[c], get(e, c)); } } return result; }
/** * Returns an array containing the minimum component values of all elements * of this accessor data. This will be an array whose length is the * {@link #getNumComponentsPerElement() number of components per element}. * * @return The minimum values */ public float[] computeMin() { float result[] = new float[getNumComponentsPerElement()]; Arrays.fill(result, Float.MAX_VALUE); for (int e = 0; e < getNumElements(); e++) { for (int c = 0; c < getNumComponentsPerElement(); c++) { result[c] = Math.min(result[c], get(e, c)); } } return result; }
AccessorDatas.validateFloatType(componentType); AccessorDatas.validateCapacity(byteOffset, getNumElements(), getByteStridePerElement(), bufferViewByteBuffer.capacity());
int numElements = morphed.getNumElements(); for (int e = 0; e < numElements; e++)
InterpolatorType interpolatorType) int numKeyElements = timeData.getNumElements(); float keys[] = new float[numKeyElements]; for (int e=0; e<numKeyElements; e++)
AccessorFloatData sparseValuesAccessorData) int numElements = denseAccessorData.getNumElements(); int numComponentsPerElement = denseAccessorData.getNumComponentsPerElement();