diff options
Diffstat (limited to 'NET/worlds/scape/MultiMotion.java')
| -rw-r--r-- | NET/worlds/scape/MultiMotion.java | 698 |
1 files changed, 698 insertions, 0 deletions
diff --git a/NET/worlds/scape/MultiMotion.java b/NET/worlds/scape/MultiMotion.java new file mode 100644 index 0000000..05fb1b0 --- /dev/null +++ b/NET/worlds/scape/MultiMotion.java @@ -0,0 +1,698 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.text.MessageFormat; +/* */ import java.util.Date; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class MultiMotion +/* */ extends TriggeredSwitchableBehavior +/* */ implements FrameHandler, Persister, MouseDownHandler, BumpHandler +/* */ { +/* 23 */ protected int motionNumber = 0; +/* 24 */ protected int motionNumberCount = 0; +/* 25 */ protected int motionNumberMax = 100; +/* */ long startMultiMotionTime; +/* 27 */ long totalMultiMotionTime = 0L; +/* */ protected String cycleTime; +/* */ protected float[] cycleTimeArray; +/* */ protected int cycles; +/* */ protected Transform MultiMotionTransform; +/* */ protected String startPoint; +/* */ protected String endPoint; +/* */ protected String deltaPoint; +/* */ protected String startScale; +/* */ protected String endScale; +/* */ protected String deltaScale; +/* */ protected String startSpin; +/* */ protected String endSpin; +/* */ protected Point3[] startPointArray; +/* */ protected Point3[] endPointArray; +/* */ protected Point3[] deltaPointArray; +/* */ protected Point3[] startScaleArray; +/* */ protected Point3[] endScaleArray; +/* */ protected Point3[] deltaScaleArray; +/* */ protected Point3[] startSpinArray; +/* */ protected Point3[] endSpinArray; +/* */ protected String startRotation; +/* */ protected String endRotation; +/* */ protected float[] startRotationArray; +/* */ protected float[] endRotationArray; +/* 52 */ protected boolean MultiMotionTransformInitialized; protected boolean variableInitialized; protected boolean multiMotionEnd = true; +/* */ +/* */ +/* */ public MultiMotion() +/* */ { +/* 57 */ this.cycleTime = new String("1000"); +/* 58 */ this.cycleTimeArray = new float[this.motionNumberMax]; +/* 59 */ this.cycleTimeArray[0] = 1000.0F; +/* 60 */ this.trigger = new String("none"); +/* 61 */ this.externalTriggerTag = new String(""); +/* 62 */ this.cycles = 0; +/* 63 */ this.MultiMotionTransformInitialized = false; +/* 64 */ this.variableInitialized = false; +/* */ +/* 66 */ this.startPointArray = new Point3[this.motionNumberMax]; +/* 67 */ this.endPointArray = new Point3[this.motionNumberMax]; +/* 68 */ this.deltaPointArray = new Point3[this.motionNumberMax]; +/* 69 */ this.startScaleArray = new Point3[this.motionNumberMax]; +/* 70 */ this.endScaleArray = new Point3[this.motionNumberMax]; +/* 71 */ this.deltaScaleArray = new Point3[this.motionNumberMax]; +/* 72 */ this.startSpinArray = new Point3[this.motionNumberMax]; +/* 73 */ this.endSpinArray = new Point3[this.motionNumberMax]; +/* 74 */ for (int i = 0; i < this.motionNumberMax; i++) { +/* 75 */ this.startPointArray[i] = new Point3(); +/* 76 */ this.endPointArray[i] = new Point3(); +/* 77 */ this.deltaPointArray[i] = new Point3(); +/* 78 */ this.startScaleArray[i] = new Point3(); +/* 79 */ this.endScaleArray[i] = new Point3(); +/* 80 */ this.deltaScaleArray[i] = new Point3(); +/* 81 */ this.startSpinArray[i] = new Point3(); +/* 82 */ this.endSpinArray[i] = new Point3(); +/* */ } +/* */ +/* 85 */ this.startRotationArray = new float[this.motionNumberMax]; +/* 86 */ this.endRotationArray = new float[this.motionNumberMax]; +/* */ +/* */ +/* 89 */ startMultiMotion(); +/* */ } +/* */ +/* */ +/* */ +/* */ public void ExternalTrigger(Trigger trigger_source, int sequence_no, int event_no) +/* */ { +/* 96 */ this.trigger_source = trigger_source; +/* 97 */ this.sequence_no = sequence_no; +/* 98 */ this.event_no = event_no; +/* 99 */ startMultiMotion(); +/* */ } +/* */ +/* */ public void startMultiMotion() +/* */ { +/* 104 */ Date timer = new Date(); +/* 105 */ this.startMultiMotionTime = timer.getTime(); +/* 106 */ this.motionNumber = 0; +/* 107 */ this.multiMotionEnd = false; +/* */ } +/* */ +/* */ +/* */ public void setTotalMultiMotionTime() +/* */ { +/* 113 */ this.totalMultiMotionTime = 0L; +/* 114 */ for (int i = 0; i < this.motionNumberCount; i++) +/* */ { +/* 116 */ this.totalMultiMotionTime += +/* 117 */ (int)this.cycleTimeArray[i]; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void parseFloatString(String floatList, float[] floatArray) +/* */ { +/* 126 */ int currentIndex = 0; +/* 127 */ int currentSeparator = 0;int nextSeparator = 0; +/* 128 */ int lastSeparator = floatList.lastIndexOf(" "); +/* */ +/* 130 */ if ((lastSeparator != -1) || (floatList.length() != 0)) +/* */ { +/* */ +/* */ +/* 134 */ if (lastSeparator == -1) +/* */ { +/* 136 */ floatArray[currentIndex] = +/* 137 */ Float.valueOf(floatList).floatValue(); +/* */ } +/* */ else { +/* 140 */ nextSeparator = floatList.indexOf(" "); +/* */ +/* 142 */ floatArray[currentIndex] = +/* 143 */ Float.valueOf(floatList.substring(0, nextSeparator)) +/* 144 */ .floatValue(); +/* 145 */ currentIndex++; +/* */ +/* 147 */ while (nextSeparator != lastSeparator) { +/* 148 */ currentSeparator = nextSeparator; +/* 149 */ nextSeparator = floatList.indexOf(" ", currentSeparator + 1); +/* 150 */ floatArray[currentIndex] = +/* 151 */ Float.valueOf(floatList.substring(currentSeparator + 1, +/* 152 */ nextSeparator)).floatValue(); +/* 153 */ currentIndex++; +/* */ } +/* */ +/* 156 */ floatArray[currentIndex] = +/* 157 */ Float.valueOf(floatList.substring(nextSeparator + 1)) +/* 158 */ .floatValue(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public Point3 StringToPoint3(String Point3String) +/* */ { +/* 167 */ Point3 newPoint3 = new Point3(); +/* 168 */ int currentIndex = 0; +/* */ +/* */ +/* 171 */ newPoint3.x = Float.valueOf( +/* 172 */ Point3String.substring(currentIndex, Point3String.indexOf(",", +/* 173 */ currentIndex))).floatValue(); +/* 174 */ currentIndex = Point3String.indexOf(",", currentIndex) + 1; +/* 175 */ newPoint3.y = Float.valueOf( +/* 176 */ Point3String.substring(currentIndex, Point3String.indexOf(",", +/* 177 */ currentIndex))).floatValue(); +/* 178 */ currentIndex = Point3String.indexOf(",", currentIndex) + 1; +/* 179 */ newPoint3.z = Float.valueOf( +/* 180 */ Point3String.substring(currentIndex, Point3String.length())) +/* 181 */ .floatValue(); +/* */ +/* */ +/* */ +/* 185 */ return newPoint3; +/* */ } +/* */ +/* */ +/* */ public void parsePoint3String(String Point3List, Point3[] Point3Array) +/* */ { +/* 191 */ int currentIndex = 0; +/* 192 */ int currentSeparator = 0;int nextSeparator = 0; +/* 193 */ int lastSeparator = Point3List.lastIndexOf(" "); +/* */ +/* 195 */ if ((lastSeparator != -1) || (Point3List.length() != 0)) +/* */ { +/* */ +/* */ +/* 199 */ if (lastSeparator == -1) +/* */ { +/* 201 */ Point3Array[currentIndex] = StringToPoint3(Point3List); +/* */ } +/* */ else { +/* 204 */ nextSeparator = Point3List.indexOf(" "); +/* */ +/* 206 */ Point3Array[currentIndex] = StringToPoint3(Point3List +/* 207 */ .substring(0, nextSeparator)); +/* 208 */ currentIndex++; +/* */ +/* 210 */ while (nextSeparator != lastSeparator) { +/* 211 */ currentSeparator = nextSeparator; +/* 212 */ nextSeparator = Point3List.indexOf(" ", currentSeparator + 1); +/* 213 */ Point3Array[currentIndex] = +/* 214 */ StringToPoint3(Point3List.substring(currentSeparator + 1, +/* 215 */ nextSeparator)); +/* 216 */ currentIndex++; +/* */ } +/* */ +/* 219 */ Point3Array[currentIndex] = +/* 220 */ StringToPoint3(Point3List.substring(nextSeparator + 1)); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean handle(FrameEvent e) +/* */ { +/* 233 */ if (!this.MultiMotionTransformInitialized) { +/* 234 */ this.MultiMotionTransform = e.target; +/* 235 */ this.MultiMotionTransformInitialized = true; +/* */ } +/* 237 */ if (!this.variableInitialized) { +/* 238 */ this.startPoint = this.MultiMotionTransform.getPosition().toString(); +/* 239 */ this.startPointArray[0].copy(this.MultiMotionTransform.getPosition()); +/* 240 */ this.endPoint = new String(this.startPoint); +/* 241 */ this.endPointArray[0].copy(this.startPointArray[0]); +/* 242 */ this.startScaleArray[0].x = this.MultiMotionTransform.getTotalScale(); +/* 243 */ this.startScaleArray[0].y = this.MultiMotionTransform.getTotalScale(); +/* 244 */ this.startScaleArray[0].z = this.MultiMotionTransform.getTotalScale(); +/* 245 */ this.startScale = this.startScaleArray[0].toString(); +/* 246 */ this.endScaleArray[0].copy(this.startScaleArray[0]); +/* 247 */ this.endScale = this.endScaleArray[0].toString(); +/* */ +/* 249 */ this.startRotation = new Float(this.MultiMotionTransform +/* 250 */ .getSpin(this.startSpinArray[0])).toString(); +/* 251 */ this.startRotationArray[0] = Float.valueOf(this.startRotation).floatValue(); +/* 252 */ this.startSpin = this.startSpinArray[0].toString(); +/* 253 */ this.endRotation = new String("0.0"); +/* 254 */ this.endRotationArray[0] = Float.valueOf(this.endRotation).floatValue(); +/* 255 */ this.endSpinArray[0] = new Point3(); +/* 256 */ this.endSpin = this.endSpinArray[0].toString(); +/* 257 */ this.variableInitialized = true; +/* */ } +/* */ +/* 260 */ if (this.enabled) +/* */ { +/* 262 */ Date timer = new Date(); +/* 263 */ long currentTime = timer.getTime(); +/* */ +/* 265 */ int cycleNo = 0; +/* 266 */ if (this.totalMultiMotionTime > 0L) { +/* 267 */ cycleNo = (int)((-this.startMultiMotionTime + currentTime) / +/* 268 */ this.totalMultiMotionTime); +/* */ } +/* */ +/* */ +/* 272 */ if ((this.totalMultiMotionTime > 0L) && ( +/* 273 */ (cycleNo < this.cycles) || (this.cycles == 0))) { +/* 274 */ long totalTime = 0L; +/* 275 */ int currentCycleTime = (int)((currentTime - +/* 276 */ this.startMultiMotionTime) % this.totalMultiMotionTime); +/* 277 */ int currentMotionTime = 0; +/* 278 */ this.motionNumber = 0; +/* 279 */ while ((this.motionNumber < this.motionNumberCount) && ( +/* 280 */ totalTime <= currentCycleTime)) { +/* 281 */ currentMotionTime = (int)this.cycleTimeArray[this.motionNumber]; +/* 282 */ totalTime += currentMotionTime; +/* 283 */ this.motionNumber += 1; +/* */ } +/* */ +/* 286 */ this.motionNumber -= 1; +/* 287 */ if (totalTime < currentCycleTime) { +/* 288 */ System.out.print("Error in totalMultiMotionTime computation.\n"); +/* */ } +/* */ +/* */ +/* */ +/* 293 */ currentMotionTime = (int)(currentMotionTime - ( +/* 294 */ totalTime - currentCycleTime)); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 302 */ float frameLoc = currentMotionTime % +/* 303 */ this.cycleTimeArray[this.motionNumber] / +/* 304 */ this.cycleTimeArray[this.motionNumber]; +/* */ +/* */ +/* */ +/* 308 */ e.receiver.makeIdentity(); +/* 309 */ e.receiver.scale( +/* 310 */ this.startScaleArray[this.motionNumber].x + +/* 311 */ (this.endScaleArray[this.motionNumber].x - +/* 312 */ this.startScaleArray[this.motionNumber].x) * frameLoc, +/* 313 */ this.startScaleArray[this.motionNumber].x + +/* 314 */ (this.endScaleArray[this.motionNumber].x - +/* 315 */ this.startScaleArray[this.motionNumber].x) * frameLoc, +/* 316 */ this.startScaleArray[this.motionNumber].x + +/* 317 */ (this.endScaleArray[this.motionNumber].x - +/* 318 */ this.startScaleArray[this.motionNumber].x) * frameLoc); +/* */ +/* 320 */ e.receiver.moveTo( +/* 321 */ this.startPointArray[this.motionNumber].x + +/* 322 */ (this.endPointArray[this.motionNumber].x - +/* 323 */ this.startPointArray[this.motionNumber].x) * frameLoc, +/* 324 */ this.startPointArray[this.motionNumber].y + +/* 325 */ (this.endPointArray[this.motionNumber].y - +/* 326 */ this.startPointArray[this.motionNumber].y) * frameLoc, +/* 327 */ this.startPointArray[this.motionNumber].z + +/* 328 */ (this.endPointArray[this.motionNumber].z - +/* 329 */ this.startPointArray[this.motionNumber].z) * frameLoc); +/* */ +/* 331 */ e.receiver.spin(this.startSpinArray[this.motionNumber], +/* 332 */ this.startRotationArray[this.motionNumber]); +/* 333 */ e.receiver.spin(this.endSpinArray[this.motionNumber], +/* 334 */ this.endRotationArray[this.motionNumber] * frameLoc); +/* */ +/* */ +/* */ } +/* 338 */ else if ((cycleNo >= this.cycles) && (this.cycles != 0) && +/* 339 */ (!this.multiMotionEnd)) { +/* 340 */ this.multiMotionEnd = true; +/* 341 */ if (this.trigger_source != null) +/* */ { +/* 343 */ this.trigger_source.registerFinishedTriggerTag( +/* 344 */ this.sequence_no, this.event_no); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* 350 */ return true; +/* */ } +/* */ +/* */ public boolean handle(MouseDownEvent e) +/* */ { +/* 355 */ if ((this.enabled) && +/* 356 */ (this.trigger.equals("click"))) { +/* 357 */ startMultiMotion(); +/* */ } +/* */ +/* 360 */ return true; +/* */ } +/* */ +/* */ public boolean handle(BumpEventTemp e) +/* */ { +/* 365 */ if ((this.enabled) && +/* 366 */ (this.trigger.equals("bump"))) { +/* 367 */ startMultiMotion(); +/* */ } +/* */ +/* 370 */ return true; +/* */ } +/* */ +/* */ +/* */ public void startTransform() +/* */ { +/* 376 */ if (this.MultiMotionTransform != null) { +/* 377 */ this.MultiMotionTransform.makeIdentity(); +/* 378 */ this.MultiMotionTransform.scale(this.startScaleArray[this.motionNumber].x, +/* 379 */ this.startScaleArray[this.motionNumber].x, +/* 380 */ this.startScaleArray[this.motionNumber].x); +/* 381 */ this.MultiMotionTransform.moveTo(this.startPointArray[this.motionNumber].x, +/* 382 */ this.startPointArray[this.motionNumber].y, +/* 383 */ this.startPointArray[this.motionNumber].z); +/* */ +/* 385 */ this.MultiMotionTransform.spin(this.startSpinArray[this.motionNumber], +/* 386 */ this.startRotationArray[this.motionNumber]); +/* */ } +/* */ } +/* */ +/* */ public void endTransform() +/* */ { +/* 392 */ if (this.MultiMotionTransform != null) { +/* 393 */ this.MultiMotionTransform.makeIdentity(); +/* 394 */ this.MultiMotionTransform.scale(this.endScaleArray[this.motionNumber].x, +/* 395 */ this.endScaleArray[this.motionNumber].x, +/* 396 */ this.endScaleArray[this.motionNumber].x); +/* 397 */ this.MultiMotionTransform.moveTo(this.endPointArray[this.motionNumber].x, +/* 398 */ this.endPointArray[this.motionNumber].y, +/* 399 */ this.endPointArray[this.motionNumber].z); +/* */ +/* 401 */ this.MultiMotionTransform.spin(this.startSpinArray[this.motionNumber], +/* 402 */ this.startRotationArray[this.motionNumber]); +/* 403 */ this.MultiMotionTransform.spin(this.endSpinArray[this.motionNumber], +/* 404 */ this.endRotationArray[this.motionNumber]); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 415 */ Object ret = null; +/* 416 */ switch (index - offset) { +/* */ case 0: +/* 418 */ if (mode == 0) +/* 419 */ ret = new ClassProperty(this, index, "MultiMotion"); +/* 420 */ break; +/* */ case 1: +/* 422 */ if (mode == 0) { +/* 423 */ ret = IntegerPropertyEditor.make( +/* 424 */ new Property(this, index, "Number of Motions")); +/* 425 */ } else if (mode == 1) { +/* 426 */ ret = new Integer(this.motionNumberCount); +/* 427 */ } else if (mode == 2) { +/* 428 */ this.motionNumberCount = ((Integer)value).intValue(); +/* 429 */ setTotalMultiMotionTime(); +/* */ } +/* 431 */ break; +/* */ case 2: +/* 433 */ if (mode == 0) { +/* 434 */ ret = IntegerPropertyEditor.make( +/* 435 */ new Property(this, index, "Cycles")); +/* 436 */ } else if (mode == 1) { +/* 437 */ ret = new Integer(this.cycles); +/* 438 */ } else if (mode == 2) +/* 439 */ this.cycles = ((Integer)value).intValue(); +/* 440 */ break; +/* */ case 3: +/* 442 */ if (mode == 0) { +/* 443 */ ret = StringPropertyEditor.make( +/* 444 */ new Property(this, index, "Trigger")); +/* 445 */ } else if (mode == 1) { +/* 446 */ ret = new String(this.trigger); +/* 447 */ } else if (mode == 2) { +/* 448 */ this.trigger = ((String)value).toString().trim(); +/* 449 */ if (this.trigger.equals("external")) { +/* 450 */ Trigger.TriggeredSwitchableBehaviorList[ +/* 451 */ Trigger.TriggeredSwitchableBehaviorListCount] = this; +/* 452 */ Trigger.TriggeredSwitchableBehaviorListCount += 1; +/* */ } +/* */ } +/* 455 */ break; +/* */ case 4: +/* 457 */ if (mode == 0) { +/* 458 */ ret = StringPropertyEditor.make( +/* 459 */ new Property(this, index, "External Trigger Tag")); +/* 460 */ } else if (mode == 1) { +/* 461 */ ret = new String(this.externalTriggerTag); +/* 462 */ } else if (mode == 2) { +/* 463 */ this.externalTriggerTag = ((String)value).toString().trim(); +/* */ } +/* 465 */ break; +/* */ case 5: +/* 467 */ if (mode == 0) { +/* 468 */ ret = StringPropertyEditor.make( +/* 469 */ new Property(this, index, "Cycle Time")); +/* 470 */ } else if (mode == 1) { +/* 471 */ ret = new String(this.cycleTime); +/* 472 */ } else if (mode == 2) { +/* 473 */ this.cycleTime = ((String)value); +/* 474 */ parseFloatString(this.cycleTime, this.cycleTimeArray); +/* 475 */ setTotalMultiMotionTime(); +/* */ } +/* 477 */ break; +/* */ case 6: +/* 479 */ if (mode == 0) { +/* 480 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 481 */ "End Point")); +/* 482 */ } else if (mode == 1) { +/* 483 */ ret = new String(this.endPoint); +/* 484 */ endTransform(); +/* */ } +/* 486 */ else if (mode == 2) { +/* 487 */ this.endPoint = ((String)value); +/* 488 */ parsePoint3String(this.endPoint, this.endPointArray); +/* 489 */ endTransform(); +/* */ } +/* 491 */ break; +/* */ case 7: +/* 493 */ if (mode == 0) { +/* 494 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 495 */ "Start Point")); +/* 496 */ } else if (mode == 1) { +/* 497 */ ret = new String(this.startPoint); +/* 498 */ startTransform(); +/* */ +/* */ } +/* 501 */ else if (mode == 2) { +/* 502 */ this.startPoint = ((String)value); +/* 503 */ parsePoint3String(this.startPoint, this.startPointArray); +/* 504 */ startTransform(); +/* */ } +/* 506 */ break; +/* */ case 8: +/* 508 */ if (mode == 0) { +/* 509 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 510 */ "End Scale")); +/* 511 */ } else if (mode == 1) { +/* 512 */ ret = new String(this.endScale); +/* 513 */ endTransform(); +/* */ } +/* 515 */ else if (mode == 2) { +/* 516 */ this.endScale = ((String)value); +/* 517 */ parsePoint3String(this.endScale, this.endScaleArray); +/* 518 */ endTransform(); +/* */ } +/* 520 */ break; +/* */ case 9: +/* 522 */ if (mode == 0) { +/* 523 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 524 */ "Start Scale")); +/* 525 */ } else if (mode == 1) { +/* 526 */ ret = new String(this.startScale); +/* 527 */ startTransform(); +/* */ +/* */ } +/* 530 */ else if (mode == 2) { +/* 531 */ this.startScale = ((String)value); +/* 532 */ parsePoint3String(this.startScale, this.startScaleArray); +/* 533 */ startTransform(); +/* */ } +/* 535 */ break; +/* */ case 10: +/* 537 */ if (mode == 0) { +/* 538 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 539 */ "End Spin (Relative)")); +/* 540 */ } else if (mode == 1) { +/* 541 */ ret = new String(this.endSpin); +/* 542 */ endTransform(); +/* */ } +/* 544 */ else if (mode == 2) { +/* 545 */ this.endSpin = ((String)value); +/* 546 */ parsePoint3String(this.endSpin, this.endSpinArray); +/* 547 */ endTransform(); +/* */ } +/* 549 */ break; +/* */ case 11: +/* 551 */ if (mode == 0) { +/* 552 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 553 */ "Start Spin")); +/* 554 */ } else if (mode == 1) { +/* 555 */ ret = new String(this.startSpin); +/* 556 */ startTransform(); +/* */ } +/* 558 */ else if (mode == 2) { +/* 559 */ this.startSpin = ((String)value); +/* 560 */ parsePoint3String(this.startSpin, this.startSpinArray); +/* 561 */ startTransform(); +/* */ } +/* 563 */ break; +/* */ case 12: +/* 565 */ if (mode == 0) { +/* 566 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 567 */ "End Rotation (Relative)")); +/* 568 */ } else if (mode == 1) { +/* 569 */ ret = new String(this.endRotation); +/* 570 */ endTransform(); +/* */ } +/* 572 */ else if (mode == 2) { +/* 573 */ this.endRotation = ((String)value); +/* 574 */ parseFloatString(this.endRotation, this.endRotationArray); +/* */ +/* 576 */ endTransform(); +/* */ } +/* 578 */ break; +/* */ case 13: +/* 580 */ if (mode == 0) { +/* 581 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 582 */ "Start Rotation")); +/* 583 */ } else if (mode == 1) { +/* 584 */ ret = new String(this.startRotation); +/* 585 */ startTransform(); +/* */ } +/* 587 */ else if (mode == 2) { +/* 588 */ this.startRotation = ((String)value); +/* 589 */ parseFloatString(this.startRotation, this.startRotationArray); +/* 590 */ startTransform(); +/* */ } +/* 592 */ break; +/* */ +/* */ +/* */ +/* */ +/* */ default: +/* 598 */ ret = super.properties(index, offset + 14, mode, value); +/* */ } +/* 600 */ if (mode == 2) +/* */ { +/* 602 */ if (this.trigger.equals("none")) { +/* 603 */ startMultiMotion(); +/* */ } +/* */ } +/* 606 */ return ret; +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 611 */ return +/* */ +/* 613 */ "Multimotion: cycleTime " + this.cycleTime + ", cycles " + this.cycles + ", enabled " + this.enabled + ", trigger " + this.trigger + ", externalTriggerTag " + this.externalTriggerTag; +/* */ } +/* */ +/* */ public void saveState(Saver s) +/* */ throws IOException +/* */ { +/* 619 */ s.saveInt(this.motionNumberCount); +/* 620 */ s.saveInt(this.cycles); +/* 621 */ s.saveString(this.trigger); +/* 622 */ s.saveString(this.externalTriggerTag); +/* 623 */ s.saveString(this.cycleTime); +/* 624 */ s.saveString(this.endPoint); +/* 625 */ s.saveString(this.startPoint); +/* 626 */ s.saveString(this.endScale); +/* 627 */ s.saveString(this.startScale); +/* 628 */ s.saveString(this.endSpin); +/* 629 */ s.saveString(this.startSpin); +/* 630 */ s.saveString(this.endRotation); +/* 631 */ s.saveString(this.startRotation); +/* */ } +/* */ +/* */ +/* */ public void restoreState(Restorer r) +/* */ throws IOException +/* */ { +/* 638 */ this.motionNumberCount = r.restoreInt(); +/* 639 */ this.cycles = r.restoreInt(); +/* 640 */ this.trigger = r.restoreString(); +/* 641 */ if (this.trigger.equals("external")) { +/* 642 */ Trigger.TriggeredSwitchableBehaviorList[ +/* 643 */ Trigger.TriggeredSwitchableBehaviorListCount] = this; +/* 644 */ Trigger.TriggeredSwitchableBehaviorListCount += 1; +/* */ } +/* */ +/* 647 */ this.externalTriggerTag = r.restoreString(); +/* 648 */ this.cycleTime = r.restoreString(); +/* 649 */ parseFloatString(this.cycleTime, this.cycleTimeArray); +/* 650 */ this.endPoint = r.restoreString(); +/* 651 */ parsePoint3String(this.endPoint, this.endPointArray); +/* 652 */ setTotalMultiMotionTime(); +/* 653 */ this.startPoint = r.restoreString(); +/* 654 */ parsePoint3String(this.startPoint, this.startPointArray); +/* 655 */ this.endScale = r.restoreString(); +/* 656 */ parsePoint3String(this.endScale, this.endScaleArray); +/* 657 */ this.startScale = r.restoreString(); +/* 658 */ parsePoint3String(this.startScale, this.startScaleArray); +/* 659 */ this.endSpin = r.restoreString(); +/* 660 */ parsePoint3String(this.endSpin, this.endSpinArray); +/* 661 */ this.startSpin = r.restoreString(); +/* 662 */ parsePoint3String(this.startSpin, this.startSpinArray); +/* 663 */ this.endRotation = r.restoreString(); +/* 664 */ parseFloatString(this.endRotation, this.endRotationArray); +/* 665 */ this.startRotation = r.restoreString(); +/* 666 */ parseFloatString(this.startRotation, this.startRotationArray); +/* 667 */ this.variableInitialized = true; +/* 668 */ if (!this.trigger.equals("none")) { +/* 669 */ this.startMultiMotionTime = ((int)-(this.cycles * this.cycleTimeArray[this.motionNumber])); +/* */ } else { +/* 671 */ startMultiMotion(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void postRestore(int version) +/* */ { +/* 680 */ String name = getName(); +/* 681 */ String arg1 = name == null ? "<null>" : name; +/* 682 */ SuperRoot owner = getOwner(); +/* 683 */ String oname = ""; +/* 684 */ if (owner != null) { +/* 685 */ oname = owner.getName(); +/* */ } +/* 687 */ String arg2 = oname == null ? "<null>" : oname; +/* 688 */ Object[] arguments = { new String(arg1), new String(arg2) }; +/* 689 */ Console.println(MessageFormat.format( +/* 690 */ Console.message("MultiMotion-obs"), arguments)); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\MultiMotion.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |