/** * Set the value of the specified component * * @param globalComponentIndex The global component index * @param value The value * @throws IndexOutOfBoundsException If the given index causes the * underlying buffer to be accessed out of bounds */ public void set(int globalComponentIndex, float value) { int elementIndex = globalComponentIndex / getNumComponentsPerElement(); int componentIndex = globalComponentIndex % getNumComponentsPerElement(); set(elementIndex, componentIndex, value); }
r += w * d; morphed.set(e, c, r);
/** * 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); } } }