MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / fillNormal

Method fillNormal

Minecraft-Utils/1.10/src/FaceBakery.java:37–56  ·  view source on GitHub ↗
(int[] faceData)

Source from the content-addressed store, hash-verified

35 }
36
37 private void fillNormal(int[] faceData) {
38 Vector3f v1 = new Vector3f(faceData[3 * 7 + 0], faceData[3 * 7 + 1], faceData[3 * 7 + 2]);
39 Vector3f t = new Vector3f(faceData[1 * 7 + 0], faceData[1 * 7 + 1], faceData[1 * 7 + 2]);
40 Vector3f v2 = new Vector3f(faceData[2 * 7 + 0], faceData[2 * 7 + 1], faceData[2 * 7 + 2]);
41 Vector3f result1 = new Vector3f();
42 Vector3f result2 = new Vector3f();
43 Vector3f result3 = new Vector3f();
44 Vector3f.sub(v1, t, result1);
45 t.set(faceData[0 * 7 + 0], faceData[0 * 7 + 1], faceData[0 * 7 + 2]);
46 Vector3f.sub(v2, t, result2);
47 Vector3f.cross(result2, result1, result3);
48 result3.normalise();
49
50 int x = ((byte) (result3.x * 127)) & 0xFF;
51 int y = ((byte) (result3.y * 127)) & 0xFF;
52 int z = ((byte) (result3.z * 127)) & 0xFF;
53 for (int i = 0; i < 4; i++) {
54 faceData[i * 7 + 6] = x | (y << 0x08) | (z << 0x10);
55 }
56 }
57
58 private int[] a(bpa blockPartFace, ct enumFacing, float[] vec, bym modelRotation, bpb blockPartRotation, boolean b1, boolean b2) {
59 int[] data = new int[28];

Callers 1

aMethod · 0.95

Calls 1

setMethod · 0.65

Tested by

no test coverage detected