1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.IOException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SpinBehavior
/* */ extends SwitchableBehavior
/* */ implements FrameHandler
/* */ {
/* */ protected float cycleTime;
/* */ protected float ax;
/* */ protected float ay;
/* */ protected float az;
/* */
/* */ public SpinBehavior()
/* */ {
/* 31 */ this(5.0F);
/* */ }
/* */
/* */ public SpinBehavior(float cycleTime)
/* */ {
/* 36 */ this(cycleTime, 0.0F, 0.0F, 1.0F);
/* */ }
/* */
/* */ public SpinBehavior(Point3Temp axis)
/* */ {
/* 41 */ this(5.0F, axis);
/* */ }
/* */
/* */ public SpinBehavior(float ax, float ay, float az)
/* */ {
/* 46 */ this(5.0F, ax, ay, az);
/* */ }
/* */
/* */ public SpinBehavior(float cycleTime, Point3Temp axis)
/* */ {
/* 51 */ this(cycleTime, axis.x, axis.y, axis.z);
/* */ }
/* */
/* */ public SpinBehavior(float cycleTime, float ax, float ay, float az)
/* */ {
/* 56 */ this.cycleTime = cycleTime;
/* 57 */ this.ax = ax;
/* 58 */ this.ay = ay;
/* 59 */ this.az = az;
/* */ }
/* */
/* */
/* */
/* */
/* 65 */ public float getCycleTime() { return this.cycleTime; }
/* 66 */ public void setCycleTime(float t) { this.cycleTime = t; }
/* */
/* 68 */ public Point3Temp getAxis() { return Point3Temp.make(this.ax, this.ay, this.az); }
/* */
/* */ public void setAxis(Point3Temp axis) {
/* 71 */ this.ax = axis.x;
/* 72 */ this.ay = axis.y;
/* 73 */ this.az = axis.z;
/* */ }
/* */
/* */ public boolean handle(FrameEvent e)
/* */ {
/* 78 */ if ((this.enabled) && (this.cycleTime > 0.0F))
/* 79 */ e.receiver.spin(this.ax, this.ay, this.az, 0.36F * e.dt / this.cycleTime);
/* 80 */ return true;
/* */ }
/* */
/* */
/* */
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 89 */ Object ret = null;
/* 90 */ switch (index - offset) {
/* */ case 0:
/* 92 */ if (mode == 0) {
/* 93 */ ret = FloatPropertyEditor.make(
/* 94 */ new Property(this, index, "Cycle Time"));
/* 95 */ } else if (mode == 1) {
/* 96 */ ret = new Float(this.cycleTime);
/* 97 */ } else if (mode == 2)
/* 98 */ this.cycleTime = ((Float)value).floatValue();
/* 99 */ break;
/* */ case 1:
/* 101 */ if (mode == 0) {
/* 102 */ ret = Point3PropertyEditor.make(
/* 103 */ new Property(this, index, "Axis"));
/* 104 */ } else if (mode == 1) {
/* 105 */ ret = new Point3(getAxis());
/* 106 */ } else if (mode == 2)
/* 107 */ setAxis((Point3)value);
/* 108 */ break;
/* */ default:
/* 110 */ ret = super.properties(index, offset + 2, mode, value);
/* */ }
/* 112 */ return ret;
/* */ }
/* */
/* */ public String toString()
/* */ {
/* 117 */ return
/* */
/* 119 */ super.toString() + "[axis " + getAxis() + ", cycleTime " + this.cycleTime + ", enabled " + this.enabled + "]";
/* */ }
/* */
/* 122 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 126 */ s.saveVersion(0, classCookie);
/* 127 */ s.saveFloat(this.cycleTime);
/* 128 */ s.saveFloat(this.ax);
/* 129 */ s.saveFloat(this.ay);
/* 130 */ s.saveFloat(this.az);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 135 */ switch (r.restoreVersion(classCookie)) {
/* */ case 0:
/* 137 */ this.cycleTime = r.restoreFloat();
/* 138 */ this.ax = r.restoreFloat();
/* 139 */ this.ay = r.restoreFloat();
/* 140 */ this.az = r.restoreFloat();
/* 141 */ break;
/* */ default:
/* 143 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SpinBehavior.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|