1 Clazz.declarePackage ("javajs.util");
2 Clazz.load (["javajs.api.JSONEncodable"], "javajs.util.A4", ["javajs.util.T3"], function () {
3 c$ = Clazz.decorateAsClass (function () {
8 Clazz.instantialize (this, arguments);
9 }, javajs.util, "A4", null, [javajs.api.JSONEncodable, java.io.Serializable]);
10 Clazz.makeConstructor (c$,
14 c$.new4 = Clazz.defineMethod (c$, "new4",
15 function (x, y, z, angle) {
16 var a = new javajs.util.A4 ();
17 a.set4 (x, y, z, angle);
20 c$.newAA = Clazz.defineMethod (c$, "newAA",
22 var a = new javajs.util.A4 ();
23 a.set4 (a1.x, a1.y, a1.z, a1.angle);
26 c$.newVA = Clazz.defineMethod (c$, "newVA",
27 function (axis, angle) {
28 var a = new javajs.util.A4 ();
29 a.setVA (axis, angle);
31 }, "javajs.util.V3,~N");
32 Clazz.defineMethod (c$, "setVA",
33 function (axis, angle) {
38 }, "javajs.util.V3,~N");
39 Clazz.defineMethod (c$, "set4",
40 function (x, y, z, angle) {
46 Clazz.defineMethod (c$, "setAA",
53 Clazz.defineMethod (c$, "setM",
55 this.setFromMat (m1.m00, m1.m01, m1.m02, m1.m10, m1.m11, m1.m12, m1.m20, m1.m21, m1.m22);
57 Clazz.defineMethod (c$, "setFromMat",
58 ($fz = function (m00, m01, m02, m10, m11, m12, m20, m21, m22) {
59 var cos = (m00 + m11 + m22 - 1.0) * 0.5;
63 var sin = 0.5 * Math.sqrt (this.x * this.x + this.y * this.y + this.z * this.z);
64 if (sin == 0 && cos == 1) {
69 this.angle = Math.atan2 (sin, cos);
70 }}, $fz.isPrivate = true, $fz), "~N,~N,~N,~N,~N,~N,~N,~N,~N");
71 Clazz.overrideMethod (c$, "hashCode",
73 return javajs.util.T3.floatToIntBits0 (this.x) ^ javajs.util.T3.floatToIntBits0 (this.y) ^ javajs.util.T3.floatToIntBits0 (this.z) ^ javajs.util.T3.floatToIntBits0 (this.angle);
75 Clazz.overrideMethod (c$, "equals",
77 if (!(Clazz.instanceOf (o, javajs.util.A4))) return false;
79 return this.x == a1.x && this.y == a1.y && this.z == a1.z && this.angle == a1.angle;
81 Clazz.overrideMethod (c$, "toString",
83 return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.angle + ")";
85 Clazz.overrideMethod (c$, "toJSON",
87 return "[" + this.x + "," + this.y + "," + this.z + "," + (this.angle * 180.0 / 3.141592653589793) + "]";