diff options
Diffstat (limited to 'NET/worlds/scape/HoloPilot.java')
| -rw-r--r-- | NET/worlds/scape/HoloPilot.java | 956 |
1 files changed, 956 insertions, 0 deletions
diff --git a/NET/worlds/scape/HoloPilot.java b/NET/worlds/scape/HoloPilot.java new file mode 100644 index 0000000..a96a64c --- /dev/null +++ b/NET/worlds/scape/HoloPilot.java @@ -0,0 +1,956 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.core.Std; +/* */ import NET.worlds.network.URL; +/* */ import java.io.IOException; +/* */ import java.util.Enumeration; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class HoloPilot +/* */ extends Pilot +/* */ implements AnimatedActionHandler, AnimatedActionCallback +/* */ { +/* */ private Camera cam; +/* */ private SmoothDriver smoothDriver; +/* */ +/* */ public HoloPilot(URL movURL) +/* */ { +/* 69 */ setSourceURL(movURL); +/* */ +/* 71 */ loadInit(); +/* */ } +/* */ +/* */ public void setSleepMode(String mode) +/* */ { +/* 76 */ Drone d = getInternalDrone(); +/* 77 */ if (d != null) { +/* 78 */ d.setSleepMode(mode); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public float animate(String action) +/* */ { +/* 87 */ super.animate(action); +/* */ +/* 89 */ Drone d = getInternalDrone(); +/* 90 */ if (d != null) { +/* 91 */ return d.animate(action); +/* */ } +/* 93 */ return 0.0F; +/* */ } +/* */ +/* */ public Vector<String> getAnimationList() +/* */ { +/* 98 */ Vector<String> v = super.getAnimationList(); +/* */ +/* 100 */ Drone d = getInternalDrone(); +/* 101 */ if (d == null) { +/* 102 */ return v; +/* */ } +/* */ +/* */ +/* 106 */ Vector<String> clone = (Vector)d.getAnimationList().clone(); +/* 107 */ Vector<String> v2 = clone; +/* 108 */ for (int i = 0; i < v.size(); i++) { +/* 109 */ v2.addElement((String)v.elementAt(i)); +/* */ } +/* 111 */ return v2; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 122 */ private boolean cameraIsFree = false; +/* */ private AnimatedActionHandlerImp handler; +/* */ +/* */ public HoloPilot() {} +/* */ +/* 127 */ public void loadInit() { this.smoothDriver = new SmoothDriver(); +/* 128 */ this.smoothDriver.setEyeHeight(0.0F); +/* */ +/* 130 */ this.cam = new Camera(); +/* 131 */ add(this.cam); +/* */ +/* 133 */ Drone selfImage = Drone.make(null, null); +/* 134 */ add(selfImage); +/* */ +/* 136 */ selfImage.setAvatarNow(getSourceURL()); +/* */ +/* 138 */ addHandler(this.smoothDriver); +/* 139 */ addHandler(new PitchDriver()); +/* */ +/* 141 */ this.handler = new AnimatedActionHandlerImp(); +/* */ +/* 143 */ setEyeHeight(150.0F); +/* */ } +/* */ +/* */ +/* */ private HandsOffDriver hod; +/* */ String lastName; +/* */ Transform lastInverse; +/* */ public void addCallback(AnimatedActionCallback c) +/* */ { +/* 152 */ assert (this.handler != null); +/* 153 */ this.handler.addCallback(c); +/* */ } +/* */ +/* */ public void removeCallback(AnimatedActionCallback c) +/* */ { +/* 158 */ assert (this.handler != null); +/* 159 */ this.handler.removeCallback(c); +/* */ } +/* */ +/* */ public void notifyCallbacks(int completionCode) +/* */ { +/* 164 */ assert (this.handler != null); +/* 165 */ this.handler.notifyCallbacks(completionCode); +/* */ } +/* */ +/* */ public void walkTo(Point2 destPoint, float destYaw) +/* */ { +/* 170 */ walkTo(destPoint, destYaw, 80.0F); +/* */ } +/* */ +/* */ public void walkTo(Point2 destPoint, float yaw, float velocity) +/* */ { +/* 175 */ removeHandler(this.smoothDriver); +/* 176 */ this.hod = new HandsOffDriver(); +/* 177 */ this.hod.setDestPos(destPoint, yaw, velocity); +/* 178 */ this.hod.addCallback(this); +/* 179 */ addHandler(this.hod); +/* */ } +/* */ +/* */ public void removeSmoothDriver() +/* */ { +/* 184 */ removeHandler(this.smoothDriver); +/* */ } +/* */ +/* */ public void returnSmoothDriver() +/* */ { +/* 189 */ addHandler(this.smoothDriver); +/* */ } +/* */ +/* */ public SmoothDriver getSmoothDriver() +/* */ { +/* 194 */ return this.smoothDriver; +/* */ } +/* */ +/* */ public void removeHandsOffDriver() +/* */ { +/* 199 */ if (this.hod != null) +/* */ { +/* 201 */ removeHandler(this.hod); +/* 202 */ this.hod = null; +/* */ } +/* */ } +/* */ +/* */ public void returnHandsOffDriver() +/* */ { +/* 208 */ if (this.hod == null) +/* */ { +/* 210 */ this.hod = new HandsOffDriver(); +/* 211 */ addHandler(this.hod); +/* */ } +/* */ } +/* */ +/* */ +/* */ public void motionComplete(int completionCode) +/* */ { +/* 218 */ removeHandler(this.hod); +/* 219 */ this.hod = null; +/* 220 */ addHandler(this.smoothDriver); +/* */ +/* 222 */ notifyCallbacks(completionCode); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void updateName() +/* */ { +/* 231 */ String name = getLongID(); +/* 232 */ if (name == null) +/* 233 */ return; +/* 234 */ if ((this.lastName != null) && (this.lastName.equals(name))) +/* 235 */ return; +/* 236 */ this.lastName = name; +/* */ +/* */ +/* 239 */ Drone d = getInternalDrone(); +/* 240 */ if (d != null) { +/* 241 */ d.setName(name); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public Drone getInternalDrone() +/* */ { +/* 249 */ for (Enumeration<WObject> e = getContents(); e.hasMoreElements();) +/* */ { +/* 251 */ Object o = e.nextElement(); +/* 252 */ if ((o instanceof Drone)) +/* 253 */ return (Drone)o; +/* */ } +/* 255 */ return null; +/* */ } +/* */ +/* */ +/* */ Point3 lastCamWorldPos; +/* */ float lastCamRadius; +/* */ float lastCamYaw; +/* */ int lastDrawTime; +/* 263 */ int framesSinceMoved = 0; +/* */ Room lastCamRoom; +/* */ +/* */ private void setLastInverse(Transform t) +/* */ { +/* 268 */ if (this.lastInverse != null) +/* 269 */ this.lastInverse.recycle(); +/* 270 */ this.lastInverse = t; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void transferFrom(Pilot old) +/* */ { +/* 280 */ if ((old == null) || (!(old instanceof HoloPilot))) +/* */ { +/* 282 */ super.transferFrom(old); +/* 283 */ return; +/* */ } +/* */ +/* 286 */ HoloPilot o = (HoloPilot)old; +/* */ +/* */ +/* 289 */ setOutsideCameraMode(o.getOutsideCameraMode(), +/* 290 */ o.getOutsideCameraSpeed()); +/* */ +/* 292 */ super.transferFrom(old); +/* */ +/* */ +/* 295 */ if (o.lastCamWorldPos != null) { +/* 296 */ setLastInverse(o.lastInverse.getTransform()); +/* 297 */ this.lastCamWorldPos = new Point3(o.lastCamWorldPos); +/* */ } +/* */ +/* 300 */ this.lastCamRoom = o.lastCamRoom; +/* 301 */ this.lastCamRadius = o.lastCamRadius; +/* 302 */ this.lastCamYaw = o.lastCamYaw; +/* 303 */ this.lastDrawTime = o.lastDrawTime; +/* 304 */ this.framesSinceMoved = o.framesSinceMoved; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void aboutToDraw() +/* */ { +/* 338 */ if ((this.cameraMode == 1) || +/* 339 */ (this.cameraMode == 2)) +/* */ { +/* 341 */ this.lastCamWorldPos = null; +/* 342 */ this.cam.makeIdentity(); +/* 343 */ return; +/* */ } +/* */ +/* 346 */ if (this.cameraIsFree) +/* */ { +/* 348 */ return; +/* */ } +/* */ +/* 351 */ Transform world = getObjectToWorldMatrix(); +/* 352 */ int thisDrawTime = Std.getRealTime(); +/* */ +/* */ +/* */ +/* */ +/* 357 */ Room thisCamRoom = getRoom(); +/* */ +/* 359 */ Transform inv = world.getTransform().invert(); +/* */ float radius; +/* 361 */ float yaw; if ((this.lastCamWorldPos != null) && +/* 362 */ (this.cameraSpeed != 4) && +/* 363 */ (this.cameraMode != 99)) { +/* */ float radius; +/* 365 */ if (thisCamRoom != this.lastCamRoom) +/* */ { +/* */ +/* */ +/* 369 */ float yaw = this.lastCamYaw; +/* 370 */ radius = this.lastCamRadius; +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* 376 */ Point3 p = this.lastCamWorldPos; +/* 377 */ p.times(inv); +/* */ +/* 379 */ float radius = (float)Math.sqrt(p.x * p.x + p.y * p.y); +/* */ +/* 381 */ if (radius > this.defaultCameraRadius + 10.0F) { +/* 382 */ radius = this.defaultCameraRadius + 10.0F; +/* */ } +/* 384 */ if (this.cameraSpeed == 3) { +/* 385 */ radius = this.defaultCameraRadius; +/* */ } +/* 387 */ float yaw = (float)(Math.atan2(p.y, p.x) * 180.0D / 3.141592653589793D); +/* */ +/* */ +/* 390 */ this.lastInverse.post(world); +/* 391 */ float yawMove = this.lastInverse.getYaw(); +/* 392 */ if (yawMove > 180.0F) +/* 393 */ yawMove -= 360.0F; +/* 394 */ Point3Temp lip = this.lastInverse.getPosition(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 401 */ if ((this.cameraSpeed != 1) || ( +/* 402 */ (Math.abs(yawMove) < 1.0F) && +/* 403 */ (lip.x * lip.x + lip.y * lip.y < 1.0F))) +/* */ { +/* 405 */ if (++this.framesSinceMoved > 2) +/* */ { +/* 407 */ float dyaw = this.defaultCameraYaw - yaw; +/* 408 */ if (dyaw < -180.0F) { +/* 409 */ dyaw += 360.0F; +/* 410 */ } else if (dyaw > 180.0F) +/* 411 */ dyaw -= 360.0F; +/* 412 */ float drad = this.defaultCameraRadius - radius; +/* 413 */ float dtime = thisDrawTime - this.lastDrawTime; +/* */ +/* */ +/* */ +/* */ +/* 418 */ float maxYawCorrection = 0.04F; +/* 419 */ float maxRadCorrection = 0.03F; +/* */ +/* 421 */ if (Math.abs(dyaw) > 1500.0F * maxYawCorrection) { +/* 422 */ maxYawCorrection *= 1.5F; +/* */ } +/* 424 */ maxYawCorrection *= dtime; +/* 425 */ if (dyaw < -maxYawCorrection) { +/* 426 */ dyaw = -maxYawCorrection; +/* 427 */ } else if (dyaw > maxYawCorrection) { +/* 428 */ dyaw = maxYawCorrection; +/* */ } +/* 430 */ maxRadCorrection *= dtime; +/* 431 */ if (drad < -maxRadCorrection) { +/* 432 */ drad = -maxRadCorrection; +/* 433 */ } else if (drad > maxRadCorrection) { +/* 434 */ drad = maxRadCorrection; +/* */ } +/* 436 */ yaw += dyaw; +/* 437 */ radius += drad; +/* */ +/* 439 */ if (this.cameraSpeed == 3) +/* */ { +/* 441 */ if (yaw > this.defaultCameraYaw + 40.0F) { +/* 442 */ yaw = this.defaultCameraYaw + 40.0F; +/* 443 */ } else if (yaw < this.defaultCameraYaw - 40.0F) +/* 444 */ yaw = this.defaultCameraYaw - 40.0F; +/* */ } +/* */ } +/* */ } else { +/* 448 */ this.framesSinceMoved = 0; +/* */ } +/* */ } +/* */ } +/* */ else { +/* 453 */ this.lastCamWorldPos = new Point3(); +/* 454 */ radius = this.defaultCameraRadius; +/* 455 */ yaw = this.defaultCameraYaw; +/* */ } +/* */ +/* 458 */ setLastInverse(inv); +/* */ +/* 460 */ float hackedZ = this.aimPoint.z; +/* 461 */ float hackedYaw = yaw; +/* 462 */ float hackedRadius = radius; +/* */ +/* */ +/* 465 */ if (this.hod != null) +/* */ { +/* 467 */ hackedYaw += this.hod.getCameraPan(); +/* 468 */ hackedRadius += this.hod.getCameraZoom(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 474 */ if (hackedRadius < this.defaultCameraRadius) +/* */ { +/* 476 */ hackedZ -= (this.defaultCameraRadius - hackedRadius) * this.smoothDriver.getEyeHeight() / this.defaultCameraRadius; +/* */ } +/* */ } +/* */ +/* */ +/* 481 */ this.cam.makeIdentity().post(this.defaultTransform); +/* 482 */ this.cam.moveBy(hackedRadius, 0.0F, 0.0F); +/* 483 */ this.cam.postspin(0.0F, 0.0F, 1.0F, hackedYaw); +/* 484 */ this.cam.moveBy(this.aimPoint.x, this.aimPoint.y, hackedZ); +/* 485 */ this.lastCamRadius = radius; +/* 486 */ this.lastCamYaw = yaw; +/* */ +/* 488 */ double angle = yaw * 3.141592653589793D / 180.0D; +/* 489 */ this.lastCamWorldPos.x = ((float)(radius * Math.cos(angle))); +/* 490 */ this.lastCamWorldPos.y = ((float)(radius * Math.sin(angle))); +/* 491 */ this.lastCamWorldPos.z = 0.0F; +/* */ +/* 493 */ this.lastCamWorldPos.times(world); +/* 494 */ this.lastCamWorldPos.z = 0.0F; +/* 495 */ this.lastDrawTime = thisDrawTime; +/* 496 */ this.lastCamRoom = thisCamRoom; +/* */ +/* 498 */ world.recycle(); +/* */ } +/* */ +/* 501 */ Transform defaultTransform = Transform.make(); +/* 502 */ Point3 aimPoint = new Point3(0.0F, 0.0F, 0.0F); +/* 503 */ float defaultCameraYaw = 0.0F; +/* */ +/* */ +/* 506 */ float defaultCameraRadius = 0.0F; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_VEHICLE = 99; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_FIRST_PERSON = 1; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_LOW_FIRST_PERSON = 2; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_WAIST = 3; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_SHOULDER = 4; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_HEAD = 5; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_OVERHEAD = 6; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_BEHIND = 7; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_WIDESHOT = 8; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_MODE_ORTHOGRAPHIC = 9; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_SPEED_SLOW = 1; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_SPEED_MEDIUM = 2; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_SPEED_FAST = 3; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static final int CAM_SPEED_LOCKED = 4; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void setOutsideCameraMode(int camMode, int camSpeed) +/* */ { +/* 630 */ this.defaultTransform.makeIdentity(); +/* 631 */ this.aimPoint.x = 0.0F; +/* 632 */ this.aimPoint.y = 0.0F; +/* 633 */ this.aimPoint.z = 0.0F; +/* 634 */ setEyeHeight(150.0F); +/* */ +/* */ +/* 637 */ if ((getInternalDrone() != null) && +/* 638 */ ((getInternalDrone() instanceof PosableDrone))) +/* */ { +/* 640 */ PosableShape ps = ((PosableDrone)getInternalDrone()) +/* 641 */ .getInternalPosableShape(); +/* 642 */ if ((ps != null) && ((ps instanceof VehicleShape))) +/* */ { +/* 644 */ VehicleShape vs = (VehicleShape)ps; +/* 645 */ if (vs.fixedCamera) +/* */ { +/* */ +/* */ +/* */ +/* 650 */ this.defaultTransform.moveTo(vs.camX, vs.camY, vs.camZ).postspin(1.0F, 0.0F, 0.0F, vs.camRoll).postspin(0.0F, 1.0F, 0.0F, vs.camYaw).postspin(0.0F, 0.0F, 1.0F, vs.camPitch); +/* 651 */ this.aimPoint.x = vs.camAimX; +/* 652 */ this.aimPoint.y = vs.camAimY; +/* 653 */ this.aimPoint.z = vs.camAimZ; +/* 654 */ setEyeHeight(vs.eyeHeight); +/* 655 */ camMode = 99; +/* */ } +/* */ } +/* */ } +/* */ +/* 660 */ this.cam.setAlwaysClearBackground(false); +/* 661 */ this.cam.setBumpable(true); +/* */ +/* */ +/* 664 */ switch (camMode) +/* */ { +/* */ +/* */ case 3: +/* 668 */ this.defaultTransform.moveTo(0.0F, -120.0F, -60.0F).postspin(1.0F, 0.0F, 0.0F, -10.0F).postspin(0.0F, 0.0F, 1.0F, 30.0F); +/* 669 */ this.aimPoint.x = 15.0F; +/* 670 */ this.aimPoint.z = -10.0F; +/* 671 */ break; +/* */ +/* */ case 4: +/* 674 */ this.defaultTransform.moveTo(0.0F, -140.0F, -40.0F).postspin(1.0F, 0.0F, 0.0F, -10.0F).postspin(0.0F, 0.0F, 1.0F, 15.0F); +/* 675 */ this.aimPoint.x = 15.0F; +/* 676 */ this.aimPoint.z = 10.0F; +/* 677 */ break; +/* */ +/* */ case 5: +/* 680 */ this.defaultTransform.moveTo(0.0F, -140.0F, 0.0F).postspin(1.0F, 0.0F, 0.0F, -10.0F).postspin(0.0F, 0.0F, 1.0F, 15.0F); +/* 681 */ this.aimPoint.x = 15.0F; +/* 682 */ this.aimPoint.z = 10.0F; +/* 683 */ break; +/* */ +/* */ case 6: +/* 686 */ this.defaultTransform.moveTo(0.0F, -100.0F, 0.0F).postspin(1.0F, 0.0F, 0.0F, -30.0F).postspin(0.0F, 0.0F, 1.0F, 30.0F); +/* 687 */ this.aimPoint.x = 15.0F; +/* 688 */ this.aimPoint.z = 10.0F; +/* 689 */ break; +/* */ case 7: +/* 691 */ this.defaultTransform.moveTo(0.0F, -140.0F, 0.0F).postspin(1.0F, 0.0F, 0.0F, -10.0F); +/* 692 */ break; +/* */ +/* */ case 8: +/* 695 */ this.defaultTransform.moveTo(0.0F, -220.0F, -40.0F).postspin(1.0F, 0.0F, 0.0F, -30.0F).postspin(0.0F, 0.0F, 1.0F, 30.0F); +/* 696 */ this.aimPoint.x = 15.0F; +/* 697 */ this.aimPoint.z = 10.0F; +/* 698 */ break; +/* */ case 9: +/* 700 */ this.defaultTransform.moveTo(0.0F, -140.0F, 300.0F).postspin(1.0F, 0.0F, 0.0F, -10.0F); +/* 701 */ this.aimPoint.x = 0.0F; +/* 702 */ this.aimPoint.z = 300.0F; +/* 703 */ this.cam.setAlwaysClearBackground(true); +/* 704 */ this.cam.setBumpable(false); +/* 705 */ camSpeed = 4; +/* 706 */ break; +/* */ case 99: +/* */ break; +/* */ default: +/* 710 */ camMode = 1; +/* 711 */ camSpeed = 3; +/* 712 */ this.defaultCameraRadius = 0.0F; +/* 713 */ this.defaultCameraYaw = 0.0F; +/* 714 */ break; +/* */ case 1: +/* */ break; +/* */ case 2: +/* 718 */ setEyeHeight(100.0F); +/* */ } +/* */ +/* */ +/* */ +/* 723 */ if ((camMode != 1) && +/* 724 */ (camMode != 2)) +/* */ { +/* 726 */ float x = this.defaultTransform.getX(); +/* 727 */ float y = this.defaultTransform.getY(); +/* 728 */ this.aimPoint.z += this.defaultTransform.getZ(); +/* */ +/* 730 */ this.defaultCameraRadius = ((float)Math.sqrt(x * x + y * y)); +/* 731 */ this.defaultCameraYaw = ((float)(Math.atan2(y, x) * 180.0D / 3.141592653589793D)); +/* */ +/* */ +/* 734 */ this.defaultTransform.moveTo(0.0F, 0.0F, 0.0F); +/* 735 */ this.defaultTransform.postspin(0.0F, 0.0F, 1.0F, -this.defaultCameraYaw); +/* */ } +/* */ +/* 738 */ super.setOutsideCameraMode(camMode, camSpeed); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 744 */ private boolean substWarned = false; +/* */ +/* */ +/* */ +/* */ public void resetAvatarNow() +/* */ { +/* 750 */ URL to = getSourceURL(); +/* 751 */ Drone d = getInternalDrone(); +/* */ +/* 753 */ d.setAvatarNow(to); +/* */ +/* */ +/* 756 */ if ((!d.shouldBeForcedHuman()) || (PosableShape.getHuman(to).equals(to))) { +/* 757 */ this.substWarned = false; +/* */ } +/* 759 */ else if (!this.substWarned) { +/* 760 */ this.substWarned = true; +/* 761 */ Console.println(Console.message("Sub-human")); +/* */ } +/* */ } +/* */ +/* */ +/* */ public void setEyeHeight(float h) +/* */ { +/* 768 */ float hOld = this.smoothDriver.getEyeHeight(); +/* 769 */ if (h != hOld) +/* */ { +/* 771 */ this.smoothDriver.setEyeHeight(h); +/* 772 */ getInternalDrone().moveBy(0.0F, 0.0F, hOld - h); +/* 773 */ setLocalBoundBox(Point3Temp.make(-30.0F, -30.0F, -h), +/* 774 */ Point3Temp.make(30.0F, 50.0F, 20.0F)); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 781 */ protected Point3 boxLo = new Point3(); +/* 782 */ protected Point3 boxHi = new Point3(); +/* */ +/* */ public BoundBoxTemp getLocalBoundBox() +/* */ { +/* 786 */ return BoundBoxTemp.make(this.boxLo, this.boxHi); +/* */ } +/* */ +/* */ public void setLocalBoundBox(BoundBoxTemp b) +/* */ { +/* 791 */ this.boxLo = new Point3(b.lo); +/* 792 */ this.boxHi = new Point3(b.hi); +/* */ } +/* */ +/* */ public void setLocalBoundBox(Point3Temp lo, Point3Temp hi) +/* */ { +/* 797 */ setLocalBoundBox(BoundBoxTemp.make(lo, hi)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public BoundBoxTemp getBoundBox() +/* */ { +/* 811 */ Point3Temp lo = Point3Temp.make(this.boxLo); +/* 812 */ lo.z += this.stepHeight; +/* 813 */ Point3Temp hi = this.boxHi; +/* */ +/* 815 */ Transform xfrm = getObjectToWorldMatrix(); +/* 816 */ Point3Temp p = Point3Temp.make(lo).times(xfrm); +/* 817 */ BoundBoxTemp w = BoundBoxTemp.make(p, p); +/* 818 */ w.encompass(Point3Temp.make(hi).times(xfrm)); +/* 819 */ w.encompass(Point3Temp.make(lo.x, lo.y, hi.z).times(xfrm)); +/* 820 */ w.encompass(Point3Temp.make(lo.x, hi.y, lo.z).times(xfrm)); +/* 821 */ w.encompass(Point3Temp.make(lo.x, hi.y, hi.z).times(xfrm)); +/* 822 */ w.encompass(Point3Temp.make(hi.x, lo.y, lo.z).times(xfrm)); +/* 823 */ w.encompass(Point3Temp.make(hi.x, lo.y, hi.z).times(xfrm)); +/* 824 */ w.encompass(Point3Temp.make(hi.x, hi.y, lo.z).times(xfrm)); +/* 825 */ xfrm.recycle(); +/* */ +/* 827 */ return w; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public float getFootHeight() +/* */ { +/* 836 */ if (isActive()) +/* */ { +/* 838 */ Transform t = getObjectToWorldMatrix(); +/* */ +/* */ +/* */ +/* 842 */ float pitch = t.getPitch(); +/* 843 */ t.pitch(-pitch); +/* 844 */ float ret = Point3Temp.make(this.boxLo).times(t).z; +/* 845 */ t.recycle(); +/* 846 */ return ret; +/* */ } +/* */ +/* 849 */ return 0.0F; +/* */ } +/* */ +/* */ +/* 853 */ protected float stepHeight = 30.0F; +/* */ +/* */ public float getStepHeight() +/* */ { +/* 857 */ return this.stepHeight; +/* */ } +/* */ +/* */ public void setStepHeight(float h) +/* */ { +/* 862 */ this.stepHeight = h; +/* */ } +/* */ +/* */ public void releaseCamera() +/* */ { +/* 867 */ this.cameraIsFree = true; +/* */ } +/* */ +/* */ public void reclaimCamera() +/* */ { +/* 872 */ this.cameraIsFree = false; +/* */ } +/* */ +/* */ public Camera getCamera() +/* */ { +/* 877 */ return this.cam; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 886 */ Object ret = null; +/* 887 */ switch (index - offset) { +/* */ case 0: +/* 889 */ if (mode == 0) { +/* 890 */ ret = Point3PropertyEditor.make( +/* 891 */ new Property(this, index, "Bump Box Start")); +/* 892 */ } else if (mode == 1) { +/* 893 */ ret = new Point3(this.boxLo); +/* 894 */ } else if (mode == 2) +/* 895 */ this.boxLo = new Point3((Point3)value); +/* 896 */ break; +/* */ +/* */ case 1: +/* 899 */ if (mode == 0) { +/* 900 */ ret = Point3PropertyEditor.make( +/* 901 */ new Property(this, index, "Bump Box End")); +/* 902 */ } else if (mode == 1) { +/* 903 */ ret = new Point3(this.boxHi); +/* 904 */ } else if (mode == 2) +/* 905 */ this.boxHi = new Point3((Point3)value); +/* 906 */ break; +/* */ +/* */ case 2: +/* 909 */ if (mode == 0) { +/* 910 */ ret = FloatPropertyEditor.make( +/* 911 */ new Property(this, index, "Step Height")); +/* 912 */ } else if (mode == 1) { +/* 913 */ ret = new Float(getStepHeight()); +/* 914 */ } else if (mode == 2) +/* 915 */ setStepHeight(((Float)value).floatValue()); +/* 916 */ break; +/* */ +/* */ default: +/* 919 */ ret = super.properties(index, offset + 3, mode, value); +/* */ } +/* 921 */ return ret; +/* */ } +/* */ +/* */ +/* 925 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException +/* */ { +/* 929 */ s.saveVersion(0, classCookie); +/* 930 */ super.saveState(s); +/* 931 */ s.saveFloat(this.stepHeight); +/* 932 */ s.save(this.boxLo); +/* 933 */ s.save(this.boxHi); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) throws IOException, TooNewException +/* */ { +/* 938 */ switch (r.restoreVersion(classCookie)) { +/* */ case 0: +/* 940 */ super.restoreState(r); +/* 941 */ this.stepHeight = r.restoreFloat(); +/* 942 */ this.boxLo = ((Point3)r.restore()); +/* 943 */ this.boxHi = ((Point3)r.restore()); +/* 944 */ break; +/* */ +/* */ default: +/* 947 */ throw new TooNewException(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\HoloPilot.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |