📄 shaderattributearrayretained.java
字号:
Object get() { Tuple3f[] arr = new Tuple3f[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 3; arr[i] = new Point3f(); arr[i].x = this.value[j+0]; arr[i].y = this.value[j+1]; arr[i].z = this.value[j+2]; } return arr; } Object getRef() { return this.value; } } /* // Wrapper class for Tuple3d static class Tuple3dArrayWrapper extends ArrayWrapper { private double[] value = new double[0]; void set(Object value) { Tuple3d[] arr = (Tuple3d[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new double[this.length*3]; } for (int i = 0; i < this.length; i++) { int j = i * 3; this.value[j+0] = arr[i].x; this.value[j+1] = arr[i].y; this.value[j+2] = arr[i].z; } } void set(int index, Object value) { int j = index * 3; this.value[j+0] = ((Tuple3d)value).x; this.value[j+1] = ((Tuple3d)value).y; this.value[j+2] = ((Tuple3d)value).z; } Object get() { Tuple3d[] arr = new Tuple3d[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 3; arr[i] = new Point3d(); arr[i].x = this.value[j+0]; arr[i].y = this.value[j+1]; arr[i].z = this.value[j+2]; } return arr; } Object getRef() { return this.value; } } */ // Wrapper class for Tuple4i static class Tuple4iArrayWrapper extends ArrayWrapper { private int[] value = new int[0]; void set(Object value) { Tuple4i[] arr = (Tuple4i[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new int[this.length*4]; } for (int i = 0; i < this.length; i++) { int j = i * 4; this.value[j+0] = arr[i].x; this.value[j+1] = arr[i].y; this.value[j+2] = arr[i].z; this.value[j+3] = arr[i].w; } } void set(int index, Object value) { int j = index * 4; this.value[j+0] = ((Tuple4i)value).x; this.value[j+1] = ((Tuple4i)value).y; this.value[j+2] = ((Tuple4i)value).z; this.value[j+3] = ((Tuple4i)value).w; } Object get() { Tuple4i[] arr = new Tuple4i[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 4; arr[i] = new Point4i(); arr[i].x = this.value[j+0]; arr[i].y = this.value[j+1]; arr[i].z = this.value[j+2]; arr[i].w = this.value[j+3]; } return arr; } Object getRef() { return this.value; } } // Wrapper class for Tuple4f static class Tuple4fArrayWrapper extends ArrayWrapper { private float[] value = new float[0]; void set(Object value) { Tuple4f[] arr = (Tuple4f[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new float[this.length*4]; } for (int i = 0; i < this.length; i++) { int j = i * 4; this.value[j+0] = arr[i].x; this.value[j+1] = arr[i].y; this.value[j+2] = arr[i].z; this.value[j+3] = arr[i].w; } } void set(int index, Object value) { int j = index * 4; this.value[j+0] = ((Tuple4f)value).x; this.value[j+1] = ((Tuple4f)value).y; this.value[j+2] = ((Tuple4f)value).z; this.value[j+3] = ((Tuple4f)value).w; } Object get() { Tuple4f[] arr = new Tuple4f[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 4; arr[i] = new Point4f(); arr[i].x = this.value[j+0]; arr[i].y = this.value[j+1]; arr[i].z = this.value[j+2]; arr[i].w = this.value[j+3]; } return arr; } Object getRef() { return this.value; } } /* // Wrapper class for Tuple4d static class Tuple4dArrayWrapper extends ArrayWrapper { private double[] value = new double[0]; void set(Object value) { Tuple4d[] arr = (Tuple4d[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new double[this.length*4]; } for (int i = 0; i < this.length; i++) { int j = i * 4; this.value[j+0] = arr[i].x; this.value[j+1] = arr[i].y; this.value[j+2] = arr[i].z; this.value[j+3] = arr[i].w; } } void set(int index, Object value) { int j = index * 4; this.value[j+0] = ((Tuple4d)value).x; this.value[j+1] = ((Tuple4d)value).y; this.value[j+2] = ((Tuple4d)value).z; this.value[j+3] = ((Tuple4d)value).w; } Object get() { Tuple4d[] arr = new Tuple4d[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 4; arr[i] = new Point4d(); arr[i].x = this.value[j+0]; arr[i].y = this.value[j+1]; arr[i].z = this.value[j+2]; arr[i].w = this.value[j+3]; } return arr; } Object getRef() { return this.value; } } */ // Wrapper class for Matrix3f static class Matrix3fArrayWrapper extends ArrayWrapper { private float[] value = new float[0]; void set(Object value) { Matrix3f[] arr = (Matrix3f[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new float[this.length * 9]; } for (int i = 0; i < this.length; i++) { int j = i * 9; this.value[j+0] = arr[i].m00; this.value[j+1] = arr[i].m01; this.value[j+2] = arr[i].m02; this.value[j+3] = arr[i].m10; this.value[j+4] = arr[i].m11; this.value[j+5] = arr[i].m12; this.value[j+6] = arr[i].m20; this.value[j+7] = arr[i].m21; this.value[j+8] = arr[i].m22; } } void set(int index, Object value) { int j = index * 9; Matrix3f m = (Matrix3f)value; this.value[j+0] = m.m00; this.value[j+1] = m.m01; this.value[j+2] = m.m02; this.value[j+3] = m.m10; this.value[j+4] = m.m11; this.value[j+5] = m.m12; this.value[j+6] = m.m20; this.value[j+7] = m.m21; this.value[j+8] = m.m22; } Object get() { Matrix3f[] arr = new Matrix3f[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 9; arr[i] = new Matrix3f(); arr[i].m00 = this.value[j+0]; arr[i].m01 = this.value[j+1]; arr[i].m02 = this.value[j+2]; arr[i].m10 = this.value[j+3]; arr[i].m11 = this.value[j+4]; arr[i].m12 = this.value[j+5]; arr[i].m20 = this.value[j+6]; arr[i].m21 = this.value[j+7]; arr[i].m22 = this.value[j+8]; } return arr; } Object getRef() { return this.value; } } /* // Wrapper class for Matrix3d static class Matrix3dArrayWrapper extends ArrayWrapper { private double[] value = new double[0]; void set(Object value) { Matrix3d[] arr = (Matrix3d[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new double[this.length * 9]; } for (int i = 0; i < this.length; i++) { int j = i * 9; this.value[j+0] = arr[i].m00; this.value[j+1] = arr[i].m01; this.value[j+2] = arr[i].m02; this.value[j+3] = arr[i].m10; this.value[j+4] = arr[i].m11; this.value[j+5] = arr[i].m12; this.value[j+6] = arr[i].m20; this.value[j+7] = arr[i].m21; this.value[j+8] = arr[i].m22; } } void set(int index, Object value) { int j = index * 9; Matrix3d m = (Matrix3d)value; this.value[j+0] = m.m00; this.value[j+1] = m.m01; this.value[j+2] = m.m02; this.value[j+3] = m.m10; this.value[j+4] = m.m11; this.value[j+5] = m.m12; this.value[j+6] = m.m20; this.value[j+7] = m.m21; this.value[j+8] = m.m22; } Object get() { Matrix3d[] arr = new Matrix3d[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 9; arr[i] = new Matrix3d(); arr[i].m00 = this.value[j+0]; arr[i].m01 = this.value[j+1]; arr[i].m02 = this.value[j+2]; arr[i].m10 = this.value[j+3]; arr[i].m11 = this.value[j+4]; arr[i].m12 = this.value[j+5]; arr[i].m20 = this.value[j+6]; arr[i].m21 = this.value[j+7]; arr[i].m22 = this.value[j+8]; } return arr; } Object getRef() { return this.value; } } */ // Wrapper class for Matrix4f static class Matrix4fArrayWrapper extends ArrayWrapper { private float[] value = new float[0]; void set(Object value) { Matrix4f[] arr = (Matrix4f[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new float[this.length * 16]; } for (int i = 0; i < this.length; i++) { int j = i * 16; this.value[j+0] = arr[i].m00; this.value[j+1] = arr[i].m01; this.value[j+2] = arr[i].m02; this.value[j+3] = arr[i].m03; this.value[j+4] = arr[i].m10; this.value[j+5] = arr[i].m11; this.value[j+6] = arr[i].m12; this.value[j+7] = arr[i].m13; this.value[j+8] = arr[i].m20; this.value[j+9] = arr[i].m21; this.value[j+10] = arr[i].m22; this.value[j+11] = arr[i].m23; this.value[j+12] = arr[i].m30; this.value[j+13] = arr[i].m31; this.value[j+14] = arr[i].m32; this.value[j+15] = arr[i].m33; } } void set(int index, Object value) { int j = index * 16; Matrix4f m = (Matrix4f)value; this.value[j+0] = m.m00; this.value[j+1] = m.m01; this.value[j+2] = m.m02; this.value[j+3] = m.m03; this.value[j+4] = m.m10; this.value[j+5] = m.m11; this.value[j+6] = m.m12; this.value[j+7] = m.m13; this.value[j+8] = m.m20; this.value[j+9] = m.m21; this.value[j+10] = m.m22; this.value[j+11] = m.m23; this.value[j+12] = m.m30; this.value[j+13] = m.m31; this.value[j+14] = m.m32; this.value[j+15] = m.m33; } Object get() { Matrix4f[] arr = new Matrix4f[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 16; arr[i] = new Matrix4f(); arr[i].m00 = this.value[j+0]; arr[i].m01 = this.value[j+1]; arr[i].m02 = this.value[j+2]; arr[i].m03 = this.value[j+3]; arr[i].m10 = this.value[j+4]; arr[i].m11 = this.value[j+5]; arr[i].m12 = this.value[j+6]; arr[i].m13 = this.value[j+7]; arr[i].m20 = this.value[j+8]; arr[i].m21 = this.value[j+9]; arr[i].m22 = this.value[j+10]; arr[i].m23 = this.value[j+11]; arr[i].m30 = this.value[j+12]; arr[i].m31 = this.value[j+13]; arr[i].m32 = this.value[j+14]; arr[i].m33 = this.value[j+15]; } return arr; } Object getRef() { return this.value; } } /* // Wrapper class for Matrix4d static class Matrix4dArrayWrapper extends ArrayWrapper { private double[] value = new double[0]; void set(Object value) { Matrix4d[] arr = (Matrix4d[])value; if (this.length != arr.length) { this.length = arr.length; this.value = new double[this.length * 16]; } for (int i = 0; i < this.length; i++) { int j = i * 16; this.value[j+0] = arr[i].m00; this.value[j+1] = arr[i].m01; this.value[j+2] = arr[i].m02; this.value[j+3] = arr[i].m03; this.value[j+4] = arr[i].m10; this.value[j+5] = arr[i].m11; this.value[j+6] = arr[i].m12; this.value[j+7] = arr[i].m13; this.value[j+8] = arr[i].m20; this.value[j+9] = arr[i].m21; this.value[j+10] = arr[i].m22; this.value[j+11] = arr[i].m23; this.value[j+12] = arr[i].m30; this.value[j+13] = arr[i].m31; this.value[j+14] = arr[i].m32; this.value[j+15] = arr[i].m33; } } void set(int index, Object value) { int j = index * 16; Matrix4d m = (Matrix4d)value; this.value[j+0] = m.m00; this.value[j+1] = m.m01; this.value[j+2] = m.m02; this.value[j+3] = m.m03; this.value[j+4] = m.m10; this.value[j+5] = m.m11; this.value[j+6] = m.m12; this.value[j+7] = m.m13; this.value[j+8] = m.m20; this.value[j+9] = m.m21; this.value[j+10] = m.m22; this.value[j+11] = m.m23; this.value[j+12] = m.m30; this.value[j+13] = m.m31; this.value[j+14] = m.m32; this.value[j+15] = m.m33; } Object get() { Matrix4d[] arr = new Matrix4d[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 16; arr[i] = new Matrix4d(); arr[i].m00 = this.value[j+0]; arr[i].m01 = this.value[j+1]; arr[i].m02 = this.value[j+2]; arr[i].m03 = this.value[j+3]; arr[i].m10 = this.value[j+4]; arr[i].m11 = this.value[j+5]; arr[i].m12 = this.value[j+6]; arr[i].m13 = this.value[j+7]; arr[i].m20 = this.value[j+8]; arr[i].m21 = this.value[j+9]; arr[i].m22 = this.value[j+10]; arr[i].m23 = this.value[j+11]; arr[i].m30 = this.value[j+12]; arr[i].m31 = this.value[j+13]; arr[i].m32 = this.value[j+14]; arr[i].m33 = this.value[j+15]; } return arr; } Object getRef() { return this.value; } } */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -