home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 1999 November / CD-Gamer_1999-11_02_cd.bin / games / unrealt / utdemo.exe / System / UnrealShare.u / PathPoint_ObjectPath_ScriptText.TextBuffer < prev    next >
Unknown  |  1999-09-25  |  7.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 00 00 00 00 00 00 00 | 6c 7c 2f 2f 3d 3d 3d 3d |........|l|//====|
|00000010| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000020| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000030| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000040| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000050| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0d 0a 2f 2f 20 4f 62 |========|=..// Ob|
|00000060| 6a 65 63 74 50 61 74 68 | 2e 0d 0a 2f 2f 3d 3d 3d |jectPath|...//===|
|00000070| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000080| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000090| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 0a 63 6c 61 73 |========|==..clas|
|000000c0| 73 20 4f 62 6a 65 63 74 | 50 61 74 68 20 65 78 74 |s Object|Path ext|
|000000d0| 65 6e 64 73 20 4b 65 79 | 70 6f 69 6e 74 3b 0d 0a |ends Key|point;..|
|000000e0| 0d 0a 2f 2f 20 41 6c 6c | 6f 77 73 20 61 6e 20 6f |..// All|ows an o|
|000000f0| 62 6a 65 63 74 20 74 6f | 20 66 6f 6c 6c 6f 77 20 |bject to| follow |
|00000100| 61 20 64 65 66 69 6e 65 | 64 20 70 61 74 68 2c 20 |a define|d path, |
|00000110| 62 79 20 73 70 65 63 69 | 66 79 69 6e 67 0d 0a 2f |by speci|fying../|
|00000120| 2f 20 50 61 74 68 50 6f | 69 6e 74 20 6e 6f 64 65 |/ PathPo|int node|
|00000130| 73 2e 20 4d 0d 0a 0d 0a | 2f 2f 20 4e 6f 74 65 3a |s. M....|// Note:|
|00000140| 20 41 74 20 6c 65 61 73 | 74 20 34 20 50 61 74 68 | At leas|t 4 Path|
|00000150| 50 6f 69 6e 74 73 20 6d | 75 73 74 20 65 78 69 73 |Points m|ust exis|
|00000160| 74 2e 20 20 54 68 65 20 | 66 69 72 73 74 20 61 6e |t. The |first an|
|00000170| 64 20 6c 61 73 74 0d 0a | 2f 2f 20 20 20 20 20 20 |d last..|// |
|00000180| 20 64 6f 20 6e 6f 74 20 | 6e 65 65 64 20 73 70 65 | do not |need spe|
|00000190| 65 64 2f 64 65 6c 74 61 | 55 20 73 65 74 74 69 6e |ed/delta|U settin|
|000001a0| 67 73 2e 0d 0a 0d 0a 2f | 2f 20 4e 6f 74 65 3a 20 |gs...../|/ Note: |
|000001b0| 49 66 20 74 68 65 72 65 | 20 61 72 65 20 4e 20 70 |If there| are N p|
|000001c0| 6f 69 6e 74 73 20 74 6f | 20 69 6e 74 65 72 70 6f |oints to| interpo|
|000001d0| 6c 61 74 65 20 74 68 72 | 6f 75 67 68 2c 20 74 68 |late thr|ough, th|
|000001e0| 65 72 65 20 6d 75 73 74 | 0d 0a 2f 2f 20 20 20 20 |ere must|..// |
|000001f0| 20 20 20 62 65 20 69 6e | 20 74 6f 74 61 6c 20 4e | be in| total N|
|00000200| 2b 32 20 70 6f 69 6e 74 | 73 20 73 70 65 63 69 66 |+2 point|s specif|
|00000210| 69 65 64 2e 20 20 50 6f | 69 6e 74 20 30 20 61 6e |ied. Po|int 0 an|
|00000220| 64 20 50 6f 69 6e 74 20 | 4e 2b 31 0d 0a 2f 2f 20 |d Point |N+1..// |
|00000230| 20 20 20 20 20 20 61 72 | 65 20 64 75 6d 6d 79 20 | ar|e dummy |
|00000240| 63 6f 6e 74 72 6f 6c 20 | 70 6f 69 6e 74 73 2c 20 |control |points, |
|00000250| 77 68 65 72 65 20 50 6f | 69 6e 74 20 31 2d 50 6f |where Po|int 1-Po|
|00000260| 69 6e 74 20 30 20 69 73 | 20 74 68 65 20 0d 0a 2f |int 0 is| the ../|
|00000270| 2f 20 20 20 20 20 20 20 | 69 6e 69 74 69 61 6c 20 |/ |initial |
|00000280| 64 69 72 65 63 74 69 6f | 6e 20 6f 66 20 6d 6f 74 |directio|n of mot|
|00000290| 69 6f 6e 2c 20 61 6e 64 | 20 50 6f 69 6e 74 20 4e |ion, and| Point N|
|000002a0| 2b 31 20 2d 20 50 6f 69 | 6e 74 20 4e 20 69 73 0d |+1 - Poi|nt N is.|
|000002b0| 0a 2f 2f 20 20 20 20 20 | 20 20 74 68 65 20 66 69 |.// | the fi|
|000002c0| 6e 61 6c 20 64 69 72 65 | 63 74 69 6f 6e 20 6f 66 |nal dire|ction of|
|000002d0| 20 6d 6f 74 69 6f 6e 2e | 20 20 54 68 65 20 6f 62 | motion.| The ob|
|000002e0| 6a 65 63 74 20 77 69 6c | 6c 20 73 74 61 72 74 20 |ject wil|l start |
|000002f0| 61 74 0d 0a 2f 2f 20 20 | 20 20 20 20 20 70 6f 69 |at..// | poi|
|00000300| 6e 74 20 31 20 61 6e 64 | 20 65 6e 64 20 75 70 20 |nt 1 and| end up |
|00000310| 61 74 20 70 6f 69 6e 74 | 20 4e 2e 0d 0a 0d 0a 2f |at point| N...../|
|00000320| 2f 20 55 73 65 73 20 74 | 68 65 20 42 65 72 6e 73 |/ Uses t|he Berns|
|00000330| 74 65 69 6e 20 62 61 73 | 69 73 20 66 75 6e 63 74 |tein bas|is funct|
|00000340| 69 6f 6e 73 20 66 6f 72 | 20 42 65 7a 69 65 72 20 |ions for| Bezier |
|00000350| 69 6e 74 65 72 70 6f 6c | 61 74 69 6f 6e 3a 0d 0a |interpol|ation:..|
|00000360| 2f 2f 20 20 20 42 30 28 | 75 29 20 3d 20 28 31 2d |// B0(|u) = (1-|
|00000370| 75 29 5e 33 0d 0a 2f 2f | 20 20 20 42 31 28 75 29 |u)^3..//| B1(u)|
|00000380| 20 3d 20 33 75 28 31 2d | 75 29 5e 32 0d 0a 2f 2f | = 3u(1-|u)^2..//|
|00000390| 20 20 20 42 32 28 75 29 | 20 3d 20 33 75 5e 32 28 | B2(u)| = 3u^2(|
|000003a0| 31 2d 75 29 0d 0a 2f 2f | 20 20 20 42 33 28 75 29 |1-u)..//| B3(u)|
|000003b0| 20 3d 20 75 5e 33 0d 0a | 0d 0a 76 61 72 28 29 20 | = u^3..|..var() |
|000003c0| 6e 61 6d 65 20 20 20 20 | 20 50 61 74 68 41 63 74 |name | PathAct|
|000003d0| 6f 72 54 61 67 3b 20 09 | 2f 2f 20 54 68 65 20 54 |orTag; .|// The T|
|000003e0| 61 67 20 6f 66 20 74 68 | 65 20 61 63 74 6f 72 20 |ag of th|e actor |
|000003f0| 77 68 69 63 68 20 73 68 | 6f 75 6c 64 20 62 65 20 |which sh|ould be |
|00000400| 6d 6f 76 65 64 0d 0a 76 | 61 72 28 29 20 62 6f 6f |moved..v|ar() boo|
|00000410| 6c 20 20 20 20 20 62 41 | 6c 74 65 72 50 69 74 63 |l bA|lterPitc|
|00000420| 68 3b 09 2f 2f 20 73 68 | 6f 75 6c 64 20 74 68 65 |h;.// sh|ould the|
|00000430| 20 70 69 74 63 68 20 6f | 66 20 74 68 65 20 61 63 | pitch o|f the ac|
|00000440| 74 6f 72 20 62 65 20 6d | 6f 64 69 66 69 65 64 20 |tor be m|odified |
|00000450| 64 75 72 69 6e 67 20 6d | 6f 76 65 6d 65 6e 74 0d |during m|ovement.|
|00000460| 0a 76 61 72 28 29 20 62 | 6f 6f 6c 20 20 20 20 20 |.var() b|ool |
|00000470| 62 41 6c 74 65 72 59 61 | 77 3b 09 09 2f 2f 20 73 |bAlterYa|w;..// s|
|00000480| 68 6f 75 6c 64 20 74 68 | 65 20 79 61 77 20 2e 2e |hould th|e yaw ..|
|00000490| 2e 0d 0a 76 61 72 28 29 | 20 62 6f 6f 6c 20 20 20 |...var()| bool |
|000004a0| 20 20 62 41 6c 74 65 72 | 52 6f 6c 6c 3b 09 09 2f | bAlter|Roll;../|
|000004b0| 2f 20 73 68 6f 75 6c 64 | 20 74 68 65 20 72 6f 6c |/ should| the rol|
|000004c0| 6c 20 2e 2e 2e 0d 0a 76 | 61 72 28 29 20 72 6f 74 |l .....v|ar() rot|
|000004d0| 61 74 6f 72 20 20 52 41 | 64 6a 75 73 74 3b 09 09 |ator RA|djust;..|
|000004e0| 2f 2f 20 41 64 6a 75 73 | 74 20 74 68 65 20 72 6f |// Adjus|t the ro|
|000004f0| 74 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 6f 62 |tation o|f the ob|
|00000500| 6a 65 63 74 0d 0a 0d 0a | 2f 2f 76 61 72 28 29 20 |ject....|//var() |
|00000510| 62 6f 6f 6c 20 20 62 4c | 6f 6f 70 4d 6f 74 69 6f |bool bL|oopMotio|
|00000520| 6e 3b 09 2f 2f 20 54 68 | 65 20 6c 61 73 74 20 50 |n;.// Th|e last P|
|00000530| 61 74 68 50 6f 69 6e 74 | 20 73 68 6f 75 6c 64 20 |athPoint| should |
|00000540| 6c 65 61 64 20 74 6f 20 | 74 68 65 20 66 69 72 73 |lead to |the firs|
|00000550| 74 0d 0a 0d 0a 76 61 72 | 20 41 63 74 6f 72 20 20 |t....var| Actor |
|00000560| 20 09 50 61 74 68 41 63 | 74 6f 72 3b 09 09 2f 2f | .PathAc|tor;..//|
|00000570| 20 77 68 61 74 20 73 68 | 6f 75 6c 64 20 62 65 20 | what sh|ould be |
|00000580| 6d 6f 76 65 64 0d 0a 76 | 61 72 20 50 61 74 68 50 |moved..v|ar PathP|
|00000590| 6f 69 6e 74 20 50 61 74 | 68 5b 33 35 5d 3b 09 09 |oint Pat|h[35];..|
|000005a0| 2f 2f 20 6d 61 78 69 6d | 75 6d 20 33 35 20 6e 6f |// maxim|um 35 no|
|000005b0| 64 65 73 20 69 6e 20 74 | 68 65 20 70 61 74 68 2c |des in t|he path,|
|000005c0| 20 68 65 6e 63 65 20 33 | 33 20 72 65 61 6c 20 70 | hence 3|3 real p|
|000005d0| 6f 73 69 74 69 6f 6e 73 | 20 0d 0a 76 61 72 20 69 |ositions| ..var i|
|000005e0| 6e 74 20 09 09 6e 75 6d | 50 61 74 68 4e 6f 64 65 |nt ..num|PathNode|
|000005f0| 73 3b 09 09 2f 2f 20 68 | 6f 77 20 6d 61 6e 79 20 |s;..// h|ow many |
|00000600| 65 6c 65 6d 65 6e 74 73 | 20 69 6e 20 74 68 65 20 |elements| in the |
|00000610| 70 61 74 68 20 61 72 72 | 61 79 0d 0a 76 61 72 20 |path arr|ay..var |
|00000620| 69 6e 74 20 09 09 63 75 | 72 4e 6f 64 65 3b 09 09 |int ..cu|rNode;..|
|00000630| 09 2f 2f 20 57 68 69 63 | 68 20 6e 6f 64 65 20 61 |.// Whic|h node a|
|00000640| 72 65 20 77 65 20 61 74 | 3f 0d 0a 76 61 72 20 66 |re we at|?..var f|
|00000650| 6c 6f 61 74 20 09 75 56 | 61 6c 75 65 3b 09 09 09 |loat .uV|alue;...|
|00000660| 2f 2f 20 4f 66 66 73 65 | 74 20 69 6e 20 74 68 65 |// Offse|t in the|
|00000670| 20 73 65 67 6d 65 6e 74 | 0d 0a 76 61 72 20 62 6f | segment|..var bo|
|00000680| 6f 6c 20 09 62 54 72 69 | 67 67 65 72 65 64 4f 6e |ol .bTri|ggeredOn|
|00000690| 63 65 3b 09 2f 2f 20 44 | 6f 6e 27 74 20 72 65 70 |ce;.// D|on't rep|
|000006a0| 65 61 74 20 74 68 65 20 | 70 61 74 68 20 69 66 20 |eat the |path if |
|000006b0| 69 74 27 73 20 61 6c 72 | 65 61 64 79 20 70 6c 61 |it's alr|eady pla|
|000006c0| 79 65 64 20 74 68 72 6f | 75 67 68 0d 0a 76 61 72 |yed thro|ugh..var|
|000006d0| 20 62 6f 6f 6c 09 09 62 | 50 6c 61 79 65 64 4f 6e | bool..b|PlayedOn|
|000006e0| 63 65 3b 09 09 2f 2f 20 | 52 65 61 6c 6c 79 20 64 |ce;..// |Really d|
|000006f0| 6f 6e 27 74 20 70 6c 61 | 79 20 69 74 20 61 67 61 |on't pla|y it aga|
|00000700| 69 6e 20 73 69 6e 63 65 | 20 69 74 27 73 20 61 6c |in since| it's al|
|00000710| 72 65 61 64 79 20 66 69 | 6e 69 73 68 65 64 20 6c |ready fi|nished l|
|00000720| 61 73 74 20 74 69 6d 65 | 0d 0a 76 61 72 20 76 65 |ast time|..var ve|
|00000730| 63 74 6f 72 20 09 6c 61 | 73 74 50 6f 73 69 74 69 |ctor .la|stPositi|
|00000740| 6f 6e 3b 09 09 2f 2f 20 | 57 68 65 72 65 20 74 68 |on;..// |Where th|
|00000750| 65 20 61 63 74 6f 72 20 | 77 61 73 20 69 6e 20 74 |e actor |was in t|
|00000760| 68 65 20 6d 6f 73 74 20 | 72 65 63 65 6e 74 20 66 |he most |recent f|
|00000770| 72 61 6d 65 0d 0a 76 61 | 72 20 72 6f 74 61 74 6f |rame..va|r rotato|
|00000780| 72 20 6c 61 73 74 52 6f | 74 61 74 69 6f 6e 3b 09 |r lastRo|tation;.|
|00000790| 09 2f 2f 20 54 68 65 20 | 6f 72 69 65 6e 74 61 74 |.// The |orientat|
|000007a0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 61 63 74 6f 72 |ion of t|he actor|
|000007b0| 20 69 6e 20 74 68 65 20 | 6d 6f 73 74 20 72 65 63 | in the |most rec|
|000007c0| 65 6e 74 20 66 72 61 6d | 65 0d 0a 0d 0a 0d 0a 66 |ent fram|e......f|
|000007d0| 75 6e 63 74 69 6f 6e 20 | 42 65 67 69 6e 50 6c 61 |unction |BeginPla|
|000007e0| 79 28 29 0d 0a 7b 0d 0a | 09 6c 6f 63 61 6c 20 69 |y()..{..|.local i|
|000007f0| 6e 74 20 69 2c 20 6c 3b | 0d 0a 09 6c 6f 63 61 6c |nt i, l;|...local|
|00000800| 20 50 61 74 68 50 6f 69 | 6e 74 20 74 65 6d 70 50 | PathPoi|nt tempP|
|00000810| 50 3b 0d 0a 09 0d 0a 09 | 2f 2f 20 46 69 6e 64 20 |P;......|// Find |
|00000820| 61 6c 6c 20 72 65 6c 65 | 76 61 6e 74 20 50 61 74 |all rele|vant Pat|
|00000830| 68 50 6f 69 6e 74 20 65 | 6c 65 6d 65 6e 74 73 20 |hPoint e|lements |
|00000840| 61 6e 64 20 6c 6f 61 64 | 20 74 68 65 6d 20 0d 0a |and load| them ..|
|00000850| 09 2f 2f 20 69 6e 74 6f | 20 74 68 65 20 74 65 6d |.// into| the tem|
|00000860| 70 6f 72 61 72 79 20 61 | 72 72 61 79 20 28 69 6e |porary a|rray (in|
|00000870| 20 73 6f 72 74 65 64 20 | 6f 72 64 65 72 29 2e 20 | sorted |order). |
|00000880| 20 41 6c 73 6f 20 73 65 | 74 20 75 70 0d 0a 09 2f | Also se|t up.../|
|00000890| 2f 20 76 65 6c 6f 63 69 | 74 69 65 73 2c 20 65 74 |/ veloci|ties, et|
|000008a0| 63 2e 2e 0d 0a 09 2f 2f | 20 57 61 69 74 20 75 6e |c.....//| Wait un|
|000008b0| 74 69 6c 20 73 6f 6d 65 | 74 68 69 6e 67 20 74 72 |til some|thing tr|
|000008c0| 69 67 67 65 72 73 20 74 | 68 65 20 6d 6f 74 69 6f |iggers t|he motio|
|000008d0| 6e 0d 0a 09 44 69 73 61 | 62 6c 65 28 27 54 69 63 |n...Disa|ble('Tic|
|000008e0| 6b 27 29 3b 0d 0a 09 62 | 54 72 69 67 67 65 72 65 |k');...b|Triggere|
|000008f0| 64 4f 6e 63 65 20 3d 20 | 66 61 6c 73 65 3b 0d 0a |dOnce = |false;..|
|00000900| 09 62 50 6c 61 79 65 64 | 4f 6e 63 65 20 3d 20 74 |.bPlayed|Once = t|
|00000910| 72 75 65 3b 0d 0a 0d 0a | 09 2f 2f 20 46 69 6e 64 |rue;....|.// Find|
|00000920| 20 74 68 65 20 6f 62 6a | 65 63 74 20 77 68 69 63 | the obj|ect whic|
|00000930| 68 20 6d 75 73 74 20 62 | 65 20 6d 6f 76 65 64 0d |h must b|e moved.|
|00000940| 0a 09 50 61 74 68 41 63 | 74 6f 72 20 3d 20 4e 6f |..PathAc|tor = No|
|00000950| 6e 65 3b 0d 0a 09 66 6f | 72 65 61 63 68 20 41 6c |ne;...fo|reach Al|
|00000960| 6c 41 63 74 6f 72 73 20 | 28 63 6c 61 73 73 20 27 |lActors |(class '|
|00000970| 41 63 74 6f 72 27 2c 20 | 50 61 74 68 41 63 74 6f |Actor', |PathActo|
|00000980| 72 29 0d 0a 09 7b 0d 0a | 09 09 69 66 28 20 50 61 |r)...{..|..if( Pa|
|00000990| 74 68 41 63 74 6f 72 2e | 54 61 67 20 3d 3d 20 50 |thActor.|Tag == P|
|000009a0| 61 74 68 41 63 74 6f 72 | 54 61 67 20 29 0d 0a 09 |athActor|Tag )...|
|000009b0| 09 09 2f 2f 20 66 6f 75 | 6e 64 20 74 68 65 20 6d |..// fou|nd the m|
|000009c0| 61 74 63 68 69 6e 67 20 | 41 63 74 6f 72 0d 0a 09 |atching |Actor...|
|000009d0| 09 09 62 72 65 61 6b 3b | 09 0d 0a 09 7d 0d 0a 09 |..break;|....}...|
|000009e0| 69 66 28 20 50 61 74 68 | 41 63 74 6f 72 20 3d 3d |if( Path|Actor ==|
|000009f0| 20 4e 6f 6e 65 20 29 20 | 0d 0a 09 7b 0d 0a 09 09 | None ) |...{....|
|00000a00| 6c 6f 67 28 22 4f 62 6a | 65 63 74 50 61 74 68 3a |log("Obj|ectPath:|
|00000a10| 20 4e 6f 20 6f 62 6a 65 | 63 74 20 74 6f 20 62 65 | No obje|ct to be|
|00000a20| 20 6d 6f 76 65 64 2e 20 | 20 41 62 6f 72 74 69 6e | moved. | Abortin|
|00000a30| 67 2e 22 29 3b 0d 0a 09 | 09 44 65 73 74 72 6f 79 |g.");...|.Destroy|
|00000a40| 28 29 3b 0d 0a 09 09 72 | 65 74 75 72 6e 3b 0d 0a |();....r|eturn;..|
|00000a50| 09 7d 0d 0a 0d 0a 09 2f | 2f 20 46 69 6e 64 20 61 |.}...../|/ Find a|
|00000a60| 6c 6c 20 74 68 65 20 50 | 61 74 68 20 4e 6f 64 65 |ll the P|ath Node|
|00000a70| 73 2e 0d 0a 09 6e 75 6d | 50 61 74 68 4e 6f 64 65 |s....num|PathNode|
|00000a80| 73 3d 30 3b 0d 0a 09 66 | 6f 72 65 61 63 68 20 41 |s=0;...f|oreach A|
|00000a90| 6c 6c 41 63 74 6f 72 73 | 20 28 63 6c 61 73 73 20 |llActors| (class |
|00000aa0| 27 50 61 74 68 50 6f 69 | 6e 74 27 2c 20 74 65 6d |'PathPoi|nt', tem|
|00000ab0| 70 50 50 29 20 0d 0a 09 | 7b 0d 0a 09 09 2f 2f 20 |pPP) ...|{....// |
|00000ac0| 54 68 69 73 20 50 61 74 | 68 50 6f 69 6e 74 20 6d |This Pat|hPoint m|
|00000ad0| 75 73 74 20 68 61 76 65 | 20 74 68 65 20 73 61 6d |ust have| the sam|
|00000ae0| 65 20 74 61 67 20 61 73 | 20 74 68 69 73 20 4f 62 |e tag as| this Ob|
|00000af0| 6a 65 63 74 50 61 74 68 | 20 61 63 74 6f 72 0d 0a |jectPath| actor..|
|00000b00| 09 09 69 66 20 28 74 65 | 6d 70 50 50 2e 54 61 67 |..if (te|mpPP.Tag|
|00000b10| 20 3d 3d 20 54 61 67 29 | 20 7b 0d 0a 09 09 0d 0a | == Tag)| {......|
|00000b20| 09 09 09 50 61 74 68 5b | 6e 75 6d 50 61 74 68 4e |...Path[|numPathN|
|00000b30| 6f 64 65 73 5d 20 3d 20 | 74 65 6d 70 50 50 3b 0d |odes] = |tempPP;.|
|00000b40| 0a 09 09 09 6e 75 6d 50 | 61 74 68 4e 6f 64 65 73 |....numP|athNodes|
|00000b50| 2b 2b 3b 09 0d 0a 09 09 | 09 2f 2f 20 4d 61 6b 65 |++;.....|.// Make|
|00000b60| 20 73 75 72 65 20 74 68 | 61 74 20 74 68 65 20 75 | sure th|at the u|
|00000b70| 73 65 72 20 64 69 64 6e | 27 74 20 73 70 65 63 69 |ser didn|'t speci|
|00000b80| 66 79 20 74 6f 6f 20 6d | 61 6e 79 20 70 6f 69 6e |fy too m|any poin|
|00000b90| 74 73 0d 0a 09 09 09 69 | 66 20 28 6e 75 6d 50 61 |ts.....i|f (numPa|
|00000ba0| 74 68 4e 6f 64 65 73 20 | 3e 20 33 35 29 20 7b 0d |thNodes |> 35) {.|
|00000bb0| 0a 09 09 09 09 6c 6f 67 | 20 28 22 4f 62 6a 65 63 |.....log| ("Objec|
|00000bc0| 74 50 61 74 68 3a 20 4d | 61 78 69 6d 75 6d 20 6e |tPath: M|aximum n|
|00000bd0| 75 6d 62 65 72 20 6f 66 | 20 70 61 74 68 20 65 6c |umber of| path el|
|00000be0| 65 6d 65 6e 74 73 20 65 | 78 63 65 65 64 65 64 2e |ements e|xceeded.|
|00000bf0| 20 20 41 62 6f 72 74 69 | 6e 67 2e 22 29 3b 0d 0a | Aborti|ng.");..|
|00000c00| 09 09 09 09 6c 6f 67 20 | 28 22 20 20 20 20 20 20 |....log |(" |
|00000c10| 20 20 20 20 20 20 54 61 | 67 20 3d 20 22 20 24 20 | Ta|g = " $ |
|00000c20| 74 65 6d 70 50 50 2e 54 | 61 67 29 3b 0d 0a 09 09 |tempPP.T|ag);....|
|00000c30| 09 09 44 65 73 74 72 6f | 79 28 29 3b 0d 0a 09 09 |..Destro|y();....|
|00000c40| 09 09 72 65 74 75 72 6e | 3b 0d 0a 09 09 09 7d 09 |..return|;.....}.|
|00000c50| 09 0d 0a 09 09 7d 0d 0a | 09 7d 0d 0a 09 0d 0a 09 |.....}..|.}......|
|00000c60| 2f 2f 20 4d 61 6b 65 20 | 73 75 72 65 20 74 68 61 |// Make |sure tha|
|00000c70| 74 20 74 68 65 72 65 20 | 61 72 65 20 61 74 20 6c |t there |are at l|
|00000c80| 65 61 73 74 20 66 6f 75 | 72 20 50 61 74 68 50 6f |east fou|r PathPo|
|00000c90| 69 6e 74 20 6e 6f 64 65 | 73 2e 0d 0a 09 69 66 20 |int node|s....if |
|00000ca0| 28 6e 75 6d 50 61 74 68 | 4e 6f 64 65 73 20 3c 20 |(numPath|Nodes < |
|00000cb0| 34 29 0d 0a 09 7b 0d 0a | 09 09 6c 6f 67 28 22 4f |4)...{..|..log("O|
|00000cc0| 62 6a 65 63 74 50 61 74 | 68 3a 20 4e 6f 74 20 65 |bjectPat|h: Not e|
|00000cd0| 6e 6f 75 67 68 20 50 61 | 74 68 50 6f 69 6e 74 73 |nough Pa|thPoints|
|00000ce0| 20 73 70 65 63 69 66 69 | 65 64 2e 20 20 4e 65 65 | specifi|ed. Nee|
|00000cf0| 64 65 64 20 34 2e 20 20 | 41 62 6f 72 74 69 6e 67 |ded 4. |Aborting|
|00000d00| 2e 22 29 3b 0d 0a 09 09 | 44 65 73 74 72 6f 79 28 |.");....|Destroy(|
|00000d10| 29 3b 0d 0a 09 09 72 65 | 74 75 72 6e 3b 0d 0a 09 |);....re|turn;...|
|00000d20| 7d 0d 0a 0d 0a 09 2f 2f | 20 4e 6f 77 20 73 6f 72 |}.....//| Now sor|
|00000d30| 74 20 74 68 65 20 65 6c | 65 6d 65 6e 74 73 20 28 |t the el|ements (|
|00000d40| 75 73 69 6e 67 20 61 20 | 63 72 61 70 70 79 20 62 |using a |crappy b|
|00000d50| 75 62 62 6c 65 20 73 6f | 72 74 2e 2e 20 68 65 79 |ubble so|rt.. hey|
|00000d60| 20 69 74 27 73 20 3c 20 | 33 30 20 65 6c 65 6d 65 | it's < |30 eleme|
|00000d70| 6e 74 73 29 0d 0a 09 66 | 6f 72 20 28 69 3d 30 3b |nts)...f|or (i=0;|
|00000d80| 20 69 3c 6e 75 6d 50 61 | 74 68 4e 6f 64 65 73 2d | i<numPa|thNodes-|
|00000d90| 31 3b 20 69 2b 2b 29 20 | 7b 0d 0a 09 09 66 6f 72 |1; i++) |{....for|
|00000da0| 20 28 6c 3d 69 2b 31 3b | 20 6c 3c 6e 75 6d 50 61 | (l=i+1;| l<numPa|
|00000db0| 74 68 4e 6f 64 65 73 3b | 20 6c 2b 2b 29 20 7b 0d |thNodes;| l++) {.|
|00000dc0| 0a 09 09 09 69 66 20 28 | 50 61 74 68 5b 69 5d 2e |....if (|Path[i].|
|00000dd0| 73 65 71 75 65 6e 63 65 | 5f 4e 75 6d 62 65 72 20 |sequence|_Number |
|00000de0| 3e 20 50 61 74 68 5b 6c | 5d 2e 73 65 71 75 65 6e |> Path[l|].sequen|
|00000df0| 63 65 5f 4e 75 6d 62 65 | 72 29 20 7b 0d 0a 09 09 |ce_Numbe|r) {....|
|00000e00| 09 0d 0a 09 09 09 09 2f | 2f 20 73 77 69 74 63 68 |......./|/ switch|
|00000e10| 20 74 68 65 6d 0d 0a 09 | 09 09 09 74 65 6d 70 50 | them...|...tempP|
|00000e20| 50 20 20 3d 20 50 61 74 | 68 5b 69 5d 3b 0d 0a 09 |P = Pat|h[i];...|
|00000e30| 09 09 09 50 61 74 68 5b | 69 5d 20 3d 20 50 61 74 |...Path[|i] = Pat|
|00000e40| 68 5b 6c 5d 3b 0d 0a 09 | 09 09 09 50 61 74 68 5b |h[l];...|...Path[|
|00000e50| 6c 5d 20 3d 20 74 65 6d | 70 50 50 3b 0d 0a 09 09 |l] = tem|pPP;....|
|00000e60| 09 7d 09 09 0d 0a 09 09 | 7d 0d 0a 09 7d 0d 0a 0d |.}......|}...}...|
|00000e70| 0a 09 2f 2f 20 50 72 65 | 63 61 6c 63 75 6c 61 74 |..// Pre|calculat|
|00000e80| 65 20 74 68 65 20 64 69 | 72 65 63 74 69 6f 6e 20 |e the di|rection |
|00000e90| 76 65 63 74 6f 72 73 20 | 61 74 20 65 61 63 68 20 |vectors |at each |
|00000ea0| 70 6f 69 6e 74 2c 20 62 | 61 73 65 64 20 6f 6e 20 |point, b|ased on |
|00000eb0| 0d 0a 09 2f 2f 20 72 65 | 6c 61 74 69 76 65 20 70 |...// re|lative p|
|00000ec0| 6f 73 69 74 69 6f 6e 20 | 61 6e 64 20 63 75 72 76 |osition |and curv|
|00000ed0| 65 53 70 65 65 64 2e 0d | 0a 09 2f 2f 20 54 68 65 |eSpeed..|..// The|
|00000ee0| 20 66 69 72 73 74 20 28 | 31 29 20 61 6e 64 20 6c | first (|1) and l|
|00000ef0| 61 73 74 20 28 4e 2d 31 | 29 20 73 65 67 6d 65 6e |ast (N-1|) segmen|
|00000f00| 74 73 27 20 76 65 6c 6f | 63 69 74 69 65 73 20 61 |ts' velo|cities a|
|00000f10| 72 65 0d 0a 09 2f 2f 20 | 72 65 6c 61 74 65 64 20 |re...// |related |
|00000f20| 74 6f 20 74 68 65 20 28 | 30 29 20 61 6e 64 20 28 |to the (|0) and (|
|00000f30| 4e 29 27 74 68 20 70 6f | 69 6e 74 73 20 72 65 73 |N)'th po|ints res|
|00000f40| 70 65 63 74 69 76 65 6c | 79 2e 0d 0a 09 2f 2f 20 |pectivel|y....// |
|00000f50| 66 69 72 73 74 20 73 65 | 67 6d 65 6e 74 0d 0a 09 |first se|gment...|
|00000f60| 50 61 74 68 5b 31 5d 2e | 70 56 65 6c 6f 63 69 74 |Path[1].|pVelocit|
|00000f70| 79 20 3d 20 4e 6f 72 6d | 61 6c 28 50 61 74 68 5b |y = Norm|al(Path[|
|00000f80| 31 5d 2e 4c 6f 63 61 74 | 69 6f 6e 20 2d 20 0d 0a |1].Locat|ion - ..|
|00000f90| 09 09 09 09 09 20 20 09 | 09 20 20 50 61 74 68 5b |..... .|. Path[|
|00000fa0| 30 5d 2e 4c 6f 63 61 74 | 69 6f 6e 29 20 2a 20 50 |0].Locat|ion) * P|
|00000fb0| 61 74 68 5b 31 5d 2e 63 | 75 72 76 65 73 70 65 65 |ath[1].c|urvespee|
|00000fc0| 64 3b 0d 0a 09 2f 2f 20 | 6c 61 73 74 20 73 65 67 |d;...// |last seg|
|00000fd0| 6d 65 6e 74 0d 0a 09 50 | 61 74 68 5b 6e 75 6d 50 |ment...P|ath[numP|
|00000fe0| 61 74 68 4e 6f 64 65 73 | 2d 32 5d 2e 70 56 65 6c |athNodes|-2].pVel|
|00000ff0| 6f 63 69 74 79 20 3d 20 | 4e 6f 72 6d 61 6c 28 50 |ocity = |Normal(P|
|00001000| 61 74 68 5b 6e 75 6d 50 | 61 74 68 4e 6f 64 65 73 |ath[numP|athNodes|
|00001010| 2d 31 5d 2e 4c 6f 63 61 | 74 69 6f 6e 20 2d 20 0d |-1].Loca|tion - .|
|00001020| 0a 09 09 09 09 09 09 09 | 09 20 20 20 20 09 20 20 |........|. . |
|00001030| 20 20 50 61 74 68 5b 6e | 75 6d 50 61 74 68 4e 6f | Path[n|umPathNo|
|00001040| 64 65 73 2d 32 5d 2e 4c | 6f 63 61 74 69 6f 6e 29 |des-2].L|ocation)|
|00001050| 20 2a 20 50 61 74 68 5b | 6e 75 6d 50 61 74 68 4e | * Path[|numPathN|
|00001060| 6f 64 65 73 2d 32 5d 2e | 63 75 72 76 65 73 70 65 |odes-2].|curvespe|
|00001070| 65 64 3b 0d 0a 0d 0a 09 | 2f 2f 20 54 68 65 20 74 |ed;.....|// The t|
|00001080| 61 6e 67 65 6e 74 20 6f | 66 20 74 68 65 20 6d 69 |angent o|f the mi|
|00001090| 64 64 6c 65 20 6e 6f 64 | 65 73 20 69 73 20 70 61 |ddle nod|es is pa|
|000010a0| 72 61 6c 6c 65 6c 20 74 | 6f 20 74 68 65 20 76 65 |rallel t|o the ve|
|000010b0| 63 74 6f 72 0d 0a 09 2f | 2f 20 62 65 74 77 65 65 |ctor.../|/ betwee|
|000010c0| 6e 20 74 68 65 20 70 72 | 65 76 69 6f 75 73 20 61 |n the pr|evious a|
|000010d0| 6e 64 20 6e 65 78 74 20 | 6e 6f 64 65 73 2e 0d 0a |nd next |nodes...|
|000010e0| 09 66 6f 72 20 28 69 3d | 32 3b 20 69 3c 3d 6e 75 |.for (i=|2; i<=nu|
|000010f0| 6d 50 61 74 68 4e 6f 64 | 65 73 2d 33 3b 20 69 2b |mPathNod|es-3; i+|
|00001100| 2b 29 20 0d 0a 09 7b 0d | 0a 09 09 50 61 74 68 5b |+) ...{.|...Path[|
|00001110| 69 5d 2e 70 56 65 6c 6f | 63 69 74 79 20 3d 20 4e |i].pVelo|city = N|
|00001120| 6f 72 6d 61 6c 28 50 61 | 74 68 5b 69 2b 31 5d 2e |ormal(Pa|th[i+1].|
|00001130| 4c 6f 63 61 74 69 6f 6e | 20 2d 20 0d 0a 09 09 09 |Location| - .....|
|00001140| 09 09 09 09 20 20 20 20 | 20 20 50 61 74 68 5b 69 |.... | Path[i|
|00001150| 2d 31 5d 2e 4c 6f 63 61 | 74 69 6f 6e 29 20 2a 20 |-1].Loca|tion) * |
|00001160| 50 61 74 68 5b 69 5d 2e | 63 75 72 76 65 73 70 65 |Path[i].|curvespe|
|00001170| 65 64 3b 0d 0a 09 7d 0d | 0a 0d 0a 09 45 6e 61 62 |ed;...}.|....Enab|
|00001180| 6c 65 28 27 54 72 69 67 | 67 65 72 27 29 3b 0d 0a |le('Trig|ger');..|
|00001190| 7d 0d 0a 0d 0a 66 75 6e | 63 74 69 6f 6e 20 50 6f |}....fun|ction Po|
|000011a0| 73 74 42 65 67 69 6e 50 | 6c 61 79 28 29 0d 0a 7b |stBeginP|lay()..{|
|000011b0| 0d 0a 09 53 75 70 65 72 | 2e 50 6f 73 74 42 65 67 |...Super|.PostBeg|
|000011c0| 69 6e 50 6c 61 79 28 29 | 3b 0d 0a 0d 0a 09 2f 2f |inPlay()|;.....//|
|000011d0| 20 53 65 74 20 74 68 65 | 20 6f 62 6a 65 63 74 20 | Set the| object |
|000011e0| 61 74 20 74 68 65 20 69 | 6e 69 74 69 61 6c 20 70 |at the i|nitial p|
|000011f0| 6f 73 69 74 69 6f 6e 20 | 61 6e 64 20 6f 72 69 65 |osition |and orie|
|00001200| 6e 74 61 74 69 6f 6e 2c | 20 73 6f 20 74 68 61 74 |ntation,| so that|
|00001210| 20 69 74 20 64 6f 65 73 | 6e 27 74 0d 0a 09 2f 2f | it does|n't...//|
|00001220| 20 73 75 64 64 65 6e 6c | 79 20 6a 65 72 6b 20 77 | suddenl|y jerk w|
|00001230| 68 65 6e 20 74 72 69 67 | 67 65 72 65 64 20 74 6f |hen trig|gered to|
|00001240| 20 6d 6f 76 65 2e 0d 0a | 09 50 61 74 68 41 63 74 | move...|.PathAct|
|00001250| 6f 72 2e 52 65 6d 6f 74 | 65 52 6f 6c 65 20 3d 20 |or.Remot|eRole = |
|00001260| 52 4f 4c 45 5f 44 75 6d | 62 50 72 6f 78 79 3b 0d |ROLE_Dum|bProxy;.|
|00001270| 0a 09 50 61 74 68 41 63 | 74 6f 72 2e 53 65 74 4c |..PathAc|tor.SetL|
|00001280| 6f 63 61 74 69 6f 6e 28 | 20 50 61 74 68 5b 31 5d |ocation(| Path[1]|
|00001290| 2e 4c 6f 63 61 74 69 6f | 6e 20 29 3b 0d 0a 7d 0d |.Locatio|n );..}.|
|000012a0| 0a 0d 0a 66 75 6e 63 74 | 69 6f 6e 20 54 72 69 67 |...funct|ion Trig|
|000012b0| 67 65 72 28 20 61 63 74 | 6f 72 20 4f 74 68 65 72 |ger( act|or Other|
|000012c0| 2c 20 70 61 77 6e 20 45 | 76 65 6e 74 49 6e 73 74 |, pawn E|ventInst|
|000012d0| 69 67 61 74 6f 72 20 29 | 0d 0a 7b 0d 0a 09 2f 2f |igator )|..{...//|
|000012e0| 20 50 6c 61 79 20 74 68 | 65 20 6d 6f 74 69 6f 6e | Play th|e motion|
|000012f0| 20 69 66 20 69 74 20 68 | 61 73 6e 27 74 20 6f 63 | if it h|asn't oc|
|00001300| 63 75 72 65 64 20 79 65 | 74 0d 0a 09 69 66 28 20 |cured ye|t...if( |
|00001310| 21 62 54 72 69 67 67 65 | 72 65 64 4f 6e 63 65 20 |!bTrigge|redOnce |
|00001320| 29 0d 0a 09 7b 0d 0a 09 | 09 2f 2f 20 53 65 74 20 |)...{...|.// Set |
|00001330| 75 70 64 61 74 65 20 70 | 61 72 61 6d 65 74 65 72 |update p|arameter|
|00001340| 73 0d 0a 09 09 62 54 72 | 69 67 67 65 72 65 64 4f |s....bTr|iggeredO|
|00001350| 6e 63 65 20 3d 20 74 72 | 75 65 3b 0d 0a 09 09 62 |nce = tr|ue;....b|
|00001360| 50 6c 61 79 65 64 4f 6e | 63 65 20 3d 20 66 61 6c |PlayedOn|ce = fal|
|00001370| 73 65 3b 0d 0a 09 09 63 | 75 72 4e 6f 64 65 20 3d |se;....c|urNode =|
|00001380| 20 31 3b 0d 0a 09 09 75 | 56 61 6c 75 65 20 3d 20 | 1;....u|Value = |
|00001390| 30 3b 0d 0a 09 09 0d 0a | 09 09 2f 2f 20 50 75 74 |0;......|..// Put|
|000013a0| 20 74 68 65 20 61 63 74 | 6f 72 20 61 74 20 74 68 | the act|or at th|
|000013b0| 65 20 69 6e 69 74 69 61 | 6c 20 70 6f 73 69 74 69 |e initia|l positi|
|000013c0| 6f 6e 0d 0a 09 09 50 61 | 74 68 41 63 74 6f 72 2e |on....Pa|thActor.|
|000013d0| 53 65 74 4c 6f 63 61 74 | 69 6f 6e 28 20 50 61 74 |SetLocat|ion( Pat|
|000013e0| 68 5b 31 5d 2e 4c 6f 63 | 61 74 69 6f 6e 20 29 3b |h[1].Loc|ation );|
|000013f0| 0d 0a 09 09 2f 2f 50 61 | 74 68 41 63 74 6f 72 2e |....//Pa|thActor.|
|00001400| 53 65 74 52 6f 74 61 74 | 69 6f 6e 28 20 52 41 64 |SetRotat|ion( RAd|
|00001410| 6a 75 73 74 20 29 3b 0d | 0a 09 09 2f 2f 50 61 74 |just );.|...//Pat|
|00001420| 68 41 63 74 6f 72 2e 53 | 65 74 50 68 79 73 69 63 |hActor.S|etPhysic|
|00001430| 73 28 20 50 48 59 53 5f | 4e 6f 6e 65 20 29 3b 0d |s( PHYS_|None );.|
|00001440| 0a 0d 0a 09 09 2f 2f 20 | 53 6f 20 74 68 61 74 20 |.....// |So that |
|00001450| 74 68 65 20 6f 72 69 65 | 6e 74 61 74 69 6f 6e 20 |the orie|ntation |
|00001460| 6f 66 20 74 68 65 20 6f | 62 6a 65 63 74 20 63 61 |of the o|bject ca|
|00001470| 6e 20 62 65 20 73 65 74 | 20 69 6d 6d 65 64 69 61 |n be set| immedia|
|00001480| 74 65 6c 79 0d 0a 09 09 | 6c 61 73 74 50 6f 73 69 |tely....|lastPosi|
|00001490| 74 69 6f 6e 20 3d 20 50 | 61 74 68 5b 30 5d 2e 4c |tion = P|ath[0].L|
|000014a0| 6f 63 61 74 69 6f 6e 3b | 0d 0a 09 09 6c 61 73 74 |ocation;|....last|
|000014b0| 52 6f 74 61 74 69 6f 6e | 20 3d 20 50 61 74 68 41 |Rotation| = PathA|
|000014c0| 63 74 6f 72 2e 52 6f 74 | 61 74 69 6f 6e 3b 0d 0a |ctor.Rot|ation;..|
|000014d0| 09 09 0d 0a 09 09 2f 2f | 20 53 74 61 72 74 20 74 |......//| Start t|
|000014e0| 68 65 20 6d 6f 74 69 6f | 6e 0d 0a 09 09 45 6e 61 |he motio|n....Ena|
|000014f0| 62 6c 65 28 27 54 69 63 | 6b 27 29 3b 0d 0a 09 7d |ble('Tic|k');...}|
|00001500| 0d 0a 7d 0d 0a 0d 0a 66 | 75 6e 63 74 69 6f 6e 20 |..}....f|unction |
|00001510| 54 69 63 6b 28 20 66 6c | 6f 61 74 20 44 65 6c 74 |Tick( fl|oat Delt|
|00001520| 61 54 69 6d 65 20 29 0d | 0a 7b 0d 0a 09 6c 6f 63 |aTime ).|.{...loc|
|00001530| 61 6c 20 66 6c 6f 61 74 | 20 09 09 63 75 72 53 70 |al float| ..curSp|
|00001540| 65 65 64 55 3b 0d 0a 09 | 6c 6f 63 61 6c 20 76 65 |eedU;...|local ve|
|00001550| 63 74 6f 72 09 09 61 63 | 74 6f 72 50 6f 73 69 74 |ctor..ac|torPosit|
|00001560| 69 6f 6e 3b 0d 0a 09 6c | 6f 63 61 6c 20 72 6f 74 |ion;...l|ocal rot|
|00001570| 61 74 6f 72 20 09 20 20 | 20 20 61 63 74 6f 72 52 |ator . | actorR|
|00001580| 6f 74 61 74 69 6f 6e 3b | 0d 0a 0d 0a 09 69 66 28 |otation;|.....if(|
|00001590| 20 62 50 6c 61 79 65 64 | 4f 6e 63 65 20 29 0d 0a | bPlayed|Once )..|
|000015a0| 09 7b 0d 0a 09 09 44 69 | 73 61 62 6c 65 28 27 54 |.{....Di|sable('T|
|000015b0| 69 63 6b 27 29 3b 0d 0a | 09 09 72 65 74 75 72 6e |ick');..|..return|
|000015c0| 3b 0d 0a 09 7d 0d 0a 0d | 0a 09 2f 2f 20 55 70 64 |;...}...|..// Upd|
|000015d0| 61 74 65 20 74 68 65 20 | 70 6f 73 69 74 69 6f 6e |ate the |position|
|000015e0| 20 6f 66 20 74 68 65 20 | 6f 62 6a 65 63 74 2c 20 | of the |object, |
|000015f0| 62 61 73 65 64 20 6f 6e | 20 44 65 6c 74 61 54 69 |based on| DeltaTi|
|00001600| 6d 65 20 61 6e 64 20 69 | 74 27 73 0d 0a 09 2f 2f |me and i|t's...//|
|00001610| 20 69 6e 64 65 78 20 69 | 6e 20 74 68 65 20 73 65 | index i|n the se|
|00001620| 71 75 65 6e 63 65 20 6f | 66 20 70 6f 73 69 74 69 |quence o|f positi|
|00001630| 6f 6e 73 2e 0d 0a 09 09 | 0d 0a 09 2f 2f 20 49 6e |ons.....|...// In|
|00001640| 74 65 72 70 6f 6c 61 74 | 65 20 74 68 65 20 64 65 |terpolat|e the de|
|00001650| 6c 74 61 55 20 76 61 6c | 75 65 20 66 72 6f 6d 20 |ltaU val|ue from |
|00001660| 74 68 69 73 20 74 6f 20 | 74 68 65 20 6e 65 78 74 |this to |the next|
|00001670| 20 70 6f 73 69 74 69 6f | 6e 2c 0d 0a 09 2f 2f 20 | positio|n,...// |
|00001680| 62 61 73 65 64 20 6f 6e | 20 74 68 65 20 63 75 72 |based on| the cur|
|00001690| 72 65 6e 74 20 55 20 76 | 61 6c 75 65 20 69 6e 20 |rent U v|alue in |
|000016a0| 74 68 65 20 73 65 67 6d | 65 6e 74 2e 0d 0a 09 2f |the segm|ent..../|
|000016b0| 2f 20 46 49 58 4d 45 3a | 20 54 68 69 73 20 69 73 |/ FIXME:| This is|
|000016c0| 20 6e 6f 74 20 65 78 61 | 63 74 20 62 79 20 66 61 | not exa|ct by fa|
|000016d0| 72 2c 20 61 6e 64 20 77 | 6f 75 6c 64 20 63 61 75 |r, and w|ould cau|
|000016e0| 73 65 20 64 69 73 63 6f | 6e 74 69 6e 75 69 74 69 |se disco|ntinuiti|
|000016f0| 65 73 0d 0a 09 2f 2f 20 | 20 20 20 20 20 20 20 69 |es...// | i|
|00001700| 6e 20 76 65 6c 6f 63 69 | 74 79 20 69 66 20 74 68 |n veloci|ty if th|
|00001710| 65 20 61 72 63 6c 65 6e | 67 74 68 73 20 6f 66 20 |e arclen|gths of |
|00001720| 74 68 65 20 62 65 7a 69 | 65 72 27 73 20 61 72 65 |the bezi|er's are|
|00001730| 20 64 69 66 66 65 72 65 | 6e 74 2e 0d 0a 09 63 75 | differe|nt....cu|
|00001740| 72 53 70 65 65 64 55 20 | 3d 20 28 50 61 74 68 5b |rSpeedU |= (Path[|
|00001750| 63 75 72 4e 6f 64 65 2b | 31 5d 2e 73 70 65 65 64 |curNode+|1].speed|
|00001760| 55 20 2d 20 50 61 74 68 | 5b 63 75 72 4e 6f 64 65 |U - Path|[curNode|
|00001770| 5d 2e 73 70 65 65 64 55 | 29 2a 75 56 61 6c 75 65 |].speedU|)*uValue|
|00001780| 20 2b 0d 0a 09 09 09 09 | 50 61 74 68 5b 63 75 72 | +......|Path[cur|
|00001790| 4e 6f 64 65 5d 2e 73 70 | 65 65 64 55 3b 0d 0a 0d |Node].sp|eedU;...|
|000017a0| 0a 09 75 56 61 6c 75 65 | 20 2b 3d 20 63 75 72 53 |..uValue| += curS|
|000017b0| 70 65 65 64 55 20 2a 20 | 44 65 6c 74 61 54 69 6d |peedU * |DeltaTim|
|000017c0| 65 3b 0d 0a 09 0d 0a 09 | 2f 2f 20 43 68 65 63 6b |e;......|// Check|
|000017d0| 20 69 66 20 74 68 65 20 | 64 69 66 66 65 72 65 6e | if the |differen|
|000017e0| 63 65 20 73 65 6e 64 73 | 20 74 68 65 20 70 6f 69 |ce sends| the poi|
|000017f0| 6e 74 20 74 6f 20 74 68 | 65 20 6e 65 78 74 20 73 |nt to th|e next s|
|00001800| 65 67 6d 65 6e 74 20 28 | 6f 72 20 74 68 65 20 6f |egment (|or the o|
|00001810| 6e 65 20 61 66 74 65 72 | 20 74 68 61 74 2c 20 65 |ne after| that, e|
|00001820| 74 63 2e 2e 29 0d 0a 09 | 77 68 69 6c 65 28 20 75 |tc..)...|while( u|
|00001830| 56 61 6c 75 65 20 3e 3d | 20 31 20 26 26 20 63 75 |Value >=| 1 && cu|
|00001840| 72 4e 6f 64 65 20 3c 20 | 6e 75 6d 50 61 74 68 4e |rNode < |numPathN|
|00001850| 6f 64 65 73 2d 32 20 29 | 0d 0a 09 7b 0d 0a 09 09 |odes-2 )|...{....|
|00001860| 63 75 72 4e 6f 64 65 2b | 2b 3b 0d 0a 09 09 75 56 |curNode+|+;....uV|
|00001870| 61 6c 75 65 20 2d 3d 20 | 31 3b 0d 0a 09 7d 0d 0a |alue -= |1;...}..|
|00001880| 0d 0a 09 2f 2f 20 43 68 | 65 63 6b 20 69 66 20 74 |...// Ch|eck if t|
|00001890| 68 65 20 70 6f 69 6e 74 | 20 69 73 20 62 65 79 6f |he point| is beyo|
|000018a0| 6e 64 2c 20 6f 72 20 61 | 74 20 74 68 65 20 65 6e |nd, or a|t the en|
|000018b0| 64 20 6f 66 20 74 68 65 | 20 70 61 74 68 0d 0a 09 |d of the| path...|
|000018c0| 69 66 28 20 63 75 72 4e | 6f 64 65 20 3e 3d 20 6e |if( curN|ode >= n|
|000018d0| 75 6d 50 61 74 68 4e 6f | 64 65 73 2d 32 20 29 0d |umPathNo|des-2 ).|
|000018e0| 0a 09 7b 0d 0a 09 09 2f | 2f 20 53 65 74 20 74 68 |..{..../|/ Set th|
|000018f0| 65 20 70 6f 73 69 74 69 | 6f 6e 20 6f 66 20 74 68 |e positi|on of th|
|00001900| 65 20 6f 62 6a 65 63 74 | 20 74 6f 20 74 68 65 20 |e object| to the |
|00001910| 70 6f 73 69 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |position| of the |
|00001920| 6c 61 73 74 20 6e 6f 64 | 65 2e 0d 0a 09 09 50 61 |last nod|e.....Pa|
|00001930| 74 68 41 63 74 6f 72 2e | 53 65 74 4c 6f 63 61 74 |thActor.|SetLocat|
|00001940| 69 6f 6e 28 20 50 61 74 | 68 5b 6e 75 6d 50 61 74 |ion( Pat|h[numPat|
|00001950| 68 4e 6f 64 65 73 2d 32 | 5d 2e 4c 6f 63 61 74 69 |hNodes-2|].Locati|
|00001960| 6f 6e 20 29 3b 0d 0a 09 | 09 50 61 74 68 41 63 74 |on );...|.PathAct|
|00001970| 6f 72 2e 47 6f 74 6f 53 | 74 61 74 65 28 27 27 29 |or.GotoS|tate('')|
|00001980| 3b 0d 0a 0d 0a 09 09 2f | 2f 20 44 6f 6e 27 74 20 |;....../|/ Don't |
|00001990| 65 76 65 72 20 70 6c 61 | 79 20 69 74 20 61 67 61 |ever pla|y it aga|
|000019a0| 69 6e 21 21 21 0d 0a 09 | 09 62 50 6c 61 79 65 64 |in!!!...|.bPlayed|
|000019b0| 4f 6e 63 65 20 3d 20 74 | 72 75 65 3b 0d 0a 09 09 |Once = t|rue;....|
|000019c0| 0d 0a 09 09 2f 2f 20 46 | 69 6e 69 73 68 65 64 20 |....// F|inished |
|000019d0| 74 68 65 20 70 61 74 68 | 2c 20 64 69 73 63 6f 6e |the path|, discon|
|000019e0| 74 69 6e 75 65 20 74 68 | 65 20 75 70 64 61 74 65 |tinue th|e update|
|000019f0| 73 0d 0a 09 09 44 69 73 | 61 62 6c 65 28 20 27 54 |s....Dis|able( 'T|
|00001a00| 69 63 6b 27 20 29 3b 0d | 0a 09 09 44 69 73 61 62 |ick' );.|...Disab|
|00001a10| 6c 65 28 20 27 54 72 69 | 67 67 65 72 27 20 29 3b |le( 'Tri|gger' );|
|00001a20| 0d 0a 09 09 72 65 74 75 | 72 6e 3b 0d 0a 09 7d 0d |....retu|rn;...}.|
|00001a30| 0a 09 09 09 09 09 0d 0a | 09 2f 2f 20 43 61 6c 63 |........|.// Calc|
|00001a40| 75 6c 61 74 65 20 74 68 | 65 20 70 6f 73 69 74 69 |ulate th|e positi|
|00001a50| 6f 6e 20 6f 66 20 74 68 | 65 20 6f 62 6a 65 63 74 |on of th|e object|
|00001a60| 20 62 61 73 65 64 20 6f | 6e 20 74 68 65 20 63 75 | based o|n the cu|
|00001a70| 72 72 65 6e 74 20 6e 6f | 64 65 20 69 6e 64 65 78 |rrent no|de index|
|00001a80| 0d 0a 09 2f 2f 20 61 6e | 64 20 55 20 6f 66 66 73 |...// an|d U offs|
|00001a90| 65 74 20 69 6e 20 74 68 | 65 20 63 75 72 76 65 20 |et in th|e curve |
|00001aa0| 73 65 67 6d 65 6e 74 2e | 0d 0a 09 2f 2f 20 20 20 |segment.|...// |
|00001ab0| 42 30 28 75 29 20 3d 20 | 28 31 2d 75 29 5e 33 09 |B0(u) = |(1-u)^3.|
|00001ac0| 09 09 09 42 65 72 6e 73 | 74 65 69 6e 20 62 61 73 |...Berns|tein bas|
|00001ad0| 69 73 20 70 6f 6c 79 73 | 0d 0a 09 2f 2f 20 20 20 |is polys|...// |
|00001ae0| 42 31 28 75 29 20 3d 20 | 33 75 28 31 2d 75 29 5e |B1(u) = |3u(1-u)^|
|00001af0| 32 0d 0a 09 2f 2f 20 20 | 20 42 32 28 75 29 20 3d |2...// | B2(u) =|
|00001b00| 20 33 75 5e 32 28 31 2d | 75 29 0d 0a 09 2f 2f 20 | 3u^2(1-|u)...// |
|00001b10| 20 20 42 33 28 75 29 20 | 3d 20 75 5e 33 0d 0a 09 | B3(u) |= u^3...|
|00001b20| 61 63 74 6f 72 50 6f 73 | 69 74 69 6f 6e 20 20 3d |actorPos|ition =|
|00001b30| 20 50 61 74 68 5b 63 75 | 72 4e 6f 64 65 5d 2e 4c | Path[cu|rNode].L|
|00001b40| 6f 63 61 74 69 6f 6e 20 | 2a 20 28 28 31 20 2d 20 |ocation |* ((1 - |
|00001b50| 75 56 61 6c 75 65 29 2a | 2a 33 29 20 2b 0d 0a 09 |uValue)*|*3) +...|
|00001b60| 09 09 09 09 28 50 61 74 | 68 5b 63 75 72 4e 6f 64 |....(Pat|h[curNod|
|00001b70| 65 5d 2e 4c 6f 63 61 74 | 69 6f 6e 20 2b 20 50 61 |e].Locat|ion + Pa|
|00001b80| 74 68 5b 63 75 72 4e 6f | 64 65 5d 2e 70 56 65 6c |th[curNo|de].pVel|
|00001b90| 6f 63 69 74 79 29 20 2a | 0d 0a 09 09 09 09 09 20 |ocity) *|....... |
|00001ba0| 28 33 2a 75 56 61 6c 75 | 65 2a 20 28 28 31 2d 75 |(3*uValu|e* ((1-u|
|00001bb0| 56 61 6c 75 65 29 2a 2a | 32 29 29 20 2b 0d 0a 09 |Value)**|2)) +...|
|00001bc0| 09 09 09 09 28 50 61 74 | 68 5b 63 75 72 4e 6f 64 |....(Pat|h[curNod|
|00001bd0| 65 2b 31 5d 2e 4c 6f 63 | 61 74 69 6f 6e 20 2d 20 |e+1].Loc|ation - |
|00001be0| 50 61 74 68 5b 63 75 72 | 4e 6f 64 65 2b 31 5d 2e |Path[cur|Node+1].|
|00001bf0| 70 56 65 6c 6f 63 69 74 | 79 29 20 2a 0d 0a 09 09 |pVelocit|y) *....|
|00001c00| 09 09 09 20 28 33 2a 28 | 75 56 61 6c 75 65 2a 2a |... (3*(|uValue**|
|00001c10| 32 29 2a 20 28 31 2d 75 | 56 61 6c 75 65 29 29 20 |2)* (1-u|Value)) |
|00001c20| 2b 0d 0a 09 09 09 09 09 | 50 61 74 68 5b 63 75 72 |+.......|Path[cur|
|00001c30| 4e 6f 64 65 2b 31 5d 2e | 4c 6f 63 61 74 69 6f 6e |Node+1].|Location|
|00001c40| 20 2a 20 28 75 56 61 6c | 75 65 2a 2a 33 29 3b 0d | * (uVal|ue**3);.|
|00001c50| 0a 09 0d 0a 09 50 61 74 | 68 41 63 74 6f 72 2e 4d |.....Pat|hActor.M|
|00001c60| 6f 76 65 28 20 61 63 74 | 6f 72 50 6f 73 69 74 69 |ove( act|orPositi|
|00001c70| 6f 6e 20 2d 20 50 61 74 | 68 41 63 74 6f 72 2e 4c |on - Pat|hActor.L|
|00001c80| 6f 63 61 74 69 6f 6e 20 | 29 3b 0d 0a 09 09 0d 0a |ocation |);......|
|00001c90| 09 2f 2f 20 43 61 6c 63 | 75 6c 61 74 65 20 6e 65 |.// Calc|ulate ne|
|00001ca0| 77 20 50 69 74 63 68 2c | 20 59 61 77 2c 20 52 6f |w Pitch,| Yaw, Ro|
|00001cb0| 6c 6c 20 76 61 6c 75 65 | 73 20 69 66 20 61 70 70 |ll value|s if app|
|00001cc0| 6c 69 63 61 62 6c 65 2e | 0d 0a 09 61 63 74 6f 72 |licable.|...actor|
|00001cd0| 52 6f 74 61 74 69 6f 6e | 20 3d 20 72 6f 74 61 74 |Rotation| = rotat|
|00001ce0| 6f 72 28 20 61 63 74 6f | 72 50 6f 73 69 74 69 6f |or( acto|rPositio|
|00001cf0| 6e 20 2d 20 6c 61 73 74 | 50 6f 73 69 74 69 6f 6e |n - last|Position|
|00001d00| 20 29 3b 0d 0a 09 61 63 | 74 6f 72 52 6f 74 61 74 | );...ac|torRotat|
|00001d10| 69 6f 6e 20 2b 3d 20 52 | 41 64 6a 75 73 74 3b 0d |ion += R|Adjust;.|
|00001d20| 0a 0d 0a 09 69 66 28 20 | 21 62 41 6c 74 65 72 50 |....if( |!bAlterP|
|00001d30| 69 74 63 68 20 29 20 61 | 63 74 6f 72 52 6f 74 61 |itch ) a|ctorRota|
|00001d40| 74 69 6f 6e 2e 50 69 74 | 63 68 20 3d 20 6c 61 73 |tion.Pit|ch = las|
|00001d50| 74 52 6f 74 61 74 69 6f | 6e 2e 50 69 74 63 68 3b |tRotatio|n.Pitch;|
|00001d60| 0d 0a 09 69 66 28 20 21 | 62 41 6c 74 65 72 59 61 |...if( !|bAlterYa|
|00001d70| 77 20 20 20 29 20 61 63 | 74 6f 72 52 6f 74 61 74 |w ) ac|torRotat|
|00001d80| 69 6f 6e 2e 59 61 77 20 | 20 20 3d 20 6c 61 73 74 |ion.Yaw | = last|
|00001d90| 52 6f 74 61 74 69 6f 6e | 2e 59 61 77 3b 0d 0a 09 |Rotation|.Yaw;...|
|00001da0| 2f 2f 20 54 68 65 20 72 | 6f 6c 6c 20 69 73 20 70 |// The r|oll is p|
|00001db0| 72 6f 70 6f 72 74 69 6f | 6e 61 6c 20 74 6f 20 74 |roportio|nal to t|
|00001dc0| 68 65 20 63 68 61 6e 67 | 65 20 69 6e 20 79 61 77 |he chang|e in yaw|
|00001dd0| 20 28 61 69 72 70 6c 61 | 6e 65 20 74 75 72 6e 69 | (airpla|ne turni|
|00001de0| 6e 67 20 65 66 66 65 63 | 74 29 0d 0a 09 69 66 28 |ng effec|t)...if(|
|00001df0| 20 21 62 41 6c 74 65 72 | 52 6f 6c 6c 20 20 29 20 | !bAlter|Roll ) |
|00001e00| 61 63 74 6f 72 52 6f 74 | 61 74 69 6f 6e 2e 52 6f |actorRot|ation.Ro|
|00001e10| 6c 6c 20 20 3d 20 6c 61 | 73 74 52 6f 74 61 74 69 |ll = la|stRotati|
|00001e20| 6f 6e 2e 52 6f 6c 6c 3b | 0d 0a 09 20 20 20 20 20 |on.Roll;|... |
|00001e30| 20 20 20 20 20 20 20 20 | 20 65 6c 73 65 20 61 63 | | else ac|
|00001e40| 74 6f 72 52 6f 74 61 74 | 69 6f 6e 2e 52 6f 6c 6c |torRotat|ion.Roll|
|00001e50| 20 20 3d 20 30 2e 34 2a | 28 61 63 74 6f 72 52 6f | = 0.4*|(actorRo|
|00001e60| 74 61 74 69 6f 6e 2e 59 | 61 77 20 2d 20 6c 61 73 |tation.Y|aw - las|
|00001e70| 74 52 6f 74 61 74 69 6f | 6e 2e 59 61 77 29 3b 0d |tRotatio|n.Yaw);.|
|00001e80| 0a 0d 0a 09 50 61 74 68 | 41 63 74 6f 72 2e 53 65 |....Path|Actor.Se|
|00001e90| 74 52 6f 74 61 74 69 6f | 6e 28 20 61 63 74 6f 72 |tRotatio|n( actor|
|00001ea0| 52 6f 74 61 74 69 6f 6e | 20 29 3b 0d 0a 09 0d 0a |Rotation| );.....|
|00001eb0| 09 2f 2f 20 53 61 76 65 | 20 74 68 69 73 20 66 72 |.// Save| this fr|
|00001ec0| 61 6d 65 27 73 20 70 6f | 73 69 74 69 6f 6e 2f 79 |ame's po|sition/y|
|00001ed0| 61 77 20 66 6f 72 20 6e | 65 78 74 20 66 72 61 6d |aw for n|ext fram|
|00001ee0| 65 20 63 61 6c 63 75 6c | 61 74 69 6f 6e 73 0d 0a |e calcul|ations..|
|00001ef0| 09 6c 61 73 74 52 6f 74 | 61 74 69 6f 6e 20 3d 20 |.lastRot|ation = |
|00001f00| 61 63 74 6f 72 52 6f 74 | 61 74 69 6f 6e 3b 0d 0a |actorRot|ation;..|
|00001f10| 09 6c 61 73 74 50 6f 73 | 69 74 69 6f 6e 20 3d 20 |.lastPos|ition = |
|00001f20| 61 63 74 6f 72 50 6f 73 | 69 74 69 6f 6e 3b 0d 0a |actorPos|ition;..|
|00001f30| 7d 0d 0a 0d 0a 00 | |}..... | |
+--------+-------------------------+-------------------------+--------+--------+