1 Clazz.declarePackage ("javajs.util");
2 Clazz.load (["javajs.util.M34"], "javajs.util.M3", ["javajs.util.T3"], function () {
3 c$ = Clazz.declareType (javajs.util, "M3", javajs.util.M34, java.io.Serializable);
4 c$.newA9 = Clazz.defineMethod (c$, "newA9",
6 var m = new javajs.util.M3 ();
10 c$.newM3 = Clazz.defineMethod (c$, "newM3",
12 var m = new javajs.util.M3 ();
27 Clazz.defineMethod (c$, "setScale",
30 this.m00 = this.m11 = this.m22 = scale;
32 Clazz.defineMethod (c$, "setM3",
35 }, "javajs.util.M34");
36 Clazz.defineMethod (c$, "setA",
48 Clazz.defineMethod (c$, "setElement",
49 function (row, col, v) {
50 this.set33 (row, col, v);
52 Clazz.defineMethod (c$, "getElement",
54 return this.get33 (row, col);
56 Clazz.defineMethod (c$, "setRow",
57 function (row, x, y, z) {
78 Clazz.defineMethod (c$, "setRowV",
99 }, "~N,javajs.util.T3");
100 Clazz.defineMethod (c$, "setRowA",
102 this.setRow33 (row, v);
104 Clazz.overrideMethod (c$, "getRow",
106 this.getRow33 (row, v);
108 Clazz.defineMethod (c$, "setColumn3",
109 function (column, x, y, z) {
130 Clazz.defineMethod (c$, "setColumnV",
131 function (column, v) {
151 }, "~N,javajs.util.T3");
152 Clazz.defineMethod (c$, "getColumnV",
153 function (column, v) {
173 }, "~N,javajs.util.T3");
174 Clazz.defineMethod (c$, "setColumnA",
175 function (column, v) {
176 this.setColumn33 (column, v);
178 Clazz.defineMethod (c$, "getColumn",
179 function (column, v) {
180 this.getColumn33 (column, v);
182 Clazz.defineMethod (c$, "add",
185 }, "javajs.util.M3");
186 Clazz.defineMethod (c$, "sub",
189 }, "javajs.util.M3");
190 Clazz.defineMethod (c$, "transpose",
194 Clazz.defineMethod (c$, "transposeM",
198 }, "javajs.util.M3");
199 Clazz.defineMethod (c$, "invertM",
203 }, "javajs.util.M3");
204 Clazz.defineMethod (c$, "invert",
206 var s = this.determinant3 ();
207 if (s == 0.0) return;
209 this.set9 (this.m11 * this.m22 - this.m12 * this.m21, this.m02 * this.m21 - this.m01 * this.m22, this.m01 * this.m12 - this.m02 * this.m11, this.m12 * this.m20 - this.m10 * this.m22, this.m00 * this.m22 - this.m02 * this.m20, this.m02 * this.m10 - this.m00 * this.m12, this.m10 * this.m21 - this.m11 * this.m20, this.m01 * this.m20 - this.m00 * this.m21, this.m00 * this.m11 - this.m01 * this.m10);
212 Clazz.defineMethod (c$, "setAsXRotation",
214 this.setXRot (angle);
217 Clazz.defineMethod (c$, "setAsYRotation",
219 this.setYRot (angle);
222 Clazz.defineMethod (c$, "setAsZRotation",
224 this.setZRot (angle);
227 Clazz.defineMethod (c$, "scale",
231 Clazz.defineMethod (c$, "mul",
233 this.mul2 (this, m1);
234 }, "javajs.util.M3");
235 Clazz.defineMethod (c$, "mul2",
237 this.set9 (m1.m00 * m2.m00 + m1.m01 * m2.m10 + m1.m02 * m2.m20, m1.m00 * m2.m01 + m1.m01 * m2.m11 + m1.m02 * m2.m21, m1.m00 * m2.m02 + m1.m01 * m2.m12 + m1.m02 * m2.m22, m1.m10 * m2.m00 + m1.m11 * m2.m10 + m1.m12 * m2.m20, m1.m10 * m2.m01 + m1.m11 * m2.m11 + m1.m12 * m2.m21, m1.m10 * m2.m02 + m1.m11 * m2.m12 + m1.m12 * m2.m22, m1.m20 * m2.m00 + m1.m21 * m2.m10 + m1.m22 * m2.m20, m1.m20 * m2.m01 + m1.m21 * m2.m11 + m1.m22 * m2.m21, m1.m20 * m2.m02 + m1.m21 * m2.m12 + m1.m22 * m2.m22);
238 }, "javajs.util.M3,javajs.util.M3");
239 Clazz.overrideMethod (c$, "equals",
241 if (!(Clazz.instanceOf (o, javajs.util.M3))) return false;
243 return this.m00 == m.m00 && this.m01 == m.m01 && this.m02 == m.m02 && this.m10 == m.m10 && this.m11 == m.m11 && this.m12 == m.m12 && this.m20 == m.m20 && this.m21 == m.m21 && this.m22 == m.m22;
245 Clazz.overrideMethod (c$, "hashCode",
247 return javajs.util.T3.floatToIntBits0 (this.m00) ^ javajs.util.T3.floatToIntBits0 (this.m01) ^ javajs.util.T3.floatToIntBits0 (this.m02) ^ javajs.util.T3.floatToIntBits0 (this.m10) ^ javajs.util.T3.floatToIntBits0 (this.m11) ^ javajs.util.T3.floatToIntBits0 (this.m12) ^ javajs.util.T3.floatToIntBits0 (this.m20) ^ javajs.util.T3.floatToIntBits0 (this.m21) ^ javajs.util.T3.floatToIntBits0 (this.m22);
249 Clazz.defineMethod (c$, "setZero",
253 Clazz.defineMethod (c$, "set9",
254 ($fz = function (m00, m01, m02, m10, m11, m12, m20, m21, m22) {
264 }, $fz.isPrivate = true, $fz), "~N,~N,~N,~N,~N,~N,~N,~N,~N");
265 Clazz.overrideMethod (c$, "toString",
267 return "[\n [" + this.m00 + "\t" + this.m01 + "\t" + this.m02 + "]" + "\n [" + this.m10 + "\t" + this.m11 + "\t" + this.m12 + "]" + "\n [" + this.m20 + "\t" + this.m21 + "\t" + this.m22 + "] ]";
269 Clazz.defineMethod (c$, "setAA",
273 }, "javajs.util.A4");
274 Clazz.defineMethod (c$, "setAsBallRotation",
275 function (responseFactor, dx, dy) {
276 var r = Math.sqrt (dx * dx + dy * dy);
277 var th = r * responseFactor;
281 }var c = Math.cos (th);
282 var s = Math.sin (th);
286 this.m00 = 1 + c1 * nx * nx;
287 this.m01 = this.m10 = c1 * nx * ny;
288 this.m20 = -(this.m02 = s * nx);
289 this.m11 = 1 + c1 * ny * ny;
290 this.m21 = -(this.m12 = s * ny);
294 Clazz.defineMethod (c$, "isRotation",
296 return (Math.abs (this.determinant3 () - 1) < 0.001);