/* */ 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 */