JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / JU / T3i.js
1 Clazz.declarePackage ("JU");\r
2 c$ = Clazz.decorateAsClass (function () {\r
3 this.x = 0;\r
4 this.y = 0;\r
5 this.z = 0;\r
6 Clazz.instantialize (this, arguments);\r
7 }, JU, "T3i", null, java.io.Serializable);\r
8 Clazz.makeConstructor (c$, \r
9 function () {\r
10 });\r
11 Clazz.defineMethod (c$, "set", \r
12 function (x, y, z) {\r
13 this.x = x;\r
14 this.y = y;\r
15 this.z = z;\r
16 }, "~N,~N,~N");\r
17 Clazz.defineMethod (c$, "setT", \r
18 function (t1) {\r
19 this.x = t1.x;\r
20 this.y = t1.y;\r
21 this.z = t1.z;\r
22 }, "JU.T3i");\r
23 Clazz.defineMethod (c$, "add", \r
24 function (t) {\r
25 this.x += t.x;\r
26 this.y += t.y;\r
27 this.z += t.z;\r
28 }, "JU.T3i");\r
29 Clazz.defineMethod (c$, "scaleAdd", \r
30 function (s, t1, t2) {\r
31 this.x = s * t1.x + t2.x;\r
32 this.y = s * t1.y + t2.y;\r
33 this.z = s * t1.z + t2.z;\r
34 }, "~N,JU.T3i,JU.T3i");\r
35 Clazz.overrideMethod (c$, "hashCode", \r
36 function () {\r
37 return this.x ^ this.y ^ this.z;\r
38 });\r
39 Clazz.overrideMethod (c$, "equals", \r
40 function (o) {\r
41 if (!(Clazz.instanceOf (o, JU.T3i))) return false;\r
42 var t = o;\r
43 return (this.x == t.x && this.y == t.y && this.z == t.z);\r
44 }, "~O");\r
45 Clazz.overrideMethod (c$, "toString", \r
46 function () {\r
47 return "(" + this.x + ", " + this.y + ", " + this.z + ")";\r
48 });\r