summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/BoxBumpCalc.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/BoxBumpCalc.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/BoxBumpCalc.java')
-rw-r--r--NET/worlds/scape/BoxBumpCalc.java128
1 files changed, 128 insertions, 0 deletions
diff --git a/NET/worlds/scape/BoxBumpCalc.java b/NET/worlds/scape/BoxBumpCalc.java
new file mode 100644
index 0000000..eb71b6b
--- /dev/null
+++ b/NET/worlds/scape/BoxBumpCalc.java
@@ -0,0 +1,128 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.IOException;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class BoxBumpCalc
+/* */ extends BumpCalc
+/* */ {
+/* */ public void detectBump(BumpEventTemp b, WObject owner)
+/* */ {
+/* 53 */ BoundBoxTemp box = owner.getBoundBox();
+/* 54 */ BoundBoxTemp sourceBox = ((WObject)b.source).getBoundBox();
+/* */
+/* 56 */ box.lo.minus(sourceBox.hi.minus(b.sourceAt));
+/* 57 */ box.hi.minus(sourceBox.lo.minus(b.sourceAt));
+/* */
+/* 59 */ Point3Temp pos = Point3Temp.make();
+/* 60 */ pos.x = box.lo.x;
+/* 61 */ pos.y = box.lo.y;
+/* 62 */ float xExtent = box.hi.x - box.lo.x;
+/* 63 */ float yExtent = box.hi.y - box.lo.y;
+/* */
+/* 65 */ Point3Temp d = Point3Temp.make(xExtent, 0.0F, 0.0F);
+/* 66 */ Point3Temp extent = Point3Temp.make(0.0F, yExtent / 2.0F, 0.0F);
+/* */
+/* */
+/* */
+/* */
+/* 71 */ if (b.hitTriRegion(owner, pos, d, extent)) {
+/* 72 */ return;
+/* */ }
+/* 74 */ pos.x = box.hi.x;
+/* 75 */ pos.y = box.hi.y;
+/* 76 */ d.x = (-d.x);
+/* 77 */ extent.y = (-extent.y);
+/* */
+/* 79 */ if (b.hitTriRegion(owner, pos, d, extent)) {
+/* 80 */ return;
+/* */ }
+/* 82 */ pos.y = box.lo.y;
+/* 83 */ d.y = yExtent;
+/* 84 */ d.x = 0.0F;
+/* 85 */ extent.x = (-xExtent / 2.0F);
+/* 86 */ extent.y = 0.0F;
+/* */
+/* 88 */ if (b.hitTriRegion(owner, pos, d, extent)) {
+/* 89 */ return;
+/* */ }
+/* 91 */ pos.x = box.lo.x;
+/* 92 */ pos.y = box.hi.y;
+/* 93 */ d.y = (-d.y);
+/* 94 */ extent.x = (-extent.x);
+/* */
+/* 96 */ if (b.hitTriRegion(owner, pos, d, extent)) {}
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* 104 */ private static Object classCookie = new Object();
+/* */
+/* */ public void saveState(Saver s) throws IOException
+/* */ {
+/* 108 */ s.saveVersion(0, classCookie);
+/* 109 */ super.saveState(s);
+/* */ }
+/* */
+/* */ public void restoreState(Restorer r) throws IOException, TooNewException
+/* */ {
+/* 114 */ switch (r.restoreVersion(classCookie)) {
+/* */ case 0:
+/* 116 */ super.restoreState(r);
+/* 117 */ break;
+/* */ default:
+/* 119 */ throw new TooNewException();
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\BoxBumpCalc.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file