1 Clazz.declarePackage ("JU");
2 Clazz.load (["javajs.api.JSONEncodable"], "JU.A4", ["JU.T3"], function () {
3 c$ = Clazz.decorateAsClass (function () {
8 Clazz.instantialize (this, arguments);
9 }, JU, "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) {
17 a.set4 (x, y, z, angle);
20 c$.newAA = Clazz.defineMethod (c$, "newAA",
23 a.set4 (a1.x, a1.y, a1.z, a1.angle);
26 c$.newVA = Clazz.defineMethod (c$, "newVA",
27 function (axis, angle) {
29 a.setVA (axis, angle);
32 Clazz.defineMethod (c$, "setVA",
33 function (axis, angle) {
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 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) {
68 this.angle = Math.atan2 (sin, cos);
69 }}, "~N,~N,~N,~N,~N,~N,~N,~N,~N");
70 Clazz.overrideMethod (c$, "hashCode",
72 return JU.T3.floatToIntBits0 (this.x) ^ JU.T3.floatToIntBits0 (this.y) ^ JU.T3.floatToIntBits0 (this.z) ^ JU.T3.floatToIntBits0 (this.angle);
74 Clazz.overrideMethod (c$, "equals",
76 if (!(Clazz.instanceOf (o, JU.A4))) return false;
78 return this.x == a1.x && this.y == a1.y && this.z == a1.z && this.angle == a1.angle;
80 Clazz.overrideMethod (c$, "toString",
82 return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.angle + ")";
84 Clazz.overrideMethod (c$, "toJSON",
86 return "[" + this.x + "," + this.y + "," + this.z + "," + (this.angle * 180.0 / 3.141592653589793) + "]";