summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/PostspinBehavior.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/PostspinBehavior.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/PostspinBehavior.java')
-rw-r--r--NET/worlds/scape/PostspinBehavior.java141
1 files changed, 141 insertions, 0 deletions
diff --git a/NET/worlds/scape/PostspinBehavior.java b/NET/worlds/scape/PostspinBehavior.java
new file mode 100644
index 0000000..918076d
--- /dev/null
+++ b/NET/worlds/scape/PostspinBehavior.java
@@ -0,0 +1,141 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.IOException;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class PostspinBehavior
+/* */ extends SpinBehavior
+/* */ implements FrameHandler
+/* */ {
+/* */ private float xCenter;
+/* */ private float yCenter;
+/* */ private float zCenter;
+/* */
+/* */ public PostspinBehavior(float x, float y, float z, float cycleTime)
+/* */ {
+/* 28 */ this(x, y, z, 0.0F, 0.0F, 1.0F, cycleTime);
+/* */ }
+/* */
+/* */
+/* */ public PostspinBehavior(float x, float y, float z, float ax, float ay, float az)
+/* */ {
+/* 34 */ this(x, y, z, ax, ay, az, 5.0F);
+/* */ }
+/* */
+/* */
+/* */ public PostspinBehavior(float x, float y, float z, float ax, float ay, float az, float cycleTime)
+/* */ {
+/* 40 */ super(cycleTime, ax, ay, az);
+/* 41 */ this.xCenter = x;
+/* 42 */ this.yCenter = y;
+/* 43 */ this.zCenter = z;
+/* */ }
+/* */
+/* */
+/* */
+/* */ public PostspinBehavior() {}
+/* */
+/* */
+/* */
+/* 52 */ public float getXCenter() { return this.xCenter; }
+/* 53 */ public float getYCenter() { return this.yCenter; }
+/* 54 */ public float getZCenter() { return this.zCenter; }
+/* */
+/* */
+/* 57 */ public Point3Temp getCenter() { return Point3Temp.make(this.xCenter, this.yCenter, this.zCenter); }
+/* */
+/* 59 */ public void setXCenter(float c) { this.xCenter = c; }
+/* 60 */ public void setYCenter(float c) { this.yCenter = c; }
+/* 61 */ public void setZCenter(float c) { this.zCenter = c; }
+/* */
+/* */ public void setCenter(Point3Temp center) {
+/* 64 */ this.xCenter = center.x;
+/* 65 */ this.yCenter = center.y;
+/* 66 */ this.zCenter = center.z;
+/* */ }
+/* */
+/* */ public boolean handle(FrameEvent e)
+/* */ {
+/* 71 */ if ((this.enabled) && (this.cycleTime > 0.0F))
+/* */ {
+/* 73 */ e.receiver.moveBy(-this.xCenter, -this.yCenter, -this.zCenter);
+/* 74 */ e.receiver.postspin(this.ax, this.ay, this.az, 0.36F * e.dt / this.cycleTime);
+/* 75 */ e.receiver.moveBy(this.xCenter, this.yCenter, this.zCenter);
+/* */ }
+/* 77 */ return true;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public Object properties(int index, int offset, int mode, Object value)
+/* */ throws NoSuchPropertyException
+/* */ {
+/* 86 */ Object ret = null;
+/* 87 */ switch (index - offset) {
+/* */ case 0:
+/* 89 */ if (mode == 0) {
+/* 90 */ ret = Point3PropertyEditor.make(
+/* 91 */ new Property(this, index, "Center"));
+/* 92 */ } else if (mode == 1) {
+/* 93 */ ret = new Point3(getCenter());
+/* 94 */ } else if (mode == 2)
+/* 95 */ setCenter((Point3)value);
+/* 96 */ break;
+/* */ default:
+/* 98 */ ret = super.properties(index, offset + 1, mode, value);
+/* */ }
+/* 100 */ return ret;
+/* */ }
+/* */
+/* */ public String toString()
+/* */ {
+/* 105 */ return
+/* */
+/* */
+/* 108 */ super.toString() + "[center " + getCenter() + ", axis " + getAxis() + ", cycleTime " + this.cycleTime + ", enabled " + this.enabled + "]";
+/* */ }
+/* */
+/* 111 */ private static Object classCookie = new Object();
+/* */
+/* */ public void saveState(Saver s) throws IOException
+/* */ {
+/* 115 */ s.saveVersion(0, classCookie);
+/* 116 */ super.saveState(s);
+/* 117 */ s.saveFloat(this.xCenter);
+/* 118 */ s.saveFloat(this.yCenter);
+/* 119 */ s.saveFloat(this.zCenter);
+/* */ }
+/* */
+/* */ public void restoreState(Restorer r) throws IOException, TooNewException
+/* */ {
+/* 124 */ switch (r.restoreVersion(classCookie)) {
+/* */ case 0:
+/* 126 */ super.restoreState(r);
+/* 127 */ this.xCenter = r.restoreFloat();
+/* 128 */ this.yCenter = r.restoreFloat();
+/* 129 */ this.zCenter = r.restoreFloat();
+/* 130 */ break;
+/* */ default:
+/* 132 */ throw new TooNewException();
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\PostspinBehavior.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file