1 package jarmos.geometry;
20 private float[][] functions;
25 private int[] vertexLTFuncNr;
28 this(functions, null);
32 this.functions = functions;
33 this.vertexLTFuncNr = vertexLTFuncNr;
41 float[] res =
new float[vertices.length];
42 float baseX, baseY, baseZ;
54 for (
int vertexNr = 0; vertexNr < res.length / 3; vertexNr++) {
55 baseX = vertices[vertexNr * 3 + 0];
56 baseY = vertices[vertexNr * 3 + 1];
57 baseZ = vertices[vertexNr * 3 + 2];
61 float[] fun = functions[0];
62 if (vertexLTFuncNr != null) {
63 fun = functions[vertexLTFuncNr[vertexNr]];
68 res[vertexNr * 3 + 0] = fun[0] * baseX + fun[1] * baseY + fun[2] * baseZ + fun[9];
69 res[vertexNr * 3 + 1] = fun[3] * baseX + fun[4] * baseY + fun[5] * baseZ + fun[10];
70 res[vertexNr * 3 + 2] = fun[6] * baseX + fun[7] * baseY + fun[8] * baseZ + fun[11];