home *** CD-ROM | disk | FTP | other *** search
Unknown | 1999-11-02 | 17.1 KB |
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| file
| data
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 00 00 00 00 00 00 00 | 70 90 02 2f 2f 3d 3d 3d |........|p..//===|
|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 3d 0d 0a 2f 2f 20 42 |========|==..// B|
|00000060| 65 68 61 76 69 6f 72 43 | 6f 6e 73 74 72 61 69 6e |ehaviorC|onstrain|
|00000070| 65 72 2e 75 63 0d 0a 2f | 2f 20 24 41 75 74 68 6f |er.uc../|/ $Autho|
|00000080| 72 3a 20 4d 66 6f 78 20 | 24 0d 0a 2f 2f 20 24 44 |r: Mfox |$..// $D|
|00000090| 61 74 65 3a 20 31 30 2f | 32 36 2f 39 39 20 35 3a |ate: 10/|26/99 5:|
|000000a0| 33 38 70 20 24 0d 0a 2f | 2f 20 24 52 65 76 69 73 |38p $../|/ $Revis|
|000000b0| 69 6f 6e 3a 20 31 20 24 | 0d 0a 2f 2f 3d 3d 3d 3d |ion: 1 $|..//====|
|000000c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000100| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0d 0a 0d 0a 63 6c 61 |========|=....cla|
|00000110| 73 73 20 42 65 68 61 76 | 69 6f 72 43 6f 6e 73 74 |ss Behav|iorConst|
|00000120| 72 61 69 6e 65 72 20 65 | 78 70 61 6e 64 73 20 41 |rainer e|xpands A|
|00000130| 69 43 6f 6d 70 6f 6e 65 | 6e 74 3b 0d 0a 0d 0a 76 |iCompone|nt;....v|
|00000140| 61 72 20 28 29 20 66 6c | 6f 61 74 20 4d 61 78 44 |ar () fl|oat MaxD|
|00000150| 69 73 74 61 6e 63 65 3b | 09 09 2f 2f 75 73 65 64 |istance;|..//used|
|00000160| 20 62 79 20 47 65 74 43 | 75 72 72 65 6e 74 4d 61 | by GetC|urrentMa|
|00000170| 78 44 69 73 74 61 6e 63 | 65 0d 0a 76 61 72 20 28 |xDistanc|e..var (|
|00000180| 29 20 66 6c 6f 61 74 20 | 4d 69 6e 44 69 73 74 61 |) float |MinDista|
|00000190| 6e 63 65 3b 09 09 2f 2f | 75 73 65 64 20 62 79 20 |nce;..//|used by |
|000001a0| 47 65 74 43 75 72 72 65 | 6e 74 4d 69 6e 44 69 73 |GetCurre|ntMinDis|
|000001b0| 74 61 6e 63 65 0d 0a 76 | 61 72 20 28 29 20 52 6f |tance..v|ar () Ro|
|000001c0| 74 61 74 6f 72 20 4d 69 | 6e 44 65 6c 74 61 52 6f |tator Mi|nDeltaRo|
|000001d0| 74 61 74 69 6f 6e 3b 09 | 2f 2f 75 73 65 64 20 62 |tation;.|//used b|
|000001e0| 79 20 46 69 6e 64 55 6e | 6f 62 73 74 72 75 63 74 |y FindUn|obstruct|
|000001f0| 65 64 44 65 73 74 69 6e | 61 74 69 6f 6e 20 61 6e |edDestin|ation an|
|00000200| 64 20 44 65 74 65 72 6d | 69 6e 65 52 6f 74 61 74 |d Determ|ineRotat|
|00000210| 69 6f 6e 0d 0a 0d 0a 2f | 2f 69 66 20 74 68 65 20 |ion..../|/if the |
|00000220| 6d 6f 76 65 74 6f 20 64 | 69 73 74 61 6e 63 65 20 |moveto d|istance |
|00000230| 69 73 20 6c 65 73 73 20 | 74 68 61 6e 20 74 68 69 |is less |than thi|
|00000240| 73 20 6e 75 6d 62 65 72 | 20 74 68 65 20 70 61 77 |s number| the paw|
|00000250| 6e 20 77 69 6c 6c 20 6e | 65 76 65 72 20 72 65 61 |n will n|ever rea|
|00000260| 63 68 20 69 74 73 20 64 | 65 73 74 69 6e 61 74 69 |ch its d|estinati|
|00000270| 6f 6e 0d 0a 63 6f 6e 73 | 74 20 4d 61 67 69 63 4d |on..cons|t MagicM|
|00000280| 69 6e 44 69 73 74 61 6e | 63 65 20 3d 20 31 36 3b |inDistan|ce = 16;|
|00000290| 09 09 09 09 09 09 2f 2f | 75 73 65 64 20 62 79 20 |......//|used by |
|000002a0| 47 65 74 43 75 72 72 65 | 6e 74 4d 69 6e 44 69 73 |GetCurre|ntMinDis|
|000002b0| 74 61 6e 63 65 0d 0a 63 | 6f 6e 73 74 20 46 69 6e |tance..c|onst Fin|
|000002c0| 64 55 6e 6f 62 73 74 72 | 75 63 74 65 64 44 65 73 |dUnobstr|uctedDes|
|000002d0| 74 69 6e 61 74 69 6f 6e | 4d 61 78 44 65 6c 74 61 |tination|MaxDelta|
|000002e0| 59 61 77 20 3d 20 31 36 | 33 38 34 3b 09 2f 2f 75 |Yaw = 16|384;.//u|
|000002f0| 73 65 64 20 62 79 20 46 | 69 6e 64 55 6e 6f 62 73 |sed by F|indUnobs|
|00000300| 74 72 75 63 74 65 64 44 | 65 73 74 69 6e 61 74 69 |tructedD|estinati|
|00000310| 6f 6e 20 28 77 69 74 68 | 69 6e 20 39 30 20 64 65 |on (with|in 90 de|
|00000320| 67 72 65 65 73 29 0d 0a | 63 6f 6e 73 74 20 46 69 |grees)..|const Fi|
|00000330| 6e 64 55 6e 6f 62 73 74 | 72 75 63 74 65 64 44 65 |ndUnobst|ructedDe|
|00000340| 73 74 69 6e 61 74 69 6f | 6e 44 65 6c 74 61 59 61 |stinatio|nDeltaYa|
|00000350| 77 20 3d 20 35 30 30 3b | 09 2f 2f 75 73 65 64 20 |w = 500;|.//used |
|00000360| 62 79 20 46 69 6e 64 55 | 6e 6f 62 73 74 72 75 63 |by FindU|nobstruc|
|00000370| 74 65 64 44 65 73 74 69 | 6e 61 74 69 6f 6e 0d 0a |tedDesti|nation..|
|00000380| 0d 0a 0d 0a 66 75 6e 63 | 74 69 6f 6e 20 66 6c 6f |....func|tion flo|
|00000390| 61 74 20 47 65 74 43 75 | 72 72 65 6e 74 4d 61 78 |at GetCu|rrentMax|
|000003a0| 4d 65 6c 65 65 44 69 73 | 74 61 6e 63 65 28 20 41 |MeleeDis|tance( A|
|000003b0| 63 74 6f 72 20 43 6f 6e | 73 74 72 61 69 6e 65 64 |ctor Con|strained|
|000003c0| 41 63 74 6f 72 20 29 0d | 0a 7b 0d 0a 09 6c 6f 63 |Actor ).|.{...loc|
|000003d0| 61 6c 20 50 61 77 6e 20 | 43 6f 6e 73 74 72 61 69 |al Pawn |Constrai|
|000003e0| 6e 65 64 50 61 77 6e 3b | 0d 0a 09 6c 6f 63 61 6c |nedPawn;|...local|
|000003f0| 20 66 6c 6f 61 74 20 4d | 61 78 4d 65 6c 65 65 44 | float M|axMeleeD|
|00000400| 69 73 74 61 6e 63 65 3b | 0d 0a 09 0d 0a 09 43 6f |istance;|......Co|
|00000410| 6e 73 74 72 61 69 6e 65 | 64 50 61 77 6e 20 3d 20 |nstraine|dPawn = |
|00000420| 50 61 77 6e 28 20 43 6f | 6e 73 74 72 61 69 6e 65 |Pawn( Co|nstraine|
|00000430| 64 41 63 74 6f 72 20 29 | 3b 0d 0a 09 0d 0a 09 69 |dActor )|;......i|
|00000440| 66 28 20 43 6f 6e 73 74 | 72 61 69 6e 65 64 50 61 |f( Const|rainedPa|
|00000450| 77 6e 20 21 3d 20 6e 6f | 6e 65 20 29 0d 0a 09 7b |wn != no|ne )...{|
|00000460| 0d 0a 09 09 4d 61 78 4d | 65 6c 65 65 44 69 73 74 |....MaxM|eleeDist|
|00000470| 61 6e 63 65 20 3d 20 43 | 6f 6e 73 74 72 61 69 6e |ance = C|onstrain|
|00000480| 65 64 50 61 77 6e 2e 4d | 65 6c 65 65 52 61 6e 67 |edPawn.M|eleeRang|
|00000490| 65 3b 0d 0a 09 7d 0d 0a | 09 72 65 74 75 72 6e 20 |e;...}..|.return |
|000004a0| 4d 61 78 4d 65 6c 65 65 | 44 69 73 74 61 6e 63 65 |MaxMelee|Distance|
|000004b0| 3b 0d 0a 7d 0d 0a 0d 0a | 0d 0a 0d 0a 66 75 6e 63 |;..}....|....func|
|000004c0| 74 69 6f 6e 20 66 6c 6f | 61 74 20 47 65 74 43 75 |tion flo|at GetCu|
|000004d0| 72 72 65 6e 74 4d 61 78 | 47 75 61 72 64 44 69 73 |rrentMax|GuardDis|
|000004e0| 74 61 6e 63 65 28 20 41 | 63 74 6f 72 20 43 6f 6e |tance( A|ctor Con|
|000004f0| 73 74 72 61 69 6e 65 64 | 41 63 74 6f 72 20 29 0d |strained|Actor ).|
|00000500| 0a 7b 0d 0a 09 6c 6f 63 | 61 6c 20 4c 65 67 65 6e |.{...loc|al Legen|
|00000510| 64 50 61 77 6e 20 43 6f | 6e 73 74 72 61 69 6e 65 |dPawn Co|nstraine|
|00000520| 64 4c 65 67 65 6e 64 50 | 61 77 6e 3b 0d 0a 09 6c |dLegendP|awn;...l|
|00000530| 6f 63 61 6c 20 66 6c 6f | 61 74 20 4d 61 78 47 75 |ocal flo|at MaxGu|
|00000540| 61 72 64 44 69 73 74 61 | 6e 63 65 3b 0d 0a 09 0d |ardDista|nce;....|
|00000550| 0a 09 43 6f 6e 73 74 72 | 61 69 6e 65 64 4c 65 67 |..Constr|ainedLeg|
|00000560| 65 6e 64 50 61 77 6e 20 | 3d 20 4c 65 67 65 6e 64 |endPawn |= Legend|
|00000570| 50 61 77 6e 28 20 43 6f | 6e 73 74 72 61 69 6e 65 |Pawn( Co|nstraine|
|00000580| 64 41 63 74 6f 72 20 29 | 3b 0d 0a 09 0d 0a 09 69 |dActor )|;......i|
|00000590| 66 28 20 43 6f 6e 73 74 | 72 61 69 6e 65 64 4c 65 |f( Const|rainedLe|
|000005a0| 67 65 6e 64 50 61 77 6e | 20 21 3d 20 6e 6f 6e 65 |gendPawn| != none|
|000005b0| 20 29 0d 0a 09 7b 0d 0a | 09 09 4d 61 78 47 75 61 | )...{..|..MaxGua|
|000005c0| 72 64 44 69 73 74 61 6e | 63 65 20 3d 20 43 6f 6e |rdDistan|ce = Con|
|000005d0| 73 74 72 61 69 6e 65 64 | 4c 65 67 65 6e 64 50 61 |strained|LegendPa|
|000005e0| 77 6e 2e 47 6f 61 6c 50 | 72 69 6f 72 69 74 79 44 |wn.GoalP|riorityD|
|000005f0| 69 73 74 61 6e 63 65 73 | 5b 20 43 6f 6e 73 74 72 |istances|[ Constr|
|00000600| 61 69 6e 65 64 4c 65 67 | 65 6e 64 50 61 77 6e 2e |ainedLeg|endPawn.|
|00000610| 47 6f 61 6c 49 6e 64 65 | 78 28 20 47 49 5f 47 75 |GoalInde|x( GI_Gu|
|00000620| 61 72 64 69 6e 67 20 29 | 20 5d 3b 0d 0a 09 7d 0d |arding )| ];...}.|
|00000630| 0a 09 72 65 74 75 72 6e | 20 4d 61 78 47 75 61 72 |..return| MaxGuar|
|00000640| 64 44 69 73 74 61 6e 63 | 65 3b 0d 0a 7d 0d 0a 0d |dDistanc|e;..}...|
|00000650| 0a 0d 0a 0d 0a 66 75 6e | 63 74 69 6f 6e 20 66 6c |.....fun|ction fl|
|00000660| 6f 61 74 20 47 65 74 43 | 75 72 72 65 6e 74 4d 61 |oat GetC|urrentMa|
|00000670| 78 46 69 6e 64 48 65 6c | 70 44 69 73 74 61 6e 63 |xFindHel|pDistanc|
|00000680| 65 28 20 41 63 74 6f 72 | 20 43 6f 6e 73 74 72 61 |e( Actor| Constra|
|00000690| 69 6e 65 64 41 63 74 6f | 72 20 29 0d 0a 7b 0d 0a |inedActo|r )..{..|
|000006a0| 09 72 65 74 75 72 6e 20 | 30 3b 0d 0a 7d 0d 0a 0d |.return |0;..}...|
|000006b0| 0a 0d 0a 0d 0a 66 75 6e | 63 74 69 6f 6e 20 66 6c |.....fun|ction fl|
|000006c0| 6f 61 74 20 47 65 74 43 | 75 72 72 65 6e 74 4d 69 |oat GetC|urrentMi|
|000006d0| 6e 54 72 61 76 65 6c 44 | 69 73 74 61 6e 63 65 28 |nTravelD|istance(|
|000006e0| 20 41 63 74 6f 72 20 43 | 6f 6e 73 74 72 61 69 6e | Actor C|onstrain|
|000006f0| 65 64 41 63 74 6f 72 20 | 29 0d 0a 7b 0d 0a 09 72 |edActor |)..{...r|
|00000700| 65 74 75 72 6e 20 4d 61 | 78 28 20 4d 69 6e 44 69 |eturn Ma|x( MinDi|
|00000710| 73 74 61 6e 63 65 2c 20 | 4d 61 67 69 63 4d 69 6e |stance, |MagicMin|
|00000720| 44 69 73 74 61 6e 63 65 | 20 29 3b 0d 0a 7d 0d 0a |Distance| );..}..|
|00000730| 0d 0a 0d 0a 0d 0a 66 75 | 6e 63 74 69 6f 6e 20 66 |......fu|nction f|
|00000740| 6c 6f 61 74 20 47 65 74 | 43 75 72 72 65 6e 74 4d |loat Get|CurrentM|
|00000750| 61 78 54 72 61 76 65 6c | 44 69 73 74 61 6e 63 65 |axTravel|Distance|
|00000760| 28 20 41 63 74 6f 72 20 | 43 6f 6e 73 74 72 61 69 |( Actor |Constrai|
|00000770| 6e 65 64 41 63 74 6f 72 | 20 29 0d 0a 7b 0d 0a 09 |nedActor| )..{...|
|00000780| 72 65 74 75 72 6e 20 46 | 4d 61 78 28 20 4d 61 78 |return F|Max( Max|
|00000790| 44 69 73 74 61 6e 63 65 | 2c 20 47 65 74 43 75 72 |Distance|, GetCur|
|000007a0| 72 65 6e 74 4d 69 6e 54 | 72 61 76 65 6c 44 69 73 |rentMinT|ravelDis|
|000007b0| 74 61 6e 63 65 28 20 43 | 6f 6e 73 74 72 61 69 6e |tance( C|onstrain|
|000007c0| 65 64 41 63 74 6f 72 20 | 29 20 29 3b 0d 0a 7d 0d |edActor |) );..}.|
|000007d0| 0a 0d 0a 0d 0a 0d 0a 2f | 2f 54 68 69 73 20 66 75 |......./|/This fu|
|000007e0| 6e 63 74 69 6f 6e 20 64 | 65 74 65 72 6d 69 6e 65 |nction d|etermine|
|000007f0| 73 20 74 68 65 20 6d 69 | 6e 69 6d 75 6d 20 64 69 |s the mi|nimum di|
|00000800| 73 74 61 6e 63 65 20 74 | 68 61 74 20 6d 75 73 74 |stance t|hat must|
|00000810| 20 62 65 0d 0a 2f 2f 70 | 72 65 73 65 6e 74 20 62 | be..//p|resent b|
|00000820| 65 74 77 65 65 6e 20 74 | 68 65 20 63 6f 6e 73 74 |etween t|he const|
|00000830| 72 61 69 6e 65 64 20 61 | 63 74 6f 72 20 61 6e 64 |rained a|ctor and|
|00000840| 20 74 68 65 20 67 6f 61 | 6c 2e 20 0d 0a 66 75 6e | the goa|l. ..fun|
|00000850| 63 74 69 6f 6e 20 66 6c | 6f 61 74 20 47 65 74 4d |ction fl|oat GetM|
|00000860| 69 6e 69 6d 75 6d 47 6f | 61 6c 44 69 73 74 61 6e |inimumGo|alDistan|
|00000870| 63 65 28 20 41 63 74 6f | 72 20 43 6f 6e 73 74 72 |ce( Acto|r Constr|
|00000880| 61 69 6e 65 64 41 63 74 | 6f 72 2c 20 47 6f 61 6c |ainedAct|or, Goal|
|00000890| 41 62 73 74 72 61 63 74 | 65 72 49 6e 74 65 72 66 |Abstract|erInterf|
|000008a0| 20 47 6f 61 6c 20 29 0d | 0a 7b 0d 0a 09 6c 6f 63 | Goal ).|.{...loc|
|000008b0| 61 6c 20 66 6c 6f 61 74 | 20 4d 69 6e 69 6d 75 6d |al float| Minimum|
|000008c0| 47 6f 61 6c 44 69 73 74 | 61 6e 63 65 3b 0d 0a 09 |GoalDist|ance;...|
|000008d0| 6c 6f 63 61 6c 20 56 65 | 63 74 6f 72 20 47 6f 61 |local Ve|ctor Goa|
|000008e0| 6c 4c 6f 63 61 74 69 6f | 6e 3b 0d 0a 09 6c 6f 63 |lLocatio|n;...loc|
|000008f0| 61 6c 20 66 6c 6f 61 74 | 20 47 6f 61 6c 52 61 64 |al float| GoalRad|
|00000900| 69 75 73 2c 20 47 6f 61 | 6c 48 61 6c 66 48 65 69 |ius, Goa|lHalfHei|
|00000910| 67 68 74 3b 0d 0a 09 0d | 0a 09 4d 69 6e 69 6d 75 |ght;....|..Minimu|
|00000920| 6d 47 6f 61 6c 44 69 73 | 74 61 6e 63 65 20 3d 20 |mGoalDis|tance = |
|00000930| 43 6f 6e 73 74 72 61 69 | 6e 65 64 41 63 74 6f 72 |Constrai|nedActor|
|00000940| 2e 43 6f 6c 6c 69 73 69 | 6f 6e 52 61 64 69 75 73 |.Collisi|onRadius|
|00000950| 3b 0d 0a 09 0d 0a 09 69 | 66 28 20 47 6f 61 6c 2e |;......i|f( Goal.|
|00000960| 47 65 74 47 6f 61 6c 50 | 61 72 61 6d 73 28 20 43 |GetGoalP|arams( C|
|00000970| 6f 6e 73 74 72 61 69 6e | 65 64 41 63 74 6f 72 2c |onstrain|edActor,|
|00000980| 20 47 6f 61 6c 4c 6f 63 | 61 74 69 6f 6e 2c 20 47 | GoalLoc|ation, G|
|00000990| 6f 61 6c 52 61 64 69 75 | 73 2c 20 47 6f 61 6c 48 |oalRadiu|s, GoalH|
|000009a0| 61 6c 66 48 65 69 67 68 | 74 20 29 20 29 0d 0a 09 |alfHeigh|t ) )...|
|000009b0| 7b 0d 0a 09 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |{....//L|og( Cons|
|000009c0| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|000009d0| 3a 3a 42 65 68 61 76 69 | 6f 72 43 6f 6e 73 74 72 |::Behavi|orConstr|
|000009e0| 61 69 6e 65 72 3a 3a 47 | 65 74 4d 69 6e 69 6d 75 |ainer::G|etMinimu|
|000009f0| 6d 47 6f 61 6c 44 69 73 | 74 61 6e 63 65 22 20 29 |mGoalDis|tance" )|
|00000a00| 3b 0d 0a 09 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |;....//L|og( Cons|
|00000a10| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|00000a20| 09 09 67 6f 61 6c 20 72 | 61 64 69 75 73 20 22 20 |..goal r|adius " |
|00000a30| 24 20 47 6f 61 6c 52 61 | 64 69 75 73 20 29 3b 0d |$ GoalRa|dius );.|
|00000a40| 0a 09 09 2f 2f 4c 6f 67 | 28 20 43 6f 6e 73 74 72 |...//Log|( Constr|
|00000a50| 61 69 6e 65 64 41 63 74 | 6f 72 20 24 20 22 09 09 |ainedAct|or $ "..|
|00000a60| 61 63 74 6f 72 20 72 61 | 64 69 75 73 20 22 20 24 |actor ra|dius " $|
|00000a70| 20 43 6f 6e 73 74 72 61 | 69 6e 65 64 41 63 74 6f | Constra|inedActo|
|00000a80| 72 2e 43 6f 6c 6c 69 73 | 69 6f 6e 52 61 64 69 75 |r.Collis|ionRadiu|
|00000a90| 73 20 29 3b 0d 0a 09 09 | 4d 69 6e 69 6d 75 6d 47 |s );....|MinimumG|
|00000aa0| 6f 61 6c 44 69 73 74 61 | 6e 63 65 20 2b 3d 20 47 |oalDista|nce += G|
|00000ab0| 6f 61 6c 52 61 64 69 75 | 73 3b 0d 0a 09 7d 0d 0a |oalRadiu|s;...}..|
|00000ac0| 09 0d 0a 09 2f 2f 4c 6f | 67 28 20 43 6f 6e 73 74 |....//Lo|g( Const|
|00000ad0| 72 61 69 6e 65 64 41 63 | 74 6f 72 20 24 20 22 3a |rainedAc|tor $ ":|
|00000ae0| 3a 42 65 68 61 76 69 6f | 72 43 6f 6e 73 74 72 61 |:Behavio|rConstra|
|00000af0| 69 6e 65 72 3a 3a 47 65 | 74 4d 69 6e 69 6d 75 6d |iner::Ge|tMinimum|
|00000b00| 47 6f 61 6c 44 69 73 74 | 61 6e 63 65 20 72 65 74 |GoalDist|ance ret|
|00000b10| 75 72 6e 69 6e 67 20 22 | 20 24 20 4d 69 6e 69 6d |urning "| $ Minim|
|00000b20| 75 6d 47 6f 61 6c 44 69 | 73 74 61 6e 63 65 20 29 |umGoalDi|stance )|
|00000b30| 3b 0d 0a 09 72 65 74 75 | 72 6e 20 4d 69 6e 69 6d |;...retu|rn Minim|
|00000b40| 75 6d 47 6f 61 6c 44 69 | 73 74 61 6e 63 65 3b 0d |umGoalDi|stance;.|
|00000b50| 0a 7d 0d 0a 0d 0a 0d 0a | 0d 0a 2f 2a 0d 0a 41 64 |.}......|../*..Ad|
|00000b60| 6a 75 73 74 54 77 6f 44 | 69 6d 65 6e 73 69 6f 6e |justTwoD|imension|
|00000b70| 61 6c 44 69 73 74 61 6e | 63 65 3a 0d 0a 0d 0a 41 |alDistan|ce:....A|
|00000b80| 64 6a 75 73 74 20 74 68 | 65 20 74 77 6f 20 64 69 |djust th|e two di|
|00000b90| 6d 65 6e 73 69 6f 6e 61 | 6c 20 64 69 73 74 61 6e |mensiona|l distan|
|00000ba0| 63 65 20 62 65 74 77 65 | 65 6e 20 74 68 65 20 70 |ce betwe|en the p|
|00000bb0| 61 77 6e 27 73 20 63 75 | 72 72 65 6e 74 20 6c 6f |awn's cu|rrent lo|
|00000bc0| 63 61 74 69 6f 6e 20 61 | 6e 64 20 74 68 65 0d 0a |cation a|nd the..|
|00000bd0| 50 72 65 66 65 72 72 65 | 64 44 65 73 74 69 6e 61 |Preferre|dDestina|
|00000be0| 74 69 6f 6e 20 73 6f 20 | 74 68 61 74 20 69 74 20 |tion so |that it |
|00000bf0| 69 73 20 6e 6f 20 6c 65 | 73 73 20 74 68 61 6e 20 |is no le|ss than |
|00000c00| 44 69 73 74 61 6e 63 65 | 52 65 64 75 63 74 69 6f |Distance|Reductio|
|00000c10| 6e 0d 0a 0d 0a 69 66 20 | 74 68 65 20 64 69 73 74 |n....if |the dist|
|00000c20| 61 6e 63 65 20 62 65 74 | 77 65 65 6e 20 74 68 65 |ance bet|ween the|
|00000c30| 20 70 61 77 6e 27 73 20 | 63 75 72 72 65 6e 74 20 | pawn's |current |
|00000c40| 6c 6f 63 61 74 69 6f 6e | 20 61 6e 64 20 74 68 65 |location| and the|
|00000c50| 20 70 72 65 66 65 72 72 | 65 64 20 64 65 73 74 69 | preferr|ed desti|
|00000c60| 6e 61 74 69 6f 6e 20 69 | 73 0d 0a 67 72 65 61 74 |nation i|s..great|
|00000c70| 65 72 20 74 68 61 6e 20 | 74 68 65 20 70 72 6f 70 |er than |the prop|
|00000c80| 6f 73 65 64 20 64 69 73 | 74 61 6e 63 65 20 72 65 |osed dis|tance re|
|00000c90| 64 75 63 74 69 6f 6e 2c | 20 74 68 65 20 50 72 65 |duction,| the Pre|
|00000ca0| 66 65 72 72 65 64 44 65 | 73 74 69 6e 61 74 69 6f |ferredDe|stinatio|
|00000cb0| 6e 20 69 73 20 6d 6f 76 | 65 64 20 74 6f 77 61 72 |n is mov|ed towar|
|00000cc0| 64 0d 0a 74 68 65 20 70 | 61 77 6e 27 73 20 63 75 |d..the p|awn's cu|
|00000cd0| 72 72 65 6e 74 20 6c 6f | 63 61 74 69 6f 6e 20 74 |rrent lo|cation t|
|00000ce0| 6f 20 61 63 63 6f 6d 6f | 64 61 74 65 20 74 68 65 |o accomo|date the|
|00000cf0| 20 72 65 64 75 63 74 69 | 6f 6e 2e 0d 0a 0d 0a 69 | reducti|on.....i|
|00000d00| 66 20 74 68 65 20 64 69 | 73 74 61 6e 63 65 20 62 |f the di|stance b|
|00000d10| 65 74 77 65 65 6e 20 74 | 68 65 20 70 61 77 6e 27 |etween t|he pawn'|
|00000d20| 73 20 63 75 72 72 65 6e | 74 20 6c 6f 63 61 74 69 |s curren|t locati|
|00000d30| 6f 6e 20 61 6e 64 20 74 | 68 65 20 70 72 65 66 65 |on and t|he prefe|
|00000d40| 72 72 65 64 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |rred des|tination|
|00000d50| 20 69 73 0d 0a 6c 65 73 | 73 20 74 68 61 6e 20 74 | is..les|s than t|
|00000d60| 68 65 20 70 72 6f 70 6f | 73 65 64 20 64 69 73 74 |he propo|sed dist|
|00000d70| 61 6e 63 65 20 72 65 64 | 75 63 74 69 6f 6e 2c 20 |ance red|uction, |
|00000d80| 74 68 65 20 50 72 65 66 | 65 72 72 65 64 44 65 73 |the Pref|erredDes|
|00000d90| 74 69 6e 61 74 69 6f 6e | 20 69 73 20 6d 6f 76 65 |tination| is move|
|00000da0| 64 20 61 77 61 79 20 66 | 72 6f 6d 0d 0a 74 68 65 |d away f|rom..the|
|00000db0| 20 70 61 77 6e 27 73 20 | 63 75 72 72 65 6e 74 20 | pawn's |current |
|00000dc0| 6c 6f 63 61 74 69 6f 6e | 20 69 6e 20 74 68 65 20 |location| in the |
|00000dd0| 6f 70 70 6f 73 69 74 65 | 20 64 69 72 65 63 74 69 |opposite| directi|
|00000de0| 6f 6e 20 73 6f 20 74 68 | 61 74 20 74 68 65 20 64 |on so th|at the d|
|00000df0| 69 73 74 61 6e 63 65 20 | 69 73 20 6e 6f 20 6c 65 |istance |is no le|
|00000e00| 73 73 0d 0a 74 68 61 6e | 20 44 69 73 74 61 6e 63 |ss..than| Distanc|
|00000e10| 65 52 65 64 75 63 74 69 | 6f 6e 2e 0d 0a 2a 2f 0d |eReducti|on...*/.|
|00000e20| 0a 0d 0a 66 75 6e 63 74 | 69 6f 6e 20 41 64 6a 75 |...funct|ion Adju|
|00000e30| 73 74 32 64 44 69 73 74 | 61 6e 63 65 28 20 6f 75 |st2dDist|ance( ou|
|00000e40| 74 20 56 65 63 74 6f 72 | 20 50 72 65 66 65 72 72 |t Vector| Preferr|
|00000e50| 65 64 44 65 73 74 69 6e | 61 74 69 6f 6e 2c 20 41 |edDestin|ation, A|
|00000e60| 63 74 6f 72 20 43 6f 6e | 73 74 72 61 69 6e 65 64 |ctor Con|strained|
|00000e70| 41 63 74 6f 72 2c 20 6f | 70 74 69 6f 6e 61 6c 20 |Actor, o|ptional |
|00000e80| 66 6c 6f 61 74 20 44 69 | 73 74 61 6e 63 65 52 65 |float Di|stanceRe|
|00000e90| 64 75 63 74 69 6f 6e 20 | 29 0d 0a 7b 0d 0a 09 6c |duction |)..{...l|
|00000ea0| 6f 63 61 6c 20 56 65 63 | 74 6f 72 20 4f 66 66 73 |ocal Vec|tor Offs|
|00000eb0| 65 74 2c 20 44 69 66 66 | 65 72 65 6e 63 65 3b 0d |et, Diff|erence;.|
|00000ec0| 0a 09 6c 6f 63 61 6c 20 | 66 6c 6f 61 74 20 44 69 |..local |float Di|
|00000ed0| 73 74 61 6e 63 65 54 6f | 44 65 73 74 69 6e 61 74 |stanceTo|Destinat|
|00000ee0| 69 6f 6e 3b 0d 0a 09 6c | 6f 63 61 6c 20 66 6c 6f |ion;...l|ocal flo|
|00000ef0| 61 74 20 44 65 6c 74 61 | 4d 61 67 6e 69 74 75 64 |at Delta|Magnitud|
|00000f00| 65 3b 0d 0a 09 0d 0a 2f | 2a 0d 0a 09 2f 2f 67 65 |e;...../|*...//ge|
|00000f10| 74 20 74 68 65 20 74 77 | 6f 20 64 69 6d 65 6e 73 |t the tw|o dimens|
|00000f20| 69 6f 6e 61 6c 20 64 69 | 73 74 61 6e 63 65 20 62 |ional di|stance b|
|00000f30| 65 74 77 65 65 6e 20 74 | 68 65 20 70 61 77 6e 27 |etween t|he pawn'|
|00000f40| 73 20 63 75 72 72 65 6e | 74 20 6c 6f 61 74 69 6f |s curren|t loatio|
|00000f50| 6e 20 61 6e 64 20 74 68 | 65 20 50 72 65 66 65 72 |n and th|e Prefer|
|00000f60| 72 65 64 44 65 73 74 69 | 6e 61 74 69 6f 6e 0d 0a |redDesti|nation..|
|00000f70| 09 4f 66 66 73 65 74 20 | 3d 20 50 72 65 66 65 72 |.Offset |= Prefer|
|00000f80| 72 65 64 44 65 73 74 69 | 6e 61 74 69 6f 6e 20 2d |redDesti|nation -|
|00000f90| 20 4c 6f 63 61 74 69 6f | 6e 3b 20 2f 2f 67 65 74 | Locatio|n; //get|
|00000fa0| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00000fb0| 20 76 65 63 74 6f 72 20 | 77 69 74 68 6f 75 74 20 | vector |without |
|00000fc0| 63 6f 6e 63 65 72 6e 20 | 66 6f 72 20 74 68 65 20 |concern |for the |
|00000fd0| 5a 0d 0a 0d 0a 09 2f 2f | 4c 6f 67 28 20 43 6f 6e |Z.....//|Log( Con|
|00000fe0| 73 74 72 61 69 6e 65 64 | 41 63 74 6f 72 20 24 20 |strained|Actor $ |
|00000ff0| 22 3a 3a 41 64 6a 75 73 | 74 32 64 44 69 73 74 61 |"::Adjus|t2dDista|
|00001000| 6e 63 65 20 4f 66 66 73 | 65 74 20 22 20 24 20 4f |nce Offs|et " $ O|
|00001010| 66 66 73 65 74 20 29 3b | 0d 0a 0d 0a 09 4f 66 66 |ffset );|.....Off|
|00001020| 73 65 74 2e 5a 20 3d 20 | 30 3b 20 2f 2f 69 67 6e |set.Z = |0; //ign|
|00001030| 6f 72 65 20 74 68 65 20 | 63 68 61 6e 67 65 20 69 |ore the |change i|
|00001040| 6e 20 7a 0d 0a 09 0d 0a | 09 44 69 73 74 61 6e 63 |n z.....|.Distanc|
|00001050| 65 54 6f 44 65 73 74 69 | 6e 61 74 69 6f 6e 20 3d |eToDesti|nation =|
|00001060| 20 56 53 69 7a 65 28 20 | 4f 66 66 73 65 74 20 29 | VSize( |Offset )|
|00001070| 3b 0d 0a 09 0d 0a 09 69 | 66 28 20 44 69 73 74 61 |;......i|f( Dista|
|00001080| 6e 63 65 54 6f 44 65 73 | 74 69 6e 61 74 69 6f 6e |nceToDes|tination|
|00001090| 20 3e 20 44 69 73 74 61 | 6e 63 65 52 65 64 75 63 | > Dista|nceReduc|
|000010a0| 74 69 6f 6e 20 29 0d 0a | 09 7b 0d 0a 09 09 2f 2f |tion )..|.{....//|
|000010b0| 73 6c 69 64 65 20 74 68 | 65 20 64 65 73 74 69 6e |slide th|e destin|
|000010c0| 61 74 69 6f 6e 20 74 6f | 77 61 72 64 20 74 68 65 |ation to|ward the|
|000010d0| 20 63 75 72 72 65 6e 74 | 20 6c 6f 63 61 74 69 6f | current| locatio|
|000010e0| 6e 0d 0a 09 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |n....//L|og( Cons|
|000010f0| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|00001100| 3a 3a 41 64 6a 75 73 74 | 32 64 44 69 73 74 61 6e |::Adjust|2dDistan|
|00001110| 63 65 20 6a 75 73 74 20 | 6d 6f 76 65 20 6c 65 73 |ce just |move les|
|00001120| 73 22 20 29 3b 0d 0a 09 | 09 44 65 6c 74 61 4d 61 |s" );...|.DeltaMa|
|00001130| 67 6e 69 74 75 64 65 20 | 3d 20 44 69 73 74 61 6e |gnitude |= Distan|
|00001140| 63 65 52 65 64 75 63 74 | 69 6f 6e 3b 0d 0a 09 7d |ceReduct|ion;...}|
|00001150| 0d 0a 09 65 6c 73 65 20 | 69 66 28 20 44 69 73 74 |...else |if( Dist|
|00001160| 61 6e 63 65 54 6f 44 65 | 73 74 69 6e 61 74 69 6f |anceToDe|stinatio|
|00001170| 6e 20 3c 20 44 69 73 74 | 61 6e 63 65 52 65 64 75 |n < Dist|anceRedu|
|00001180| 63 74 69 6f 6e 20 29 0d | 0a 09 7b 0d 0a 09 09 2f |ction ).|..{..../|
|00001190| 2f 73 6c 69 64 65 20 74 | 68 65 20 64 65 73 74 69 |/slide t|he desti|
|000011a0| 6e 61 74 69 6f 6e 20 66 | 75 72 74 68 65 72 20 61 |nation f|urther a|
|000011b0| 77 61 79 20 66 72 6f 6d | 20 74 68 65 20 63 75 72 |way from| the cur|
|000011c0| 72 65 6e 74 20 6c 6f 63 | 61 74 69 6f 6e 0d 0a 09 |rent loc|ation...|
|000011d0| 09 2f 2f 4c 6f 67 28 20 | 43 6f 6e 73 74 72 61 69 |.//Log( |Constrai|
|000011e0| 6e 65 64 41 63 74 6f 72 | 20 24 20 22 3a 3a 41 64 |nedActor| $ "::Ad|
|000011f0| 6a 75 73 74 32 64 44 69 | 73 74 61 6e 63 65 20 73 |just2dDi|stance s|
|00001200| 6c 69 64 65 20 61 77 61 | 79 22 20 29 3b 0d 0a 09 |lide awa|y" );...|
|00001210| 09 44 65 6c 74 61 4d 61 | 67 6e 69 74 75 64 65 20 |.DeltaMa|gnitude |
|00001220| 3d 20 2d 28 20 44 69 73 | 74 61 6e 63 65 52 65 64 |= -( Dis|tanceRed|
|00001230| 75 63 74 69 6f 6e 20 2d | 20 44 69 73 74 61 6e 63 |uction -| Distanc|
|00001240| 65 54 6f 44 65 73 74 69 | 6e 61 74 69 6f 6e 20 29 |eToDesti|nation )|
|00001250| 3b 0d 0a 09 7d 0d 0a 09 | 65 6c 73 65 0d 0a 09 7b |;...}...|else...{|
|00001260| 0d 0a 09 09 2f 2f 4c 6f | 67 28 20 43 6f 6e 73 74 |....//Lo|g( Const|
|00001270| 72 61 69 6e 65 64 41 63 | 74 6f 72 20 24 20 22 3a |rainedAc|tor $ ":|
|00001280| 3a 41 64 6a 75 73 74 32 | 64 44 69 73 74 61 6e 63 |:Adjust2|dDistanc|
|00001290| 65 20 6a 75 73 74 20 72 | 69 67 68 74 22 20 29 3b |e just r|ight" );|
|000012a0| 0d 0a 09 09 44 65 6c 74 | 61 4d 61 67 6e 69 74 75 |....Delt|aMagnitu|
|000012b0| 64 65 20 3d 20 30 3b 0d | 0a 09 7d 0d 0a 09 0d 0a |de = 0;.|..}.....|
|000012c0| 09 2f 2f 78 78 78 20 54 | 48 49 53 20 49 53 20 57 |.//xxx T|HIS IS W|
|000012d0| 52 4f 4e 47 21 21 21 20 | 74 68 65 20 74 68 65 20 |RONG!!! |the the |
|000012e0| 64 69 73 74 61 6e 63 65 | 20 6f 6e 20 74 68 65 20 |distance| on the |
|000012f0| 78 79 20 70 6c 61 6e 65 | 20 69 73 20 6e 6f 74 20 |xy plane| is not |
|00001300| 73 75 66 66 69 63 69 65 | 6e 74 20 74 6f 20 75 73 |sufficie|nt to us|
|00001310| 65 20 61 73 20 74 68 65 | 20 72 65 64 75 63 74 69 |e as the| reducti|
|00001320| 6f 6e 0d 0a 09 4f 66 66 | 73 65 74 20 3d 20 4e 6f |on...Off|set = No|
|00001330| 72 6d 61 6c 28 20 50 72 | 65 66 65 72 72 65 64 44 |rmal( Pr|eferredD|
|00001340| 65 73 74 69 6e 61 74 69 | 6f 6e 20 2d 20 4c 6f 63 |estinati|on - Loc|
|00001350| 61 74 69 6f 6e 20 29 20 | 2a 20 44 65 6c 74 61 4d |ation ) |* DeltaM|
|00001360| 61 67 6e 69 74 75 64 65 | 3b 0d 0a 0d 0a 09 2f 2f |agnitude|;.....//|
|00001370| 61 6a 75 73 74 20 74 68 | 65 20 64 65 73 74 69 6e |ajust th|e destin|
|00001380| 61 74 69 6f 6e 20 62 79 | 20 74 68 65 20 6f 66 66 |ation by| the off|
|00001390| 73 65 74 0d 0a 09 50 72 | 65 66 65 72 72 65 64 44 |set...Pr|eferredD|
|000013a0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 3d 20 50 72 65 |estinati|on = Pre|
|000013b0| 66 65 72 72 65 64 44 65 | 73 74 69 6e 61 74 69 6f |ferredDe|stinatio|
|000013c0| 6e 20 2d 20 4f 66 66 73 | 65 74 3b 0d 0a 2a 2f 0d |n - Offs|et;..*/.|
|000013d0| 0a 7d 0d 0a 0d 0a 0d 0a | 0d 0a 66 75 6e 63 74 69 |.}......|..functi|
|000013e0| 6f 6e 20 66 6c 6f 61 74 | 20 42 6f 75 6e 64 4d 61 |on float| BoundMa|
|000013f0| 67 6e 69 74 75 64 65 28 | 20 41 63 74 6f 72 20 43 |gnitude(| Actor C|
|00001400| 6f 6e 73 74 72 61 69 6e | 65 64 41 63 74 6f 72 2c |onstrain|edActor,|
|00001410| 20 66 6c 6f 61 74 20 50 | 72 65 66 65 72 72 65 64 | float P|referred|
|00001420| 4d 61 67 6e 69 74 75 64 | 65 20 29 0d 0a 7b 0d 0a |Magnitud|e )..{..|
|00001430| 09 6c 6f 63 61 6c 20 66 | 6c 6f 61 74 20 4d 69 6e |.local f|loat Min|
|00001440| 44 69 73 74 61 6e 63 65 | 55 73 65 64 2c 20 44 65 |Distance|Used, De|
|00001450| 74 65 72 6d 69 6e 65 64 | 4d 61 67 6e 69 74 75 64 |termined|Magnitud|
|00001460| 65 2c 20 41 62 73 50 72 | 65 66 65 72 72 65 64 4d |e, AbsPr|eferredM|
|00001470| 61 67 6e 69 74 75 64 65 | 3b 0d 0a 09 0d 0a 09 41 |agnitude|;......A|
|00001480| 62 73 50 72 65 66 65 72 | 72 65 64 4d 61 67 6e 69 |bsPrefer|redMagni|
|00001490| 74 75 64 65 20 3d 20 41 | 62 73 28 20 50 72 65 66 |tude = A|bs( Pref|
|000014a0| 65 72 72 65 64 4d 61 67 | 6e 69 74 75 64 65 20 29 |erredMag|nitude )|
|000014b0| 3b 0d 0a 09 0d 0a 09 69 | 66 28 20 41 62 73 50 72 |;......i|f( AbsPr|
|000014c0| 65 66 65 72 72 65 64 4d | 61 67 6e 69 74 75 64 65 |eferredM|agnitude|
|000014d0| 20 3e 20 47 65 74 43 75 | 72 72 65 6e 74 4d 61 78 | > GetCu|rrentMax|
|000014e0| 54 72 61 76 65 6c 44 69 | 73 74 61 6e 63 65 28 20 |TravelDi|stance( |
|000014f0| 43 6f 6e 73 74 72 61 69 | 6e 65 64 41 63 74 6f 72 |Constrai|nedActor|
|00001500| 20 29 20 29 0d 0a 09 7b | 0d 0a 09 09 2f 2f 63 6c | ) )...{|....//cl|
|00001510| 69 70 20 74 68 65 20 6d | 61 67 6e 69 74 75 64 65 |ip the m|agnitude|
|00001520| 20 74 6f 20 74 68 65 20 | 6d 61 78 20 64 69 73 74 | to the |max dist|
|00001530| 61 6e 63 65 0d 0a 09 09 | 44 65 74 65 72 6d 69 6e |ance....|Determin|
|00001540| 65 64 4d 61 67 6e 69 74 | 75 64 65 20 3d 20 47 65 |edMagnit|ude = Ge|
|00001550| 74 43 75 72 72 65 6e 74 | 4d 61 78 54 72 61 76 65 |tCurrent|MaxTrave|
|00001560| 6c 44 69 73 74 61 6e 63 | 65 28 20 43 6f 6e 73 74 |lDistanc|e( Const|
|00001570| 72 61 69 6e 65 64 41 63 | 74 6f 72 20 29 3b 0d 0a |rainedAc|tor );..|
|00001580| 09 7d 0d 0a 09 65 6c 73 | 65 0d 0a 09 7b 0d 0a 09 |.}...els|e...{...|
|00001590| 09 4d 69 6e 44 69 73 74 | 61 6e 63 65 55 73 65 64 |.MinDist|anceUsed|
|000015a0| 20 3d 20 47 65 74 43 75 | 72 72 65 6e 74 4d 69 6e | = GetCu|rrentMin|
|000015b0| 54 72 61 76 65 6c 44 69 | 73 74 61 6e 63 65 28 20 |TravelDi|stance( |
|000015c0| 43 6f 6e 73 74 72 61 69 | 6e 65 64 41 63 74 6f 72 |Constrai|nedActor|
|000015d0| 20 29 3b 0d 0a 09 09 69 | 66 28 20 41 62 73 50 72 | );....i|f( AbsPr|
|000015e0| 65 66 65 72 72 65 64 4d | 61 67 6e 69 74 75 64 65 |eferredM|agnitude|
|000015f0| 20 3c 20 4d 69 6e 44 69 | 73 74 61 6e 63 65 55 73 | < MinDi|stanceUs|
|00001600| 65 64 20 29 0d 0a 09 09 | 7b 0d 0a 09 09 09 44 65 |ed )....|{.....De|
|00001610| 74 65 72 6d 69 6e 65 64 | 4d 61 67 6e 69 74 75 64 |termined|Magnitud|
|00001620| 65 20 3d 20 2d 28 20 4d | 69 6e 44 69 73 74 61 6e |e = -( M|inDistan|
|00001630| 63 65 55 73 65 64 20 2d | 20 44 65 74 65 72 6d 69 |ceUsed -| Determi|
|00001640| 6e 65 64 4d 61 67 6e 69 | 74 75 64 65 20 29 3b 0d |nedMagni|tude );.|
|00001650| 0a 09 09 7d 0d 0a 09 09 | 65 6c 73 65 0d 0a 09 09 |...}....|else....|
|00001660| 7b 0d 0a 09 09 09 44 65 | 74 65 72 6d 69 6e 65 64 |{.....De|termined|
|00001670| 4d 61 67 6e 69 74 75 64 | 65 20 3d 20 41 62 73 50 |Magnitud|e = AbsP|
|00001680| 72 65 66 65 72 72 65 64 | 4d 61 67 6e 69 74 75 64 |referred|Magnitud|
|00001690| 65 3b 0d 0a 09 09 7d 0d | 0a 09 7d 0d 0a 09 0d 0a |e;....}.|..}.....|
|000016a0| 09 69 66 28 20 50 72 65 | 66 65 72 72 65 64 4d 61 |.if( Pre|ferredMa|
|000016b0| 67 6e 69 74 75 64 65 20 | 3c 20 30 20 29 0d 0a 09 |gnitude |< 0 )...|
|000016c0| 7b 0d 0a 09 09 44 65 74 | 65 72 6d 69 6e 65 64 4d |{....Det|erminedM|
|000016d0| 61 67 6e 69 74 75 64 65 | 20 3d 20 2d 44 65 74 65 |agnitude| = -Dete|
|000016e0| 72 6d 69 6e 65 64 4d 61 | 67 6e 69 74 75 64 65 3b |rminedMa|gnitude;|
|000016f0| 0d 0a 09 7d 0d 0a 09 0d | 0a 09 72 65 74 75 72 6e |...}....|..return|
|00001700| 20 44 65 74 65 72 6d 69 | 6e 65 64 4d 61 67 6e 69 | Determi|nedMagni|
|00001710| 74 75 64 65 3b 0d 0a 7d | 0d 0a 0d 0a 0d 0a 0d 0a |tude;..}|........|
|00001720| 2f 2a 0d 0a 42 6f 75 6e | 64 44 65 73 74 69 6e 61 |/*..Boun|dDestina|
|00001730| 74 69 6f 6e 44 69 73 74 | 61 6e 63 65 0d 0a 0d 0a |tionDist|ance....|
|00001740| 41 64 6a 75 73 74 73 20 | 74 68 65 20 70 72 65 66 |Adjusts |the pref|
|00001750| 65 72 72 65 64 20 64 65 | 73 74 69 6e 61 74 69 6f |erred de|stinatio|
|00001760| 6e 20 62 79 20 62 6f 75 | 6e 64 69 6e 67 20 74 68 |n by bou|nding th|
|00001770| 65 20 6d 61 67 6e 69 74 | 75 64 65 20 6f 66 20 74 |e magnit|ude of t|
|00001780| 68 65 20 76 65 63 74 6f | 72 20 62 65 74 77 65 65 |he vecto|r betwee|
|00001790| 6e 20 74 68 65 0d 0a 70 | 61 77 6e 27 73 20 63 75 |n the..p|awn's cu|
|000017a0| 72 72 65 6e 74 20 6c 6f | 63 61 74 69 6f 6e 20 61 |rrent lo|cation a|
|000017b0| 6e 64 20 74 68 65 20 70 | 72 65 66 65 72 72 65 64 |nd the p|referred|
|000017c0| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 2e 0d 0a 2a | destina|tion...*|
|000017d0| 2f 0d 0a 66 75 6e 63 74 | 69 6f 6e 20 42 6f 75 6e |/..funct|ion Boun|
|000017e0| 64 44 65 73 74 69 6e 61 | 74 69 6f 6e 44 69 73 74 |dDestina|tionDist|
|000017f0| 61 6e 63 65 28 20 6f 75 | 74 20 56 65 63 74 6f 72 |ance( ou|t Vector|
|00001800| 20 50 72 65 66 65 72 72 | 65 64 44 65 73 74 69 6e | Preferr|edDestin|
|00001810| 61 74 69 6f 6e 2c 20 41 | 63 74 6f 72 20 43 6f 6e |ation, A|ctor Con|
|00001820| 73 74 72 61 69 6e 65 64 | 41 63 74 6f 72 20 29 0d |strained|Actor ).|
|00001830| 0a 7b 0d 0a 09 6c 6f 63 | 61 6c 20 66 6c 6f 61 74 |.{...loc|al float|
|00001840| 20 52 61 77 44 69 73 74 | 61 6e 63 65 2c 20 4e 65 | RawDist|ance, Ne|
|00001850| 77 4d 61 67 6e 69 74 75 | 64 65 3b 0d 0a 09 6c 6f |wMagnitu|de;...lo|
|00001860| 63 61 6c 20 56 65 63 74 | 6f 72 20 44 69 66 66 65 |cal Vect|or Diffe|
|00001870| 72 65 6e 63 65 3b 0d 0a | 09 0d 0a 09 44 69 66 66 |rence;..|....Diff|
|00001880| 65 72 65 6e 63 65 20 3d | 20 50 72 65 66 65 72 72 |erence =| Preferr|
|00001890| 65 64 44 65 73 74 69 6e | 61 74 69 6f 6e 20 2d 20 |edDestin|ation - |
|000018a0| 43 6f 6e 73 74 72 61 69 | 6e 65 64 41 63 74 6f 72 |Constrai|nedActor|
|000018b0| 2e 4c 6f 63 61 74 69 6f | 6e 3b 0d 0a 09 52 61 77 |.Locatio|n;...Raw|
|000018c0| 44 69 73 74 61 6e 63 65 | 20 3d 20 56 53 69 7a 65 |Distance| = VSize|
|000018d0| 28 20 44 69 66 66 65 72 | 65 6e 63 65 20 29 3b 0d |( Differ|ence );.|
|000018e0| 0a 09 4e 65 77 4d 61 67 | 6e 69 74 75 64 65 20 3d |..NewMag|nitude =|
|000018f0| 20 42 6f 75 6e 64 4d 61 | 67 6e 69 74 75 64 65 28 | BoundMa|gnitude(|
|00001900| 20 43 6f 6e 73 74 72 61 | 69 6e 65 64 41 63 74 6f | Constra|inedActo|
|00001910| 72 2c 20 52 61 77 44 69 | 73 74 61 6e 63 65 20 29 |r, RawDi|stance )|
|00001920| 3b 0d 0a 0d 0a 09 69 66 | 28 20 4e 65 77 4d 61 67 |;.....if|( NewMag|
|00001930| 6e 69 74 75 64 65 20 21 | 3d 20 52 61 77 44 69 73 |nitude !|= RawDis|
|00001940| 74 61 6e 63 65 20 29 0d | 0a 09 7b 0d 0a 09 09 2f |tance ).|..{..../|
|00001950| 2f 74 68 65 20 6d 61 67 | 6e 69 74 75 64 65 20 6e |/the mag|nitude n|
|00001960| 65 65 64 73 20 74 6f 20 | 62 65 20 72 65 64 75 63 |eeds to |be reduc|
|00001970| 65 64 20 62 75 74 20 74 | 68 65 20 61 63 74 6f 72 |ed but t|he actor|
|00001980| 20 69 73 20 73 74 69 6c | 6c 20 67 6f 69 6e 67 20 | is stil|l going |
|00001990| 74 6f 20 6d 6f 76 65 0d | 0a 09 09 50 72 65 66 65 |to move.|...Prefe|
|000019a0| 72 72 65 64 44 65 73 74 | 69 6e 61 74 69 6f 6e 20 |rredDest|ination |
|000019b0| 3d 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |= Constr|ainedAct|
|000019c0| 6f 72 2e 4c 6f 63 61 74 | 69 6f 6e 20 2b 20 4e 6f |or.Locat|ion + No|
|000019d0| 72 6d 61 6c 28 20 44 69 | 66 66 65 72 65 6e 63 65 |rmal( Di|fference|
|000019e0| 20 29 20 2a 20 4e 65 77 | 4d 61 67 6e 69 74 75 64 | ) * New|Magnitud|
|000019f0| 65 3b 0d 0a 09 7d 0d 0a | 7d 0d 0a 0d 0a 0d 0a 66 |e;...}..|}......f|
|00001a00| 75 6e 63 74 69 6f 6e 20 | 62 6f 6f 6c 20 49 73 54 |unction |bool IsT|
|00001a10| 72 61 76 65 6c 44 69 73 | 74 61 6e 63 65 54 6f 53 |ravelDis|tanceToS|
|00001a20| 6d 61 6c 6c 28 20 41 63 | 74 6f 72 20 43 6f 6e 73 |mall( Ac|tor Cons|
|00001a30| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 2c 20 66 6c |trainedA|ctor, fl|
|00001a40| 6f 61 74 20 50 72 65 66 | 65 72 72 65 64 44 69 73 |oat Pref|erredDis|
|00001a50| 74 61 6e 63 65 20 29 0d | 0a 7b 0d 0a 09 72 65 74 |tance ).|.{...ret|
|00001a60| 75 72 6e 20 69 6e 74 28 | 20 50 72 65 66 65 72 72 |urn int(| Preferr|
|00001a70| 65 64 44 69 73 74 61 6e | 63 65 20 29 20 3c 20 47 |edDistan|ce ) < G|
|00001a80| 65 74 43 75 72 72 65 6e | 74 4d 69 6e 54 72 61 76 |etCurren|tMinTrav|
|00001a90| 65 6c 44 69 73 74 61 6e | 63 65 28 20 43 6f 6e 73 |elDistan|ce( Cons|
|00001aa0| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 29 3b 0d |trainedA|ctor );.|
|00001ab0| 0a 7d 0d 0a 0d 0a 0d 0a | 66 75 6e 63 74 69 6f 6e |.}......|function|
|00001ac0| 20 62 6f 6f 6c 20 46 69 | 6e 64 55 6e 6f 62 73 74 | bool Fi|ndUnobst|
|00001ad0| 72 75 63 74 65 64 41 63 | 74 6f 72 44 65 73 74 69 |ructedAc|torDesti|
|00001ae0| 6e 61 74 69 6f 6e 28 20 | 6f 75 74 20 56 65 63 74 |nation( |out Vect|
|00001af0| 6f 72 20 55 6e 6f 62 73 | 74 72 75 63 74 65 64 44 |or Unobs|tructedD|
|00001b00| 65 73 74 69 6e 61 74 69 | 6f 6e 2c 0d 0a 09 09 56 |estinati|on,....V|
|00001b10| 65 63 74 6f 72 20 50 72 | 65 66 65 72 72 65 64 44 |ector Pr|eferredD|
|00001b20| 65 73 74 69 6e 61 74 69 | 6f 6e 2c 0d 0a 09 09 41 |estinati|on,....A|
|00001b30| 63 74 6f 72 20 4d 6f 76 | 69 6e 67 41 63 74 6f 72 |ctor Mov|ingActor|
|00001b40| 20 29 0d 0a 7b 0d 0a 09 | 72 65 74 75 72 6e 20 46 | )..{...|return F|
|00001b50| 69 6e 64 55 6e 6f 62 73 | 74 72 75 63 74 65 64 44 |indUnobs|tructedD|
|00001b60| 65 73 74 69 6e 61 74 69 | 6f 6e 28 20 55 6e 6f 62 |estinati|on( Unob|
|00001b70| 73 74 72 75 63 74 65 64 | 44 65 73 74 69 6e 61 74 |structed|Destinat|
|00001b80| 69 6f 6e 2c 0d 0a 09 09 | 09 50 72 65 66 65 72 72 |ion,....|.Preferr|
|00001b90| 65 64 44 65 73 74 69 6e | 61 74 69 6f 6e 2c 0d 0a |edDestin|ation,..|
|00001ba0| 09 09 09 4d 6f 76 69 6e | 67 41 63 74 6f 72 2c 0d |...Movin|gActor,.|
|00001bb0| 0a 09 09 09 47 65 74 43 | 75 72 72 65 6e 74 4d 69 |....GetC|urrentMi|
|00001bc0| 6e 54 72 61 76 65 6c 44 | 69 73 74 61 6e 63 65 28 |nTravelD|istance(|
|00001bd0| 20 4d 6f 76 69 6e 67 41 | 63 74 6f 72 20 29 2c 0d | MovingA|ctor ),.|
|00001be0| 0a 09 09 09 4d 69 6e 44 | 65 6c 74 61 52 6f 74 61 |....MinD|eltaRota|
|00001bf0| 74 69 6f 6e 2e 59 61 77 | 2c 0d 0a 09 09 09 46 69 |tion.Yaw|,.....Fi|
|00001c00| 6e 64 55 6e 6f 62 73 74 | 72 75 63 74 65 64 44 65 |ndUnobst|ructedDe|
|00001c10| 73 74 69 6e 61 74 69 6f | 6e 4d 61 78 44 65 6c 74 |stinatio|nMaxDelt|
|00001c20| 61 59 61 77 2c 0d 0a 09 | 09 09 46 69 6e 64 55 6e |aYaw,...|..FindUn|
|00001c30| 6f 62 73 74 72 75 63 74 | 65 64 44 65 73 74 69 6e |obstruct|edDestin|
|00001c40| 61 74 69 6f 6e 44 65 6c | 74 61 59 61 77 20 29 3b |ationDel|taYaw );|
|00001c50| 0d 0a 7d 0d 0a 0d 0a 0d | 0a 0d 0a 2f 2a 0d 0a 46 |..}.....|.../*..F|
|00001c60| 69 6e 64 55 6e 6f 62 73 | 74 72 75 63 74 65 64 44 |indUnobs|tructedD|
|00001c70| 65 73 74 69 6e 61 74 69 | 6f 6e 3a 0d 0a 0d 0a 41 |estinati|on:....A|
|00001c80| 74 74 65 6d 70 74 73 20 | 74 6f 20 66 69 6e 64 20 |ttempts |to find |
|00001c90| 61 6e 20 75 6e 6f 62 73 | 74 72 75 63 74 65 64 20 |an unobs|tructed |
|00001ca0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 62 61 73 65 |destinat|ion base|
|00001cb0| 64 20 6f 6e 20 74 68 65 | 20 70 72 65 66 65 72 72 |d on the| preferr|
|00001cc0| 65 64 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 2e 0d |ed desti|nation..|
|00001cd0| 0a 49 66 20 74 68 65 20 | 70 61 74 68 20 62 65 74 |.If the |path bet|
|00001ce0| 77 65 65 6e 20 74 68 65 | 20 70 61 77 6e 27 73 20 |ween the| pawn's |
|00001cf0| 63 75 72 72 65 6e 74 20 | 6c 6f 63 61 74 69 6f 6e |current |location|
|00001d00| 20 61 6e 64 20 74 68 65 | 20 70 72 65 66 65 72 72 | and the| preferr|
|00001d10| 65 64 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 69 |ed desti|nation i|
|00001d20| 73 0d 0a 75 6e 6f 62 73 | 74 72 75 63 74 65 64 20 |s..unobs|tructed |
|00001d30| 74 68 65 6e 20 74 68 65 | 20 70 72 65 66 65 72 72 |then the| preferr|
|00001d40| 65 64 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 69 |ed desti|nation i|
|00001d50| 73 20 72 65 74 75 72 6e | 65 64 20 75 6e 63 68 61 |s return|ed uncha|
|00001d60| 6e 67 65 64 2e 20 4f 74 | 68 65 72 77 69 73 65 2c |nged. Ot|herwise,|
|00001d70| 20 61 6e 0d 0a 61 6c 74 | 65 72 6e 61 74 65 20 64 | an..alt|ernate d|
|00001d80| 65 73 74 69 6e 61 74 69 | 6f 6e 20 69 73 20 73 65 |estinati|on is se|
|00001d90| 61 72 63 68 65 64 20 66 | 6f 72 20 62 61 73 65 64 |arched f|or based|
|00001da0| 20 75 70 6f 6e 20 74 68 | 65 20 64 69 73 74 61 6e | upon th|e distan|
|00001db0| 63 65 20 62 65 74 77 65 | 65 6e 20 74 68 65 20 70 |ce betwe|en the p|
|00001dc0| 61 77 6e 27 73 0d 0a 63 | 75 72 72 65 6e 74 20 6c |awn's..c|urrent l|
|00001dd0| 6f 63 61 74 69 6f 6e 20 | 61 6e 64 20 74 68 65 20 |ocation |and the |
|00001de0| 70 72 65 66 65 72 72 65 | 64 20 64 65 73 74 69 6e |preferre|d destin|
|00001df0| 61 74 69 6f 6e 2e 20 41 | 6e 20 61 63 63 65 70 74 |ation. A|n accept|
|00001e00| 61 62 6c 65 20 61 6c 74 | 65 72 6e 61 74 65 20 64 |able alt|ernate d|
|00001e10| 65 73 74 69 6e 61 74 69 | 6f 6e 0d 0a 69 73 20 73 |estinati|on..is s|
|00001e20| 65 61 72 63 68 65 64 20 | 66 6f 72 20 62 79 20 66 |earched |for by f|
|00001e30| 69 72 73 74 20 72 65 64 | 75 63 69 6e 67 20 74 68 |irst red|ucing th|
|00001e40| 65 20 64 69 73 74 61 6e | 63 65 20 74 72 61 76 65 |e distan|ce trave|
|00001e50| 6c 65 64 20 66 6f 72 20 | 74 68 65 20 72 6f 74 61 |led for |the rota|
|00001e60| 74 69 6f 6e 20 61 74 74 | 65 6d 70 74 65 64 0d 0a |tion att|empted..|
|00001e70| 61 6e 64 20 74 68 65 6e | 20 76 61 72 79 69 6e 67 |and then| varying|
|00001e80| 20 74 68 65 20 72 6f 74 | 61 74 69 6f 6e 2e 0d 0a | the rot|ation...|
|00001e90| 2a 2f 0d 0a 66 75 6e 63 | 74 69 6f 6e 20 62 6f 6f |*/..func|tion boo|
|00001ea0| 6c 20 46 69 6e 64 55 6e | 6f 62 73 74 72 75 63 74 |l FindUn|obstruct|
|00001eb0| 65 64 44 65 73 74 69 6e | 61 74 69 6f 6e 28 20 6f |edDestin|ation( o|
|00001ec0| 75 74 20 56 65 63 74 6f | 72 20 55 6e 6f 62 73 74 |ut Vecto|r Unobst|
|00001ed0| 72 75 63 74 65 64 44 65 | 73 74 69 6e 61 74 69 6f |ructedDe|stinatio|
|00001ee0| 6e 2c 0d 0a 09 09 56 65 | 63 74 6f 72 20 50 72 65 |n,....Ve|ctor Pre|
|00001ef0| 66 65 72 72 65 64 44 65 | 73 74 69 6e 61 74 69 6f |ferredDe|stinatio|
|00001f00| 6e 2c 0d 0a 09 09 41 63 | 74 6f 72 20 4d 6f 76 69 |n,....Ac|tor Movi|
|00001f10| 6e 67 41 63 74 6f 72 2c | 0d 0a 09 09 6f 70 74 69 |ngActor,|....opti|
|00001f20| 6f 6e 61 6c 20 66 6c 6f | 61 74 20 4d 69 6e 52 65 |onal flo|at MinRe|
|00001f30| 64 75 63 65 64 44 69 73 | 74 61 6e 63 65 2c 0d 0a |ducedDis|tance,..|
|00001f40| 09 09 6f 70 74 69 6f 6e | 61 6c 20 66 6c 6f 61 74 |..option|al float|
|00001f50| 20 4d 69 6e 44 65 6c 74 | 61 59 61 77 2c 0d 0a 09 | MinDelt|aYaw,...|
|00001f60| 09 6f 70 74 69 6f 6e 61 | 6c 20 66 6c 6f 61 74 20 |.optiona|l float |
|00001f70| 4d 61 78 44 65 6c 74 61 | 59 61 77 2c 0d 0a 09 09 |MaxDelta|Yaw,....|
|00001f80| 6f 70 74 69 6f 6e 61 6c | 20 66 6c 6f 61 74 20 44 |optional| float D|
|00001f90| 65 6c 74 61 59 61 77 20 | 29 0d 0a 7b 0d 0a 09 6c |eltaYaw |)..{...l|
|00001fa0| 6f 63 61 6c 20 69 6e 74 | 20 50 72 65 66 65 72 72 |ocal int| Preferr|
|00001fb0| 65 64 59 61 77 2c 20 43 | 75 72 72 65 6e 74 44 65 |edYaw, C|urrentDe|
|00001fc0| 6c 74 61 59 61 77 2c 20 | 43 75 72 72 65 6e 74 50 |ltaYaw, |CurrentP|
|00001fd0| 61 77 6e 59 61 77 3b 0d | 0a 09 6c 6f 63 61 6c 20 |awnYaw;.|..local |
|00001fe0| 66 6c 6f 61 74 20 50 72 | 65 66 65 72 72 65 64 44 |float Pr|eferredD|
|00001ff0| 69 73 74 61 6e 63 65 2c | 20 52 65 64 75 63 65 64 |istance,| Reduced|
|00002000| 44 69 73 74 61 6e 63 65 | 2c 20 50 61 77 6e 53 74 |Distance|, PawnSt|
|00002010| 65 70 48 65 69 67 68 74 | 3b 0d 0a 09 6c 6f 63 61 |epHeight|;...loca|
|00002020| 6c 20 62 6f 6f 6c 20 62 | 50 61 74 68 46 6f 75 6e |l bool b|PathFoun|
|00002030| 64 3b 0d 0a 0d 0a 09 6c | 6f 63 61 6c 20 56 65 63 |d;.....l|ocal Vec|
|00002040| 74 6f 72 20 54 72 61 63 | 65 48 69 74 4c 6f 63 61 |tor Trac|eHitLoca|
|00002050| 74 69 6f 6e 2c 20 54 72 | 61 63 65 48 69 74 4e 6f |tion, Tr|aceHitNo|
|00002060| 72 6d 61 6c 2c 20 54 72 | 61 63 65 45 78 74 65 6e |rmal, Tr|aceExten|
|00002070| 74 3b 0d 0a 09 6c 6f 63 | 61 6c 20 41 63 74 6f 72 |t;...loc|al Actor|
|00002080| 20 54 72 61 63 65 48 69 | 74 41 63 74 6f 72 3b 0d | TraceHi|tActor;.|
|00002090| 0a 09 6c 6f 63 61 6c 20 | 69 6e 74 20 44 65 6c 74 |..local |int Delt|
|000020a0| 61 59 61 77 46 72 6f 6d | 43 75 72 72 65 6e 74 3b |aYawFrom|Current;|
|000020b0| 0d 0a 09 0d 0a 09 6c 6f | 63 61 6c 20 52 6f 74 61 |......lo|cal Rota|
|000020c0| 74 6f 72 20 43 75 72 72 | 65 6e 74 52 6f 74 61 74 |tor Curr|entRotat|
|000020d0| 69 6f 6e 55 73 65 64 3b | 0d 0a 09 6c 6f 63 61 6c |ionUsed;|...local|
|000020e0| 20 56 65 63 74 6f 72 20 | 43 75 72 72 65 6e 74 44 | Vector |CurrentD|
|000020f0| 65 73 74 69 6e 61 74 69 | 6f 6e 55 73 65 64 3b 0d |estinati|onUsed;.|
|00002100| 0a 0d 0a 09 2f 2f 4c 6f | 67 28 20 43 6f 6e 73 74 |....//Lo|g( Const|
|00002110| 72 61 69 6e 65 64 41 63 | 74 6f 72 20 24 20 22 3a |rainedAc|tor $ ":|
|00002120| 3a 46 69 6e 64 55 6e 6f | 62 73 74 72 75 63 74 65 |:FindUno|bstructe|
|00002130| 64 44 65 73 74 69 6e 61 | 74 69 6f 6e 22 20 29 3b |dDestina|tion" );|
|00002140| 0d 0a 09 2f 2f 4c 6f 67 | 28 20 43 6f 6e 73 74 72 |...//Log|( Constr|
|00002150| 61 69 6e 65 64 41 63 74 | 6f 72 20 24 20 22 09 09 |ainedAct|or $ "..|
|00002160| 50 72 65 66 65 72 72 65 | 64 44 65 73 74 69 6e 61 |Preferre|dDestina|
|00002170| 74 69 6f 6e 3a 20 22 20 | 24 20 50 72 65 66 65 72 |tion: " |$ Prefer|
|00002180| 72 65 64 44 65 73 74 69 | 6e 61 74 69 6f 6e 20 29 |redDesti|nation )|
|00002190| 3b 0d 0a 09 2f 2f 4c 6f | 67 28 20 43 6f 6e 73 74 |;...//Lo|g( Const|
|000021a0| 72 61 69 6e 65 64 41 63 | 74 6f 72 20 24 20 22 09 |rainedAc|tor $ ".|
|000021b0| 09 4d 69 6e 52 65 64 75 | 63 65 64 44 69 73 74 61 |.MinRedu|cedDista|
|000021c0| 6e 63 65 3a 20 22 20 24 | 20 4d 69 6e 52 65 64 75 |nce: " $| MinRedu|
|000021d0| 63 65 64 44 69 73 74 61 | 6e 63 65 20 29 3b 0d 0a |cedDista|nce );..|
|000021e0| 09 2f 2f 4c 6f 67 28 20 | 43 6f 6e 73 74 72 61 69 |.//Log( |Constrai|
|000021f0| 6e 65 64 41 63 74 6f 72 | 20 24 20 22 09 09 4d 69 |nedActor| $ "..Mi|
|00002200| 6e 44 65 6c 74 61 59 61 | 77 3a 20 22 20 24 20 4d |nDeltaYa|w: " $ M|
|00002210| 69 6e 44 65 6c 74 61 59 | 61 77 20 29 3b 0d 0a 09 |inDeltaY|aw );...|
|00002220| 2f 2f 4c 6f 67 28 20 43 | 6f 6e 73 74 72 61 69 6e |//Log( C|onstrain|
|00002230| 65 64 41 63 74 6f 72 20 | 24 20 22 09 09 4d 61 78 |edActor |$ "..Max|
|00002240| 44 65 6c 74 61 59 61 77 | 3a 20 22 20 24 20 4d 61 |DeltaYaw|: " $ Ma|
|00002250| 78 44 65 6c 74 61 59 61 | 77 20 29 3b 0d 0a 09 2f |xDeltaYa|w );.../|
|00002260| 2f 4c 6f 67 28 20 43 6f | 6e 73 74 72 61 69 6e 65 |/Log( Co|nstraine|
|00002270| 64 41 63 74 6f 72 20 24 | 20 22 09 09 44 65 6c 74 |dActor $| "..Delt|
|00002280| 61 59 61 77 3a 20 22 20 | 24 20 44 65 6c 74 61 59 |aYaw: " |$ DeltaY|
|00002290| 61 77 20 29 3b 0d 0a 09 | 0d 0a 09 2f 2f 78 78 78 |aw );...|...//xxx|
|000022a0| 20 55 6e 6f 62 73 74 72 | 75 63 74 65 64 44 65 73 | Unobstr|uctedDes|
|000022b0| 74 69 6e 61 74 69 6f 6e | 20 3d 20 50 72 65 66 65 |tination| = Prefe|
|000022c0| 72 72 65 64 44 65 73 74 | 69 6e 61 74 69 6f 6e 3b |rredDest|ination;|
|000022d0| 0d 0a 09 2f 2f 78 78 78 | 20 72 65 74 75 72 6e 20 |...//xxx| return |
|000022e0| 74 72 75 65 3b 0d 0a 0d | 0a 09 54 72 61 63 65 45 |true;...|..TraceE|
|000022f0| 78 74 65 6e 74 2e 58 20 | 3d 20 4d 6f 76 69 6e 67 |xtent.X |= Moving|
|00002300| 41 63 74 6f 72 2e 43 6f | 6c 6c 69 73 69 6f 6e 52 |Actor.Co|llisionR|
|00002310| 61 64 69 75 73 3b 0d 0a | 09 54 72 61 63 65 45 78 |adius;..|.TraceEx|
|00002320| 74 65 6e 74 2e 59 20 3d | 20 4d 6f 76 69 6e 67 41 |tent.Y =| MovingA|
|00002330| 63 74 6f 72 2e 43 6f 6c | 6c 69 73 69 6f 6e 52 61 |ctor.Col|lisionRa|
|00002340| 64 69 75 73 3b 0d 0a 09 | 54 72 61 63 65 45 78 74 |dius;...|TraceExt|
|00002350| 65 6e 74 2e 5a 20 3d 20 | 4d 6f 76 69 6e 67 41 63 |ent.Z = |MovingAc|
|00002360| 74 6f 72 2e 43 6f 6c 6c | 69 73 69 6f 6e 48 65 69 |tor.Coll|isionHei|
|00002370| 67 68 74 3b 0d 0a 09 0d | 0a 09 50 72 65 66 65 72 |ght;....|..Prefer|
|00002380| 72 65 64 44 69 73 74 61 | 6e 63 65 20 3d 20 56 53 |redDista|nce = VS|
|00002390| 69 7a 65 28 20 50 72 65 | 66 65 72 72 65 64 44 65 |ize( Pre|ferredDe|
|000023a0| 73 74 69 6e 61 74 69 6f | 6e 20 2d 20 4d 6f 76 69 |stinatio|n - Movi|
|000023b0| 6e 67 41 63 74 6f 72 2e | 4c 6f 63 61 74 69 6f 6e |ngActor.|Location|
|000023c0| 20 29 3b 0d 0a 09 43 75 | 72 72 65 6e 74 52 6f 74 | );...Cu|rrentRot|
|000023d0| 61 74 69 6f 6e 55 73 65 | 64 20 3d 20 52 6f 74 61 |ationUse|d = Rota|
|000023e0| 74 6f 72 28 20 50 72 65 | 66 65 72 72 65 64 44 65 |tor( Pre|ferredDe|
|000023f0| 73 74 69 6e 61 74 69 6f | 6e 20 2d 20 4d 6f 76 69 |stinatio|n - Movi|
|00002400| 6e 67 41 63 74 6f 72 2e | 4c 6f 63 61 74 69 6f 6e |ngActor.|Location|
|00002410| 20 29 3b 0d 0a 09 0d 0a | 09 50 72 65 66 65 72 72 | );.....|.Preferr|
|00002420| 65 64 59 61 77 20 3d 20 | 43 75 72 72 65 6e 74 52 |edYaw = |CurrentR|
|00002430| 6f 74 61 74 69 6f 6e 55 | 73 65 64 2e 59 61 77 3b |otationU|sed.Yaw;|
|00002440| 0d 0a 09 43 75 72 72 65 | 6e 74 50 61 77 6e 59 61 |...Curre|ntPawnYa|
|00002450| 77 20 3d 20 4d 6f 76 69 | 6e 67 41 63 74 6f 72 2e |w = Movi|ngActor.|
|00002460| 52 6f 74 61 74 69 6f 6e | 2e 59 61 77 3b 0d 0a 09 |Rotation|.Yaw;...|
|00002470| 0d 0a 09 50 61 77 6e 53 | 74 65 70 48 65 69 67 68 |...PawnS|tepHeigh|
|00002480| 74 20 3d 20 50 61 77 6e | 28 20 4d 6f 76 69 6e 67 |t = Pawn|( Moving|
|00002490| 41 63 74 6f 72 20 29 2e | 4d 61 78 53 74 65 70 48 |Actor ).|MaxStepH|
|000024a0| 65 69 67 68 74 3b 0d 0a | 0d 0a 09 66 6f 72 28 20 |eight;..|...for( |
|000024b0| 43 75 72 72 65 6e 74 44 | 65 6c 74 61 59 61 77 20 |CurrentD|eltaYaw |
|000024c0| 3d 20 30 3b 0d 0a 09 09 | 09 28 20 28 20 61 62 73 |= 0;....|.( ( abs|
|000024d0| 28 20 43 75 72 72 65 6e | 74 44 65 6c 74 61 59 61 |( Curren|tDeltaYa|
|000024e0| 77 20 29 20 3c 20 4d 61 | 78 44 65 6c 74 61 59 61 |w ) < Ma|xDeltaYa|
|000024f0| 77 20 29 20 26 26 20 21 | 62 50 61 74 68 46 6f 75 |w ) && !|bPathFou|
|00002500| 6e 64 20 29 3b 0d 0a 09 | 09 09 43 75 72 72 65 6e |nd );...|..Curren|
|00002510| 74 44 65 6c 74 61 59 61 | 77 20 3d 20 43 75 72 72 |tDeltaYa|w = Curr|
|00002520| 65 6e 74 44 65 6c 74 61 | 59 61 77 20 29 0d 0a 09 |entDelta|Yaw )...|
|00002530| 7b 0d 0a 09 09 43 75 72 | 72 65 6e 74 52 6f 74 61 |{....Cur|rentRota|
|00002540| 74 69 6f 6e 55 73 65 64 | 2e 59 61 77 20 3d 20 50 |tionUsed|.Yaw = P|
|00002550| 72 65 66 65 72 72 65 64 | 59 61 77 20 2b 20 43 75 |referred|Yaw + Cu|
|00002560| 72 72 65 6e 74 44 65 6c | 74 61 59 61 77 3b 0d 0a |rrentDel|taYaw;..|
|00002570| 09 09 44 65 6c 74 61 59 | 61 77 46 72 6f 6d 43 75 |..DeltaY|awFromCu|
|00002580| 72 72 65 6e 74 20 3d 20 | 41 62 73 28 20 4e 6f 72 |rrent = |Abs( Nor|
|00002590| 6d 61 6c 69 7a 65 28 20 | 43 75 72 72 65 6e 74 52 |malize( |CurrentR|
|000025a0| 6f 74 61 74 69 6f 6e 55 | 73 65 64 20 2d 0d 0a 09 |otationU|sed -...|
|000025b0| 09 09 09 4d 6f 76 69 6e | 67 41 63 74 6f 72 2e 52 |...Movin|gActor.R|
|000025c0| 6f 74 61 74 69 6f 6e 20 | 29 2e 59 61 77 20 29 3b |otation |).Yaw );|
|000025d0| 0d 0a 09 09 0d 0a 09 09 | 69 66 28 20 20 44 65 6c |........|if( Del|
|000025e0| 74 61 59 61 77 46 72 6f | 6d 43 75 72 72 65 6e 74 |taYawFro|mCurrent|
|000025f0| 20 3c 20 4d 69 6e 44 65 | 6c 74 61 59 61 77 20 29 | < MinDe|ltaYaw )|
|00002600| 0d 0a 09 09 7b 0d 0a 09 | 09 09 43 75 72 72 65 6e |....{...|..Curren|
|00002610| 74 44 65 73 74 69 6e 61 | 74 69 6f 6e 55 73 65 64 |tDestina|tionUsed|
|00002620| 20 3d 20 50 72 65 66 65 | 72 72 65 64 44 65 73 74 | = Prefe|rredDest|
|00002630| 69 6e 61 74 69 6f 6e 3b | 0d 0a 09 09 7d 0d 0a 09 |ination;|....}...|
|00002640| 09 65 6c 73 65 0d 0a 09 | 09 7b 0d 0a 09 09 09 43 |.else...|.{.....C|
|00002650| 75 72 72 65 6e 74 44 65 | 73 74 69 6e 61 74 69 6f |urrentDe|stinatio|
|00002660| 6e 55 73 65 64 20 3d 20 | 4d 6f 76 69 6e 67 41 63 |nUsed = |MovingAc|
|00002670| 74 6f 72 2e 4c 6f 63 61 | 74 69 6f 6e 20 2b 0d 0a |tor.Loca|tion +..|
|00002680| 09 09 09 09 09 56 65 63 | 74 6f 72 28 20 43 75 72 |.....Vec|tor( Cur|
|00002690| 72 65 6e 74 52 6f 74 61 | 74 69 6f 6e 55 73 65 64 |rentRota|tionUsed|
|000026a0| 20 29 20 2a 20 50 72 65 | 66 65 72 72 65 64 44 69 | ) * Pre|ferredDi|
|000026b0| 73 74 61 6e 63 65 3b 0d | 0a 09 09 7d 0d 0a 09 09 |stance;.|...}....|
|000026c0| 0d 0a 09 09 66 6f 72 65 | 61 63 68 20 4d 6f 76 69 |....fore|ach Movi|
|000026d0| 6e 67 41 63 74 6f 72 2e | 54 72 61 63 65 41 63 74 |ngActor.|TraceAct|
|000026e0| 6f 72 73 28 20 63 6c 61 | 73 73 27 41 63 74 6f 72 |ors( cla|ss'Actor|
|000026f0| 27 2c 20 54 72 61 63 65 | 48 69 74 41 63 74 6f 72 |', Trace|HitActor|
|00002700| 2c 0d 0a 09 09 09 09 54 | 72 61 63 65 48 69 74 4c |,......T|raceHitL|
|00002710| 6f 63 61 74 69 6f 6e 2c | 20 54 72 61 63 65 48 69 |ocation,| TraceHi|
|00002720| 74 4e 6f 72 6d 61 6c 2c | 20 43 75 72 72 65 6e 74 |tNormal,| Current|
|00002730| 44 65 73 74 69 6e 61 74 | 69 6f 6e 55 73 65 64 2c |Destinat|ionUsed,|
|00002740| 0d 0a 09 09 09 09 4d 6f | 76 69 6e 67 41 63 74 6f |......Mo|vingActo|
|00002750| 72 2e 4c 6f 63 61 74 69 | 6f 6e 2c 20 54 72 61 63 |r.Locati|on, Trac|
|00002760| 65 45 78 74 65 6e 74 20 | 29 0d 0a 09 09 7b 0d 0a |eExtent |)....{..|
|00002770| 09 09 09 69 66 28 20 54 | 72 61 63 65 48 69 74 41 |...if( T|raceHitA|
|00002780| 63 74 6f 72 2e 49 73 41 | 28 20 27 4c 65 76 65 6c |ctor.IsA|( 'Level|
|00002790| 49 6e 66 6f 27 20 29 20 | 7c 7c 20 28 20 54 72 61 |Info' ) ||| ( Tra|
|000027a0| 63 65 48 69 74 41 63 74 | 6f 72 2e 62 42 6c 6f 63 |ceHitAct|or.bBloc|
|000027b0| 6b 41 63 74 6f 72 73 20 | 29 20 29 0d 0a 09 09 09 |kActors |) ).....|
|000027c0| 7b 0d 0a 09 09 09 09 62 | 72 65 61 6b 3b 0d 0a 09 |{......b|reak;...|
|000027d0| 09 09 7d 0d 0a 2f 2a 0d | 0a 09 09 09 65 6c 73 65 |..}../*.|....else|
|000027e0| 20 69 66 28 20 4d 6f 76 | 69 6e 67 41 63 74 6f 72 | if( Mov|ingActor|
|000027f0| 2e 49 73 41 28 20 27 50 | 61 77 6e 27 20 29 20 29 |.IsA( 'P|awn' ) )|
|00002800| 0d 0a 09 09 09 7b 0d 0a | 09 09 09 09 69 66 28 20 |.....{..|....if( |
|00002810| 54 72 61 63 65 48 69 74 | 41 63 74 6f 72 2e 62 42 |TraceHit|Actor.bB|
|00002820| 6c 6f 63 6b 41 63 74 6f | 72 73 20 2f 2a 20 26 26 |lockActo|rs /* &&|
|00002830| 20 28 20 56 53 69 7a 65 | 28 20 54 72 61 63 65 48 | ( VSize|( TraceH|
|00002840| 69 74 41 63 74 6f 72 2e | 56 65 6c 6f 63 69 74 79 |itActor.|Velocity|
|00002850| 20 29 20 7e 3d 20 30 20 | 29 2a 2f 20 29 0d 0a 09 | ) ~= 0 |)*/ )...|
|00002860| 09 09 09 7b 0d 0a 09 09 | 09 09 09 2f 2f 74 68 65 |...{....|...//the|
|00002870| 20 74 72 61 63 65 20 68 | 69 74 20 61 63 74 6f 72 | trace h|it actor|
|00002880| 20 62 6c 6f 63 6b 73 20 | 61 63 74 6f 72 20 61 6e | blocks |actor an|
|00002890| 64 20 69 73 20 6e 6f 74 | 20 6d 6f 76 69 6e 67 0d |d is not| moving.|
|000028a0| 0a 09 09 09 09 09 69 66 | 28 20 28 20 54 72 61 63 |......if|( ( Trac|
|000028b0| 65 48 69 74 41 63 74 6f | 72 2e 43 6f 6c 6c 69 73 |eHitActo|r.Collis|
|000028c0| 69 6f 6e 48 65 69 67 68 | 74 20 2a 20 32 20 29 20 |ionHeigh|t * 2 ) |
|000028d0| 3e 20 50 61 77 6e 53 74 | 65 70 48 65 69 67 68 74 |> PawnSt|epHeight|
|000028e0| 20 29 0d 0a 09 09 09 09 | 09 7b 0d 0a 09 09 09 09 | )......|.{......|
|000028f0| 09 09 2f 2f 74 68 65 20 | 70 61 77 6e 20 63 61 6e |..//the |pawn can|
|00002900| 20 6e 6f 74 20 73 74 65 | 70 20 6f 76 65 72 20 74 | not ste|p over t|
|00002910| 68 65 20 6f 62 73 74 72 | 75 63 74 69 6f 6e 0d 0a |he obstr|uction..|
|00002920| 09 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 0a 09 09 |......br|eak;....|
|00002930| 09 09 09 7d 0d 0a 09 09 | 09 09 7d 0d 0a 09 09 09 |...}....|..}.....|
|00002940| 7d 0d 0a 2a 2f 0d 0a 09 | 09 09 2f 2f 74 68 65 20 |}..*/...|..//the |
|00002950| 61 63 74 6f 72 20 68 69 | 74 20 62 79 20 74 68 65 |actor hi|t by the|
|00002960| 20 74 72 61 63 65 20 77 | 61 73 20 6e 6f 74 20 74 | trace w|as not t|
|00002970| 68 65 20 6c 65 76 65 6c | 20 6f 72 20 61 20 62 6c |he level| or a bl|
|00002980| 6f 63 6b 69 6e 67 20 61 | 63 74 6f 72 0d 0a 09 09 |ocking a|ctor....|
|00002990| 09 54 72 61 63 65 48 69 | 74 41 63 74 6f 72 20 3d |.TraceHi|tActor =|
|000029a0| 20 6e 6f 6e 65 3b 0d 0a | 09 09 7d 0d 0a 09 09 0d | none;..|..}.....|
|000029b0| 0a 09 09 69 66 28 20 54 | 72 61 63 65 48 69 74 41 |...if( T|raceHitA|
|000029c0| 63 74 6f 72 20 3d 3d 20 | 6e 6f 6e 65 20 29 0d 0a |ctor == |none )..|
|000029d0| 09 09 7b 0d 0a 09 09 09 | 55 6e 6f 62 73 74 72 75 |..{.....|Unobstru|
|000029e0| 63 74 65 64 44 65 73 74 | 69 6e 61 74 69 6f 6e 20 |ctedDest|ination |
|000029f0| 3d 20 43 75 72 72 65 6e | 74 44 65 73 74 69 6e 61 |= Curren|tDestina|
|00002a00| 74 69 6f 6e 55 73 65 64 | 3b 0d 0a 09 09 09 62 50 |tionUsed|;.....bP|
|00002a10| 61 74 68 46 6f 75 6e 64 | 20 3d 20 74 72 75 65 3b |athFound| = true;|
|00002a20| 0d 0a 09 09 7d 0d 0a 09 | 09 65 6c 73 65 0d 0a 09 |....}...|.else...|
|00002a30| 09 7b 0d 0a 09 09 09 2f | 2f 74 68 65 20 74 72 61 |.{...../|/the tra|
|00002a40| 63 65 20 68 69 74 20 73 | 6f 6d 65 74 68 69 6e 67 |ce hit s|omething|
|00002a50| 20 73 6f 20 74 72 79 20 | 72 65 64 75 63 69 6e 67 | so try |reducing|
|00002a60| 20 74 68 65 20 64 69 73 | 74 61 6e 63 65 0d 0a 09 | the dis|tance...|
|00002a70| 09 09 2f 2f 73 6f 6d 65 | 74 68 69 6e 67 20 69 73 |..//some|thing is|
|00002a80| 20 62 6c 6f 63 6b 69 6e | 67 20 74 68 65 20 64 69 | blockin|g the di|
|00002a90| 72 65 63 74 20 70 61 74 | 68 20 74 6f 20 74 68 65 |rect pat|h to the|
|00002aa0| 20 63 75 72 72 65 6e 74 | 20 64 65 73 74 69 6e 61 | current| destina|
|00002ab0| 74 69 6f 6e 0d 0a 09 09 | 09 52 65 64 75 63 65 64 |tion....|.Reduced|
|00002ac0| 44 69 73 74 61 6e 63 65 | 20 3d 20 56 53 69 7a 65 |Distance| = VSize|
|00002ad0| 28 20 54 72 61 63 65 48 | 69 74 4c 6f 63 61 74 69 |( TraceH|itLocati|
|00002ae0| 6f 6e 20 2d 20 4d 6f 76 | 69 6e 67 41 63 74 6f 72 |on - Mov|ingActor|
|00002af0| 2e 4c 6f 63 61 74 69 6f | 6e 20 29 3b 0d 0a 09 09 |.Locatio|n );....|
|00002b00| 09 0d 0a 09 09 09 2f 2f | 4c 6f 67 28 20 43 6f 6e |......//|Log( Con|
|00002b10| 73 74 72 61 69 6e 65 64 | 41 63 74 6f 72 20 24 20 |strained|Actor $ |
|00002b20| 22 3a 3a 46 69 6e 64 55 | 6e 6f 62 73 74 72 75 63 |"::FindU|nobstruc|
|00002b30| 74 65 64 44 65 73 74 69 | 6e 61 74 69 6f 6e 22 20 |tedDesti|nation" |
|00002b40| 29 3b 0d 0a 09 09 09 2f | 2f 4c 6f 67 28 20 43 6f |);...../|/Log( Co|
|00002b50| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 20 24 |nstraine|dActor $|
|00002b60| 20 22 09 09 54 72 61 63 | 65 48 69 74 41 63 74 6f | "..Trac|eHitActo|
|00002b70| 72 20 22 20 24 20 54 72 | 61 63 65 48 69 74 41 63 |r " $ Tr|aceHitAc|
|00002b80| 74 6f 72 20 29 3b 0d 0a | 09 09 09 2f 2f 4c 6f 67 |tor );..|...//Log|
|00002b90| 28 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |( Constr|ainedAct|
|00002ba0| 6f 72 20 24 20 22 09 09 | 54 72 61 63 65 48 69 74 |or $ "..|TraceHit|
|00002bb0| 4c 6f 63 61 74 69 6f 6e | 20 22 20 24 20 54 72 61 |Location| " $ Tra|
|00002bc0| 63 65 48 69 74 4c 6f 63 | 61 74 69 6f 6e 20 29 3b |ceHitLoc|ation );|
|00002bd0| 0d 0a 09 09 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |.....//L|og( Cons|
|00002be0| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|00002bf0| 09 09 52 65 64 75 63 65 | 64 44 69 73 74 61 6e 63 |..Reduce|dDistanc|
|00002c00| 65 20 22 20 24 20 52 65 | 64 75 63 65 64 44 69 73 |e " $ Re|ducedDis|
|00002c10| 74 61 6e 63 65 20 29 3b | 0d 0a 09 09 09 0d 0a 09 |tance );|........|
|00002c20| 09 09 69 66 28 20 52 65 | 64 75 63 65 64 44 69 73 |..if( Re|ducedDis|
|00002c30| 74 61 6e 63 65 20 3e 3d | 20 4d 69 6e 52 65 64 75 |tance >=| MinRedu|
|00002c40| 63 65 64 44 69 73 74 61 | 6e 63 65 20 29 0d 0a 09 |cedDista|nce )...|
|00002c50| 09 09 7b 0d 0a 09 09 09 | 09 55 6e 6f 62 73 74 72 |..{.....|.Unobstr|
|00002c60| 75 63 74 65 64 44 65 73 | 74 69 6e 61 74 69 6f 6e |uctedDes|tination|
|00002c70| 20 3d 20 4d 6f 76 69 6e | 67 41 63 74 6f 72 2e 4c | = Movin|gActor.L|
|00002c80| 6f 63 61 74 69 6f 6e 20 | 2b 0d 0a 09 09 09 09 09 |ocation |+.......|
|00002c90| 09 56 65 63 74 6f 72 28 | 20 43 75 72 72 65 6e 74 |.Vector(| Current|
|00002ca0| 52 6f 74 61 74 69 6f 6e | 55 73 65 64 20 29 20 2a |Rotation|Used ) *|
|00002cb0| 20 52 65 64 75 63 65 64 | 44 69 73 74 61 6e 63 65 | Reduced|Distance|
|00002cc0| 3b 0d 0a 09 09 09 09 62 | 50 61 74 68 46 6f 75 6e |;......b|PathFoun|
|00002cd0| 64 20 3d 20 74 72 75 65 | 3b 0d 0a 09 09 09 7d 0d |d = true|;.....}.|
|00002ce0| 0a 09 09 7d 0d 0a 09 09 | 0d 0a 09 09 43 75 72 72 |...}....|....Curr|
|00002cf0| 65 6e 74 44 65 6c 74 61 | 59 61 77 20 3d 20 2d 43 |entDelta|Yaw = -C|
|00002d00| 75 72 72 65 6e 74 44 65 | 6c 74 61 59 61 77 3b 0d |urrentDe|ltaYaw;.|
|00002d10| 0a 09 09 0d 0a 09 09 69 | 66 28 20 43 75 72 72 65 |.......i|f( Curre|
|00002d20| 6e 74 44 65 6c 74 61 59 | 61 77 20 3e 3d 20 30 20 |ntDeltaY|aw >= 0 |
|00002d30| 29 0d 0a 09 09 7b 0d 0a | 09 09 09 2f 2f 72 6f 74 |)....{..|...//rot|
|00002d40| 61 74 69 6e 67 20 74 6f | 20 74 68 65 20 72 69 67 |ating to| the rig|
|00002d50| 68 74 20 61 6e 64 20 74 | 68 65 20 6c 65 66 74 20 |ht and t|he left |
|00002d60| 68 61 73 20 61 6c 72 65 | 61 64 79 20 62 65 65 6e |has alre|ady been|
|00002d70| 20 63 68 65 63 6b 65 64 | 0d 0a 09 09 09 2f 2f 69 | checked|.....//i|
|00002d80| 6e 63 72 65 6d 65 6e 74 | 20 74 68 65 20 63 68 61 |ncrement| the cha|
|00002d90| 6e 67 65 20 69 6e 20 79 | 61 77 20 61 6e 64 20 63 |nge in y|aw and c|
|00002da0| 68 65 63 6b 20 72 6f 74 | 61 74 69 6e 67 20 74 6f |heck rot|ating to|
|00002db0| 20 74 68 65 20 72 69 67 | 68 74 0d 0a 09 09 09 43 | the rig|ht.....C|
|00002dc0| 75 72 72 65 6e 74 44 65 | 6c 74 61 59 61 77 20 2b |urrentDe|ltaYaw +|
|00002dd0| 3d 20 44 65 6c 74 61 59 | 61 77 3b 0d 0a 09 09 7d |= DeltaY|aw;....}|
|00002de0| 0d 0a 09 7d 0d 0a 09 0d | 0a 09 72 65 74 75 72 6e |...}....|..return|
|00002df0| 20 62 50 61 74 68 46 6f | 75 6e 64 3b 0d 0a 7d 0d | bPathFo|und;..}.|
|00002e00| 0a 0d 0a 0d 0a 0d 0a 66 | 75 6e 63 74 69 6f 6e 20 |.......f|unction |
|00002e10| 62 6f 6f 6c 20 43 6f 6e | 73 74 72 61 69 6e 41 63 |bool Con|strainAc|
|00002e20| 74 6f 72 46 6f 63 75 73 | 28 20 6f 75 74 20 56 65 |torFocus|( out Ve|
|00002e30| 63 74 6f 72 20 43 6f 6e | 73 74 72 61 69 6e 65 64 |ctor Con|strained|
|00002e40| 46 6f 63 75 73 2c 0d 0a | 09 09 56 65 63 74 6f 72 |Focus,..|..Vector|
|00002e50| 20 50 72 65 66 65 72 72 | 65 64 46 6f 63 75 73 2c | Preferr|edFocus,|
|00002e60| 0d 0a 09 09 41 63 74 6f | 72 20 43 6f 6e 73 74 72 |....Acto|r Constr|
|00002e70| 61 69 6e 65 64 41 63 74 | 6f 72 20 29 0d 0a 7b 0d |ainedAct|or )..{.|
|00002e80| 0a 09 6c 6f 63 61 6c 20 | 52 6f 74 61 74 6f 72 20 |..local |Rotator |
|00002e90| 43 6f 6e 73 74 72 61 69 | 6e 65 64 46 6f 63 75 73 |Constrai|nedFocus|
|00002ea0| 52 6f 74 61 74 69 6f 6e | 3b 0d 0a 09 72 65 74 75 |Rotation|;...retu|
|00002eb0| 72 6e 20 43 6f 6e 73 74 | 72 61 69 6e 41 63 74 6f |rn Const|rainActo|
|00002ec0| 72 46 6f 63 75 73 41 6e | 64 52 6f 74 61 74 69 6f |rFocusAn|dRotatio|
|00002ed0| 6e 28 20 43 6f 6e 73 74 | 72 61 69 6e 65 64 46 6f |n( Const|rainedFo|
|00002ee0| 63 75 73 2c 20 43 6f 6e | 73 74 72 61 69 6e 65 64 |cus, Con|strained|
|00002ef0| 46 6f 63 75 73 52 6f 74 | 61 74 69 6f 6e 2c 0d 0a |FocusRot|ation,..|
|00002f00| 09 09 09 50 72 65 66 65 | 72 72 65 64 46 6f 63 75 |...Prefe|rredFocu|
|00002f10| 73 2c 20 43 6f 6e 73 74 | 72 61 69 6e 65 64 41 63 |s, Const|rainedAc|
|00002f20| 74 6f 72 20 29 3b 09 0d | 0a 7d 0d 0a 0d 0a 0d 0a |tor );..|.}......|
|00002f30| 0d 0a 66 75 6e 63 74 69 | 6f 6e 20 62 6f 6f 6c 20 |..functi|on bool |
|00002f40| 43 6f 6e 73 74 72 61 69 | 6e 41 63 74 6f 72 46 6f |Constrai|nActorFo|
|00002f50| 63 75 73 41 6e 64 52 6f | 74 61 74 69 6f 6e 28 20 |cusAndRo|tation( |
|00002f60| 6f 75 74 20 56 65 63 74 | 6f 72 20 43 6f 6e 73 74 |out Vect|or Const|
|00002f70| 72 61 69 6e 65 64 46 6f | 63 75 73 2c 0d 0a 09 09 |rainedFo|cus,....|
|00002f80| 6f 75 74 20 52 6f 74 61 | 74 6f 72 20 43 6f 6e 73 |out Rota|tor Cons|
|00002f90| 74 72 61 69 6e 65 64 46 | 6f 63 75 73 52 6f 74 61 |trainedF|ocusRota|
|00002fa0| 74 69 6f 6e 2c 0d 0a 09 | 09 56 65 63 74 6f 72 20 |tion,...|.Vector |
|00002fb0| 50 72 65 66 65 72 72 65 | 64 46 6f 63 75 73 2c 0d |Preferre|dFocus,.|
|00002fc0| 0a 09 09 41 63 74 6f 72 | 20 43 6f 6e 73 74 72 61 |...Actor| Constra|
|00002fd0| 69 6e 65 64 41 63 74 6f | 72 20 29 0d 0a 7b 0d 0a |inedActo|r )..{..|
|00002fe0| 09 6c 6f 63 61 6c 20 52 | 6f 74 61 74 6f 72 20 50 |.local R|otator P|
|00002ff0| 72 65 66 65 72 72 65 64 | 52 6f 74 61 74 69 6f 6e |referred|Rotation|
|00003000| 3b 0d 0a 09 6c 6f 63 61 | 6c 20 56 65 63 74 6f 72 |;...loca|l Vector|
|00003010| 20 56 65 63 74 6f 72 44 | 69 66 66 65 72 65 6e 63 | VectorD|ifferenc|
|00003020| 65 3b 0d 0a 09 6c 6f 63 | 61 6c 20 62 6f 6f 6c 20 |e;...loc|al bool |
|00003030| 62 46 6f 63 75 73 52 6f | 74 61 74 69 6f 6e 43 6f |bFocusRo|tationCo|
|00003040| 6e 73 74 72 61 69 6e 65 | 64 3b 0d 0a 09 0d 0a 09 |nstraine|d;......|
|00003050| 2f 2f 4c 6f 67 28 20 43 | 6f 6e 73 74 72 61 69 6e |//Log( C|onstrain|
|00003060| 65 64 41 63 74 6f 72 20 | 24 20 22 3a 3a 42 65 68 |edActor |$ "::Beh|
|00003070| 61 76 69 6f 72 43 6f 6e | 73 74 72 61 69 6e 65 72 |aviorCon|strainer|
|00003080| 3a 3a 43 6f 6e 73 74 72 | 61 69 6e 46 6f 63 75 73 |::Constr|ainFocus|
|00003090| 22 20 29 3b 0d 0a 09 56 | 65 63 74 6f 72 44 69 66 |" );...V|ectorDif|
|000030a0| 66 65 72 65 6e 63 65 20 | 3d 20 50 72 65 66 65 72 |ference |= Prefer|
|000030b0| 72 65 64 46 6f 63 75 73 | 20 2d 20 43 6f 6e 73 74 |redFocus| - Const|
|000030c0| 72 61 69 6e 65 64 41 63 | 74 6f 72 2e 4c 6f 63 61 |rainedAc|tor.Loca|
|000030d0| 74 69 6f 6e 3b 0d 0a 09 | 50 72 65 66 65 72 72 65 |tion;...|Preferre|
|000030e0| 64 52 6f 74 61 74 69 6f | 6e 20 3d 20 52 6f 74 61 |dRotatio|n = Rota|
|000030f0| 74 6f 72 28 20 56 65 63 | 74 6f 72 44 69 66 66 65 |tor( Vec|torDiffe|
|00003100| 72 65 6e 63 65 20 29 3b | 0d 0a 09 0d 0a 09 62 46 |rence );|......bF|
|00003110| 6f 63 75 73 52 6f 74 61 | 74 69 6f 6e 43 6f 6e 73 |ocusRota|tionCons|
|00003120| 74 72 61 69 6e 65 64 20 | 3d 20 43 6f 6e 73 74 72 |trained |= Constr|
|00003130| 61 69 6e 41 63 74 6f 72 | 52 6f 74 61 74 69 6f 6e |ainActor|Rotation|
|00003140| 28 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 46 6f 63 |( Constr|ainedFoc|
|00003150| 75 73 52 6f 74 61 74 69 | 6f 6e 2c 0d 0a 09 09 09 |usRotati|on,.....|
|00003160| 50 72 65 66 65 72 72 65 | 64 52 6f 74 61 74 69 6f |Preferre|dRotatio|
|00003170| 6e 2c 20 43 6f 6e 73 74 | 72 61 69 6e 65 64 41 63 |n, Const|rainedAc|
|00003180| 74 6f 72 20 29 3b 0d 0a | 0d 0a 09 69 66 28 20 62 |tor );..|...if( b|
|00003190| 46 6f 63 75 73 52 6f 74 | 61 74 69 6f 6e 43 6f 6e |FocusRot|ationCon|
|000031a0| 73 74 72 61 69 6e 65 64 | 20 29 0d 0a 09 7b 0d 0a |strained| )...{..|
|000031b0| 09 09 43 6f 6e 73 74 72 | 61 69 6e 65 64 46 6f 63 |..Constr|ainedFoc|
|000031c0| 75 73 20 3d 20 43 6f 6e | 73 74 72 61 69 6e 65 64 |us = Con|strained|
|000031d0| 41 63 74 6f 72 2e 4c 6f | 63 61 74 69 6f 6e 20 2b |Actor.Lo|cation +|
|000031e0| 0d 0a 09 09 09 09 28 20 | 56 65 63 74 6f 72 28 20 |......( |Vector( |
|000031f0| 43 6f 6e 73 74 72 61 69 | 6e 65 64 46 6f 63 75 73 |Constrai|nedFocus|
|00003200| 52 6f 74 61 74 69 6f 6e | 20 29 20 2a 20 56 53 69 |Rotation| ) * VSi|
|00003210| 7a 65 28 20 56 65 63 74 | 6f 72 44 69 66 66 65 72 |ze( Vect|orDiffer|
|00003220| 65 6e 63 65 20 29 20 29 | 3b 0d 0a 09 7d 0d 0a 09 |ence ) )|;...}...|
|00003230| 65 6c 73 65 0d 0a 09 7b | 0d 0a 09 09 43 6f 6e 73 |else...{|....Cons|
|00003240| 74 72 61 69 6e 65 64 46 | 6f 63 75 73 20 3d 20 50 |trainedF|ocus = P|
|00003250| 72 65 66 65 72 72 65 64 | 46 6f 63 75 73 3b 0d 0a |referred|Focus;..|
|00003260| 09 7d 0d 0a 0d 0a 09 2f | 2f 4c 6f 67 28 20 43 6f |.}...../|/Log( Co|
|00003270| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 20 24 |nstraine|dActor $|
|00003280| 20 22 3a 3a 43 6f 6e 73 | 74 72 61 69 6e 41 63 74 | "::Cons|trainAct|
|00003290| 6f 72 46 6f 63 75 73 41 | 6e 64 52 6f 74 61 74 69 |orFocusA|ndRotati|
|000032a0| 6f 6e 20 43 6f 6e 73 74 | 72 61 69 6e 65 64 41 63 |on Const|rainedAc|
|000032b0| 74 6f 72 2e 4c 6f 63 61 | 74 69 6f 6e 3a 20 22 20 |tor.Loca|tion: " |
|000032c0| 24 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |$ Constr|ainedAct|
|000032d0| 6f 72 2e 4c 6f 63 61 74 | 69 6f 6e 20 29 3b 0d 0a |or.Locat|ion );..|
|000032e0| 09 2f 2f 4c 6f 67 28 20 | 43 6f 6e 73 74 72 61 69 |.//Log( |Constrai|
|000032f0| 6e 65 64 41 63 74 6f 72 | 20 24 20 22 3a 3a 43 6f |nedActor| $ "::Co|
|00003300| 6e 73 74 72 61 69 6e 41 | 63 74 6f 72 46 6f 63 75 |nstrainA|ctorFocu|
|00003310| 73 41 6e 64 52 6f 74 61 | 74 69 6f 6e 20 43 6f 6e |sAndRota|tion Con|
|00003320| 73 74 72 61 69 6e 65 64 | 41 63 74 6f 72 2e 52 6f |strained|Actor.Ro|
|00003330| 74 61 74 69 6f 6e 3a 20 | 22 20 24 20 43 6f 6e 73 |tation: |" $ Cons|
|00003340| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 2e 52 6f 74 |trainedA|ctor.Rot|
|00003350| 61 74 69 6f 6e 20 29 3b | 0d 0a 09 2f 2f 4c 6f 67 |ation );|...//Log|
|00003360| 28 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |( Constr|ainedAct|
|00003370| 6f 72 20 24 20 22 3a 3a | 43 6f 6e 73 74 72 61 69 |or $ "::|Constrai|
|00003380| 6e 41 63 74 6f 72 46 6f | 63 75 73 41 6e 64 52 6f |nActorFo|cusAndRo|
|00003390| 74 61 74 69 6f 6e 20 56 | 65 63 74 6f 72 44 69 66 |tation V|ectorDif|
|000033a0| 66 65 72 65 6e 63 65 3a | 20 22 20 24 20 56 65 63 |ference:| " $ Vec|
|000033b0| 74 6f 72 44 69 66 66 65 | 72 65 6e 63 65 20 29 3b |torDiffe|rence );|
|000033c0| 0d 0a 09 2f 2f 4c 6f 67 | 28 20 43 6f 6e 73 74 72 |...//Log|( Constr|
|000033d0| 61 69 6e 65 64 41 63 74 | 6f 72 20 24 20 22 3a 3a |ainedAct|or $ "::|
|000033e0| 43 6f 6e 73 74 72 61 69 | 6e 41 63 74 6f 72 46 6f |Constrai|nActorFo|
|000033f0| 63 75 73 41 6e 64 52 6f | 74 61 74 69 6f 6e 20 50 |cusAndRo|tation P|
|00003400| 72 65 66 65 72 72 65 64 | 52 6f 74 61 74 69 6f 6e |referred|Rotation|
|00003410| 3a 20 22 20 24 20 50 72 | 65 66 65 72 72 65 64 52 |: " $ Pr|eferredR|
|00003420| 6f 74 61 74 69 6f 6e 20 | 29 3b 0d 0a 09 2f 2f 4c |otation |);...//L|
|00003430| 6f 67 28 20 43 6f 6e 73 | 74 72 61 69 6e 65 64 41 |og( Cons|trainedA|
|00003440| 63 74 6f 72 20 24 20 22 | 3a 3a 43 6f 6e 73 74 72 |ctor $ "|::Constr|
|00003450| 61 69 6e 41 63 74 6f 72 | 46 6f 63 75 73 41 6e 64 |ainActor|FocusAnd|
|00003460| 52 6f 74 61 74 69 6f 6e | 20 43 6f 6e 73 74 72 61 |Rotation| Constra|
|00003470| 69 6e 65 64 46 6f 63 75 | 73 52 6f 74 61 74 69 6f |inedFocu|sRotatio|
|00003480| 6e 3a 20 22 20 24 20 43 | 6f 6e 73 74 72 61 69 6e |n: " $ C|onstrain|
|00003490| 65 64 46 6f 63 75 73 52 | 6f 74 61 74 69 6f 6e 20 |edFocusR|otation |
|000034a0| 29 3b 0d 0a 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |);...//L|og( Cons|
|000034b0| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|000034c0| 3a 3a 43 6f 6e 73 74 72 | 61 69 6e 41 63 74 6f 72 |::Constr|ainActor|
|000034d0| 46 6f 63 75 73 41 6e 64 | 52 6f 74 61 74 69 6f 6e |FocusAnd|Rotation|
|000034e0| 20 43 6f 6e 73 74 72 61 | 69 6e 65 64 46 6f 63 75 | Constra|inedFocu|
|000034f0| 73 3a 20 22 20 24 20 43 | 6f 6e 73 74 72 61 69 6e |s: " $ C|onstrain|
|00003500| 65 64 46 6f 63 75 73 20 | 29 3b 0d 0a 09 2f 2f 4c |edFocus |);...//L|
|00003510| 6f 67 28 20 43 6f 6e 73 | 74 72 61 69 6e 65 64 41 |og( Cons|trainedA|
|00003520| 63 74 6f 72 20 24 20 22 | 3a 3a 43 6f 6e 73 74 72 |ctor $ "|::Constr|
|00003530| 61 69 6e 41 63 74 6f 72 | 46 6f 63 75 73 41 6e 64 |ainActor|FocusAnd|
|00003540| 52 6f 74 61 74 69 6f 6e | 20 50 72 65 66 65 72 72 |Rotation| Preferr|
|00003550| 65 64 46 6f 63 75 73 3a | 20 22 20 24 20 50 72 65 |edFocus:| " $ Pre|
|00003560| 66 65 72 72 65 64 46 6f | 63 75 73 20 29 3b 0d 0a |ferredFo|cus );..|
|00003570| 0d 0a 09 72 65 74 75 72 | 6e 20 62 46 6f 63 75 73 |...retur|n bFocus|
|00003580| 52 6f 74 61 74 69 6f 6e | 43 6f 6e 73 74 72 61 69 |Rotation|Constrai|
|00003590| 6e 65 64 3b 0d 0a 7d 0d | 0a 0d 0a 0d 0a 0d 0a 2f |ned;..}.|......./|
|000035a0| 2f 41 64 6a 75 73 74 20 | 74 68 65 20 70 72 65 66 |/Adjust |the pref|
|000035b0| 65 72 72 65 64 20 72 6f | 74 61 74 69 6f 6e 20 74 |erred ro|tation t|
|000035c0| 6f 20 61 63 63 6f 6d 6d | 6f 64 61 74 65 20 74 68 |o accomm|odate th|
|000035d0| 65 20 63 6f 6e 73 74 72 | 61 69 6e 74 73 20 6f 66 |e constr|aints of|
|000035e0| 20 68 6f 77 20 74 68 69 | 73 20 61 63 6f 72 20 69 | how thi|s acor i|
|000035f0| 73 20 61 6c 6c 6f 77 65 | 64 20 74 6f 20 6d 6f 76 |s allowe|d to mov|
|00003600| 65 0d 0a 2f 2f 54 68 65 | 20 63 6f 6e 73 74 72 61 |e..//The| constra|
|00003610| 69 6e 74 27 73 20 4d 69 | 6e 69 6d 75 6d 44 65 6c |int's Mi|nimumDel|
|00003620| 74 61 52 6f 74 61 74 69 | 6f 6e 20 69 73 20 75 73 |taRotati|on is us|
|00003630| 65 64 20 74 6f 20 61 64 | 6a 75 73 74 20 74 68 65 |ed to ad|just the|
|00003640| 20 73 65 6e 73 69 74 69 | 76 69 74 79 20 6f 66 20 | sensiti|vity of |
|00003650| 74 68 65 20 72 65 74 75 | 72 6e 65 64 20 72 6f 74 |the retu|rned rot|
|00003660| 61 74 69 6f 6e 2e 0d 0a | 2f 2f 49 66 20 61 6e 79 |ation...|//If any|
|00003670| 20 6f 66 20 74 68 65 20 | 63 6f 6d 70 6f 6e 65 6e | of the |componen|
|00003680| 74 73 20 6f 66 20 74 68 | 65 20 70 72 6f 70 6f 73 |ts of th|e propos|
|00003690| 65 20 6e 65 77 20 72 6f | 74 61 74 69 6f 6e 20 61 |e new ro|tation a|
|000036a0| 72 65 20 6c 65 73 73 20 | 74 68 61 6e 20 74 68 61 |re less |than tha|
|000036b0| 74 20 6f 66 20 74 68 65 | 20 63 6f 72 72 65 73 70 |t of the| corresp|
|000036c0| 6f 6e 64 69 6e 67 0d 0a | 2f 2f 63 6f 6d 70 6f 6e |onding..|//compon|
|000036d0| 65 6e 74 20 69 6e 20 4d | 69 6e 69 6d 75 6d 44 65 |ent in M|inimumDe|
|000036e0| 6c 74 61 52 6f 74 61 74 | 69 6f 6e 20 74 68 65 6e |ltaRotat|ion then|
|000036f0| 20 74 68 65 20 70 61 77 | 6e 73 20 63 75 72 72 65 | the paw|ns curre|
|00003700| 6e 74 20 72 6f 74 61 74 | 69 6f 6e 20 63 6f 6d 70 |nt rotat|ion comp|
|00003710| 6f 6e 65 6e 74 20 69 73 | 20 72 65 74 61 69 6e 65 |onent is| retaine|
|00003720| 64 2e 0d 0a 66 75 6e 63 | 74 69 6f 6e 20 62 6f 6f |d...func|tion boo|
|00003730| 6c 20 43 6f 6e 73 74 72 | 61 69 6e 41 63 74 6f 72 |l Constr|ainActor|
|00003740| 52 6f 74 61 74 69 6f 6e | 28 20 6f 75 74 20 52 6f |Rotation|( out Ro|
|00003750| 74 61 74 6f 72 20 43 6f | 6e 73 74 72 61 69 6e 64 |tator Co|nstraind|
|00003760| 65 52 6f 74 61 74 69 6f | 6e 2c 0d 0a 09 09 52 6f |eRotatio|n,....Ro|
|00003770| 74 61 74 6f 72 20 50 72 | 65 66 65 72 72 65 64 52 |tator Pr|eferredR|
|00003780| 6f 74 61 74 69 6f 6e 2c | 0d 0a 09 09 41 63 74 6f |otation,|....Acto|
|00003790| 72 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |r Constr|ainedAct|
|000037a0| 6f 72 20 29 0d 0a 7b 0d | 0a 09 6c 6f 63 61 6c 20 |or )..{.|..local |
|000037b0| 52 6f 74 61 74 6f 72 20 | 52 6f 74 61 74 69 6f 6e |Rotator |Rotation|
|000037c0| 44 69 66 66 65 72 65 6e | 63 65 2c 20 41 62 73 52 |Differen|ce, AbsR|
|000037d0| 6f 74 61 74 69 6f 6e 44 | 69 66 66 65 72 65 6e 63 |otationD|ifferenc|
|000037e0| 65 3b 0d 0a 0d 0a 09 2f | 2f 4c 6f 67 28 20 43 6f |e;...../|/Log( Co|
|000037f0| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 20 24 |nstraine|dActor $|
|00003800| 20 22 3a 3a 42 65 68 61 | 76 69 6f 72 43 6f 6e 73 | "::Beha|viorCons|
|00003810| 74 72 61 69 6e 65 72 3a | 3a 43 6f 6e 73 74 72 61 |trainer:|:Constra|
|00003820| 69 6e 41 63 74 6f 72 52 | 6f 74 61 74 69 6f 6e 22 |inActorR|otation"|
|00003830| 20 29 3b 0d 0a 09 52 6f | 74 61 74 69 6f 6e 44 69 | );...Ro|tationDi|
|00003840| 66 66 65 72 65 6e 63 65 | 20 3d 20 4e 6f 72 6d 61 |fference| = Norma|
|00003850| 6c 69 7a 65 28 20 50 72 | 65 66 65 72 72 65 64 52 |lize( Pr|eferredR|
|00003860| 6f 74 61 74 69 6f 6e 20 | 2d 20 43 6f 6e 73 74 72 |otation |- Constr|
|00003870| 61 69 6e 65 64 41 63 74 | 6f 72 2e 52 6f 74 61 74 |ainedAct|or.Rotat|
|00003880| 69 6f 6e 20 29 3b 0d 0a | 09 41 62 73 52 6f 74 61 |ion );..|.AbsRota|
|00003890| 74 69 6f 6e 44 69 66 66 | 65 72 65 6e 63 65 2e 52 |tionDiff|erence.R|
|000038a0| 6f 6c 6c 20 3d 20 61 62 | 73 28 20 52 6f 74 61 74 |oll = ab|s( Rotat|
|000038b0| 69 6f 6e 44 69 66 66 65 | 72 65 6e 63 65 2e 52 6f |ionDiffe|rence.Ro|
|000038c0| 6c 6c 20 29 3b 0d 0a 09 | 41 62 73 52 6f 74 61 74 |ll );...|AbsRotat|
|000038d0| 69 6f 6e 44 69 66 66 65 | 72 65 6e 63 65 2e 50 69 |ionDiffe|rence.Pi|
|000038e0| 74 63 68 20 3d 20 61 62 | 73 28 20 52 6f 74 61 74 |tch = ab|s( Rotat|
|000038f0| 69 6f 6e 44 69 66 66 65 | 72 65 6e 63 65 2e 50 69 |ionDiffe|rence.Pi|
|00003900| 74 63 68 20 29 3b 0d 0a | 09 41 62 73 52 6f 74 61 |tch );..|.AbsRota|
|00003910| 74 69 6f 6e 44 69 66 66 | 65 72 65 6e 63 65 2e 59 |tionDiff|erence.Y|
|00003920| 61 77 20 3d 20 61 62 73 | 28 20 52 6f 74 61 74 69 |aw = abs|( Rotati|
|00003930| 6f 6e 44 69 66 66 65 72 | 65 6e 63 65 2e 59 61 77 |onDiffer|ence.Yaw|
|00003940| 20 29 3b 0d 0a 09 43 6f | 6e 73 74 72 61 69 6e 64 | );...Co|nstraind|
|00003950| 65 52 6f 74 61 74 69 6f | 6e 20 3d 20 50 72 65 66 |eRotatio|n = Pref|
|00003960| 65 72 72 65 64 52 6f 74 | 61 74 69 6f 6e 3b 0d 0a |erredRot|ation;..|
|00003970| 0d 0a 09 2f 2f 69 66 20 | 74 68 65 20 63 68 61 6e |...//if |the chan|
|00003980| 67 65 20 69 6e 20 74 68 | 69 73 20 63 6f 6d 70 6f |ge in th|is compo|
|00003990| 6e 65 6e 74 20 69 73 20 | 6c 65 73 73 20 74 68 61 |nent is |less tha|
|000039a0| 6e 20 74 68 65 20 6d 69 | 6e 69 6d 75 6d 20 61 6c |n the mi|nimum al|
|000039b0| 6c 6f 77 61 62 6c 65 20 | 63 68 61 6e 67 65 0d 0a |lowable |change..|
|000039c0| 09 2f 2f 6f 72 20 74 68 | 65 72 65 20 69 73 20 6e |.//or th|ere is n|
|000039d0| 6f 20 63 68 61 6e 67 65 | 20 69 6e 20 74 68 65 20 |o change| in the |
|000039e0| 76 61 6c 75 65 20 6f 66 | 20 74 68 69 73 20 63 6f |value of| this co|
|000039f0| 6d 70 6f 6e 65 6e 74 0d | 0a 0d 0a 09 2f 2f 69 66 |mponent.|....//if|
|00003a00| 20 61 6e 79 20 63 6f 6d | 70 6f 6e 65 6e 74 20 6f | any com|ponent o|
|00003a10| 66 20 74 68 65 20 52 6f | 74 61 74 69 6f 6e 52 61 |f the Ro|tationRa|
|00003a20| 74 65 20 6d 65 6d 62 65 | 72 20 69 73 20 7a 65 72 |te membe|r is zer|
|00003a30| 6f 20 74 68 65 6e 0d 0a | 09 2f 2f 72 65 74 61 69 |o then..|.//retai|
|00003a40| 6e 20 74 68 65 20 63 6f | 72 72 65 73 70 6f 6e 64 |n the co|rrespond|
|00003a50| 69 6e 67 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |ing valu|e of the|
|00003a60| 20 63 75 72 72 65 6e 74 | 20 72 6f 74 61 74 69 6f | current| rotatio|
|00003a70| 6e 0d 0a 0d 0a 09 69 66 | 28 20 28 20 41 62 73 52 |n.....if|( ( AbsR|
|00003a80| 6f 74 61 74 69 6f 6e 44 | 69 66 66 65 72 65 6e 63 |otationD|ifferenc|
|00003a90| 65 2e 52 6f 6c 6c 20 3d | 3d 20 30 20 29 20 7c 7c |e.Roll =|= 0 ) |||
|00003aa0| 0d 0a 09 09 09 28 20 43 | 6f 6e 73 74 72 61 69 6e |.....( C|onstrain|
|00003ab0| 65 64 41 63 74 6f 72 2e | 52 6f 74 61 74 69 6f 6e |edActor.|Rotation|
|00003ac0| 52 61 74 65 2e 52 6f 6c | 6c 20 3c 20 41 62 73 52 |Rate.Rol|l < AbsR|
|00003ad0| 6f 74 61 74 69 6f 6e 44 | 69 66 66 65 72 65 6e 63 |otationD|ifferenc|
|00003ae0| 65 2e 52 6f 6c 6c 20 29 | 20 7c 7c 0d 0a 09 09 09 |e.Roll )| ||.....|
|00003af0| 28 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |( Constr|ainedAct|
|00003b00| 6f 72 2e 52 6f 74 61 74 | 69 6f 6e 52 61 74 65 2e |or.Rotat|ionRate.|
|00003b10| 52 6f 6c 6c 20 3d 3d 20 | 30 20 29 20 29 0d 0a 09 |Roll == |0 ) )...|
|00003b20| 7b 0d 0a 09 09 43 6f 6e | 73 74 72 61 69 6e 64 65 |{....Con|strainde|
|00003b30| 52 6f 74 61 74 69 6f 6e | 2e 52 6f 6c 6c 20 3d 20 |Rotation|.Roll = |
|00003b40| 43 6f 6e 73 74 72 61 69 | 6e 65 64 41 63 74 6f 72 |Constrai|nedActor|
|00003b50| 2e 52 6f 74 61 74 69 6f | 6e 2e 52 6f 6c 6c 3b 0d |.Rotatio|n.Roll;.|
|00003b60| 0a 09 7d 0d 0a 09 65 6c | 73 65 20 69 66 28 20 41 |..}...el|se if( A|
|00003b70| 62 73 52 6f 74 61 74 69 | 6f 6e 44 69 66 66 65 72 |bsRotati|onDiffer|
|00003b80| 65 6e 63 65 2e 52 6f 6c | 6c 20 3c 20 4d 69 6e 44 |ence.Rol|l < MinD|
|00003b90| 65 6c 74 61 52 6f 74 61 | 74 69 6f 6e 2e 52 6f 6c |eltaRota|tion.Rol|
|00003ba0| 6c 20 29 0d 0a 09 7b 0d | 0a 09 09 43 6f 6e 73 74 |l )...{.|...Const|
|00003bb0| 72 61 69 6e 64 65 52 6f | 74 61 74 69 6f 6e 2e 52 |raindeRo|tation.R|
|00003bc0| 6f 6c 6c 20 3d 20 43 6f | 6e 73 74 72 61 69 6e 65 |oll = Co|nstraine|
|00003bd0| 64 41 63 74 6f 72 2e 52 | 6f 74 61 74 69 6f 6e 2e |dActor.R|otation.|
|00003be0| 52 6f 6c 6c 3b 0d 0a 09 | 7d 0d 0a 09 65 6c 73 65 |Roll;...|}...else|
|00003bf0| 20 69 66 28 20 41 62 73 | 52 6f 74 61 74 69 6f 6e | if( Abs|Rotation|
|00003c00| 44 69 66 66 65 72 65 6e | 63 65 2e 52 6f 6c 6c 20 |Differen|ce.Roll |
|00003c10| 3c 20 4d 69 6e 44 65 6c | 74 61 52 6f 74 61 74 69 |< MinDel|taRotati|
|00003c20| 6f 6e 2e 52 6f 6c 6c 20 | 29 0d 0a 09 7b 0d 0a 09 |on.Roll |)...{...|
|00003c30| 09 43 6f 6e 73 74 72 61 | 69 6e 64 65 52 6f 74 61 |.Constra|indeRota|
|00003c40| 74 69 6f 6e 2e 52 6f 6c | 6c 20 3d 20 43 6f 6e 73 |tion.Rol|l = Cons|
|00003c50| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 2e 52 6f 74 |trainedA|ctor.Rot|
|00003c60| 61 74 69 6f 6e 2e 52 6f | 6c 6c 20 2b 0d 0a 09 09 |ation.Ro|ll +....|
|00003c70| 09 09 41 62 73 52 6f 74 | 61 74 69 6f 6e 44 69 66 |..AbsRot|ationDif|
|00003c80| 66 65 72 65 6e 63 65 2e | 52 6f 6c 6c 20 2f 20 52 |ference.|Roll / R|
|00003c90| 6f 74 61 74 69 6f 6e 44 | 69 66 66 65 72 65 6e 63 |otationD|ifferenc|
|00003ca0| 65 2e 52 6f 6c 6c 20 2a | 0d 0a 09 09 09 09 4d 69 |e.Roll *|......Mi|
|00003cb0| 6e 44 65 6c 74 61 52 6f | 74 61 74 69 6f 6e 2e 52 |nDeltaRo|tation.R|
|00003cc0| 6f 6c 6c 3b 0d 0a 09 7d | 0d 0a 0d 0a 09 69 66 28 |oll;...}|.....if(|
|00003cd0| 20 28 20 41 62 73 52 6f | 74 61 74 69 6f 6e 44 69 | ( AbsRo|tationDi|
|00003ce0| 66 66 65 72 65 6e 63 65 | 2e 50 69 74 63 68 20 3d |fference|.Pitch =|
|00003cf0| 3d 20 30 20 29 20 7c 7c | 0d 0a 09 09 09 28 20 43 |= 0 ) |||.....( C|
|00003d00| 6f 6e 73 74 72 61 69 6e | 65 64 41 63 74 6f 72 2e |onstrain|edActor.|
|00003d10| 52 6f 74 61 74 69 6f 6e | 52 61 74 65 2e 50 69 74 |Rotation|Rate.Pit|
|00003d20| 63 68 20 3c 20 41 62 73 | 52 6f 74 61 74 69 6f 6e |ch < Abs|Rotation|
|00003d30| 44 69 66 66 65 72 65 6e | 63 65 2e 50 69 74 63 68 |Differen|ce.Pitch|
|00003d40| 20 29 20 7c 7c 0d 0a 09 | 09 09 28 20 43 6f 6e 73 | ) ||...|..( Cons|
|00003d50| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 2e 52 6f 74 |trainedA|ctor.Rot|
|00003d60| 61 74 69 6f 6e 52 61 74 | 65 2e 50 69 74 63 68 20 |ationRat|e.Pitch |
|00003d70| 3d 3d 20 30 20 29 20 29 | 0d 0a 09 7b 0d 0a 09 09 |== 0 ) )|...{....|
|00003d80| 43 6f 6e 73 74 72 61 69 | 6e 64 65 52 6f 74 61 74 |Constrai|ndeRotat|
|00003d90| 69 6f 6e 2e 50 69 74 63 | 68 20 3d 20 43 6f 6e 73 |ion.Pitc|h = Cons|
|00003da0| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 2e 52 6f 74 |trainedA|ctor.Rot|
|00003db0| 61 74 69 6f 6e 2e 50 69 | 74 63 68 3b 0d 0a 09 7d |ation.Pi|tch;...}|
|00003dc0| 0d 0a 09 65 6c 73 65 20 | 69 66 28 20 41 62 73 52 |...else |if( AbsR|
|00003dd0| 6f 74 61 74 69 6f 6e 44 | 69 66 66 65 72 65 6e 63 |otationD|ifferenc|
|00003de0| 65 2e 50 69 74 63 68 20 | 3c 20 4d 69 6e 44 65 6c |e.Pitch |< MinDel|
|00003df0| 74 61 52 6f 74 61 74 69 | 6f 6e 2e 50 69 74 63 68 |taRotati|on.Pitch|
|00003e00| 20 29 0d 0a 09 7b 0d 0a | 09 09 43 6f 6e 73 74 72 | )...{..|..Constr|
|00003e10| 61 69 6e 64 65 52 6f 74 | 61 74 69 6f 6e 2e 50 69 |aindeRot|ation.Pi|
|00003e20| 74 63 68 20 3d 20 43 6f | 6e 73 74 72 61 69 6e 65 |tch = Co|nstraine|
|00003e30| 64 41 63 74 6f 72 2e 52 | 6f 74 61 74 69 6f 6e 2e |dActor.R|otation.|
|00003e40| 50 69 74 63 68 3b 0d 0a | 09 7d 0d 0a 09 65 6c 73 |Pitch;..|.}...els|
|00003e50| 65 20 69 66 28 20 41 62 | 73 52 6f 74 61 74 69 6f |e if( Ab|sRotatio|
|00003e60| 6e 44 69 66 66 65 72 65 | 6e 63 65 2e 50 69 74 63 |nDiffere|nce.Pitc|
|00003e70| 68 20 3c 20 4d 69 6e 44 | 65 6c 74 61 52 6f 74 61 |h < MinD|eltaRota|
|00003e80| 74 69 6f 6e 2e 50 69 74 | 63 68 20 29 0d 0a 09 7b |tion.Pit|ch )...{|
|00003e90| 0d 0a 09 09 43 6f 6e 73 | 74 72 61 69 6e 64 65 52 |....Cons|traindeR|
|00003ea0| 6f 74 61 74 69 6f 6e 2e | 50 69 74 63 68 20 3d 20 |otation.|Pitch = |
|00003eb0| 43 6f 6e 73 74 72 61 69 | 6e 65 64 41 63 74 6f 72 |Constrai|nedActor|
|00003ec0| 2e 52 6f 74 61 74 69 6f | 6e 2e 50 69 74 63 68 20 |.Rotatio|n.Pitch |
|00003ed0| 2b 0d 0a 09 09 09 09 41 | 62 73 52 6f 74 61 74 69 |+......A|bsRotati|
|00003ee0| 6f 6e 44 69 66 66 65 72 | 65 6e 63 65 2e 50 69 74 |onDiffer|ence.Pit|
|00003ef0| 63 68 20 2f 20 52 6f 74 | 61 74 69 6f 6e 44 69 66 |ch / Rot|ationDif|
|00003f00| 66 65 72 65 6e 63 65 2e | 50 69 74 63 68 20 2a 0d |ference.|Pitch *.|
|00003f10| 0a 09 09 09 09 4d 69 6e | 44 65 6c 74 61 52 6f 74 |.....Min|DeltaRot|
|00003f20| 61 74 69 6f 6e 2e 50 69 | 74 63 68 3b 0d 0a 09 7d |ation.Pi|tch;...}|
|00003f30| 0d 0a 0d 0a 09 69 66 28 | 20 28 20 41 62 73 52 6f |.....if(| ( AbsRo|
|00003f40| 74 61 74 69 6f 6e 44 69 | 66 66 65 72 65 6e 63 65 |tationDi|fference|
|00003f50| 2e 59 61 77 20 3d 3d 20 | 30 20 29 20 7c 7c 0d 0a |.Yaw == |0 ) ||..|
|00003f60| 09 09 09 28 20 43 6f 6e | 73 74 72 61 69 6e 65 64 |...( Con|strained|
|00003f70| 41 63 74 6f 72 2e 52 6f | 74 61 74 69 6f 6e 52 61 |Actor.Ro|tationRa|
|00003f80| 74 65 2e 59 61 77 20 3c | 20 41 62 73 52 6f 74 61 |te.Yaw <| AbsRota|
|00003f90| 74 69 6f 6e 44 69 66 66 | 65 72 65 6e 63 65 2e 59 |tionDiff|erence.Y|
|00003fa0| 61 77 20 29 20 7c 7c 0d | 0a 09 09 09 28 20 43 6f |aw ) ||.|....( Co|
|00003fb0| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 2e 52 |nstraine|dActor.R|
|00003fc0| 6f 74 61 74 69 6f 6e 52 | 61 74 65 2e 59 61 77 20 |otationR|ate.Yaw |
|00003fd0| 3d 3d 20 30 20 29 20 29 | 0d 0a 09 7b 0d 0a 09 09 |== 0 ) )|...{....|
|00003fe0| 43 6f 6e 73 74 72 61 69 | 6e 64 65 52 6f 74 61 74 |Constrai|ndeRotat|
|00003ff0| 69 6f 6e 2e 59 61 77 20 | 3d 20 43 6f 6e 73 74 72 |ion.Yaw |= Constr|
|00004000| 61 69 6e 65 64 41 63 74 | 6f 72 2e 52 6f 74 61 74 |ainedAct|or.Rotat|
|00004010| 69 6f 6e 2e 59 61 77 3b | 0d 0a 09 7d 0d 0a 09 65 |ion.Yaw;|...}...e|
|00004020| 6c 73 65 20 69 66 28 20 | 41 62 73 52 6f 74 61 74 |lse if( |AbsRotat|
|00004030| 69 6f 6e 44 69 66 66 65 | 72 65 6e 63 65 2e 59 61 |ionDiffe|rence.Ya|
|00004040| 77 20 3c 20 4d 69 6e 44 | 65 6c 74 61 52 6f 74 61 |w < MinD|eltaRota|
|00004050| 74 69 6f 6e 2e 59 61 77 | 20 29 0d 0a 09 7b 0d 0a |tion.Yaw| )...{..|
|00004060| 09 09 43 6f 6e 73 74 72 | 61 69 6e 64 65 52 6f 74 |..Constr|aindeRot|
|00004070| 61 74 69 6f 6e 2e 59 61 | 77 20 3d 20 43 6f 6e 73 |ation.Ya|w = Cons|
|00004080| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 2e 52 6f 74 |trainedA|ctor.Rot|
|00004090| 61 74 69 6f 6e 2e 59 61 | 77 3b 0d 0a 09 7d 0d 0a |ation.Ya|w;...}..|
|000040a0| 09 65 6c 73 65 20 69 66 | 28 20 41 62 73 52 6f 74 |.else if|( AbsRot|
|000040b0| 61 74 69 6f 6e 44 69 66 | 66 65 72 65 6e 63 65 2e |ationDif|ference.|
|000040c0| 59 61 77 20 3c 20 4d 69 | 6e 44 65 6c 74 61 52 6f |Yaw < Mi|nDeltaRo|
|000040d0| 74 61 74 69 6f 6e 2e 59 | 61 77 20 29 0d 0a 09 7b |tation.Y|aw )...{|
|000040e0| 0d 0a 09 09 43 6f 6e 73 | 74 72 61 69 6e 64 65 52 |....Cons|traindeR|
|000040f0| 6f 74 61 74 69 6f 6e 2e | 59 61 77 20 3d 20 43 6f |otation.|Yaw = Co|
|00004100| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 2e 52 |nstraine|dActor.R|
|00004110| 6f 74 61 74 69 6f 6e 2e | 59 61 77 20 2b 0d 0a 09 |otation.|Yaw +...|
|00004120| 09 09 09 41 62 73 52 6f | 74 61 74 69 6f 6e 44 69 |...AbsRo|tationDi|
|00004130| 66 66 65 72 65 6e 63 65 | 2e 59 61 77 20 2f 20 52 |fference|.Yaw / R|
|00004140| 6f 74 61 74 69 6f 6e 44 | 69 66 66 65 72 65 6e 63 |otationD|ifferenc|
|00004150| 65 2e 59 61 77 20 2a 0d | 0a 09 09 09 09 4d 69 6e |e.Yaw *.|.....Min|
|00004160| 44 65 6c 74 61 52 6f 74 | 61 74 69 6f 6e 2e 59 61 |DeltaRot|ation.Ya|
|00004170| 77 3b 0d 0a 09 7d 0d 0a | 0d 0a 09 2f 2f 4c 6f 67 |w;...}..|...//Log|
|00004180| 28 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |( Constr|ainedAct|
|00004190| 6f 72 20 24 20 22 3a 3a | 43 6f 6e 73 74 72 61 69 |or $ "::|Constrai|
|000041a0| 6e 41 63 74 6f 72 52 6f | 74 61 74 69 6f 6e 20 43 |nActorRo|tation C|
|000041b0| 6f 6e 73 74 72 61 69 6e | 65 64 41 63 74 6f 72 2e |onstrain|edActor.|
|000041c0| 52 6f 74 61 74 69 6f 6e | 52 61 74 65 3a 20 22 20 |Rotation|Rate: " |
|000041d0| 24 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |$ Constr|ainedAct|
|000041e0| 6f 72 2e 52 6f 74 61 74 | 69 6f 6e 52 61 74 65 20 |or.Rotat|ionRate |
|000041f0| 29 3b 0d 0a 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |);...//L|og( Cons|
|00004200| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|00004210| 3a 3a 43 6f 6e 73 74 72 | 61 69 6e 41 63 74 6f 72 |::Constr|ainActor|
|00004220| 52 6f 74 61 74 69 6f 6e | 20 43 6f 6e 73 74 72 61 |Rotation| Constra|
|00004230| 69 6e 65 64 41 63 74 6f | 72 2e 52 6f 74 61 74 69 |inedActo|r.Rotati|
|00004240| 6f 6e 3a 20 22 20 24 20 | 43 6f 6e 73 74 72 61 69 |on: " $ |Constrai|
|00004250| 6e 65 64 41 63 74 6f 72 | 2e 52 6f 74 61 74 69 6f |nedActor|.Rotatio|
|00004260| 6e 20 29 3b 0d 0a 09 2f | 2f 4c 6f 67 28 20 43 6f |n );.../|/Log( Co|
|00004270| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 20 24 |nstraine|dActor $|
|00004280| 20 22 3a 3a 43 6f 6e 73 | 74 72 61 69 6e 41 63 74 | "::Cons|trainAct|
|00004290| 6f 72 52 6f 74 61 74 69 | 6f 6e 20 52 6f 74 61 74 |orRotati|on Rotat|
|000042a0| 69 6f 6e 44 69 66 66 65 | 72 65 6e 63 65 3a 20 22 |ionDiffe|rence: "|
|000042b0| 20 24 20 52 6f 74 61 74 | 69 6f 6e 44 69 66 66 65 | $ Rotat|ionDiffe|
|000042c0| 72 65 6e 63 65 20 29 3b | 0d 0a 09 2f 2f 4c 6f 67 |rence );|...//Log|
|000042d0| 28 20 43 6f 6e 73 74 72 | 61 69 6e 65 64 41 63 74 |( Constr|ainedAct|
|000042e0| 6f 72 20 24 20 22 3a 3a | 43 6f 6e 73 74 72 61 69 |or $ "::|Constrai|
|000042f0| 6e 41 63 74 6f 72 52 6f | 74 61 74 69 6f 6e 20 41 |nActorRo|tation A|
|00004300| 62 73 52 6f 74 61 74 69 | 6f 6e 64 69 66 66 65 72 |bsRotati|ondiffer|
|00004310| 65 6e 63 65 3a 20 22 20 | 24 20 41 62 73 52 6f 74 |ence: " |$ AbsRot|
|00004320| 61 74 69 6f 6e 44 69 66 | 66 65 72 65 6e 63 65 20 |ationDif|ference |
|00004330| 29 3b 0d 0a 09 2f 2f 4c | 6f 67 28 20 43 6f 6e 73 |);...//L|og( Cons|
|00004340| 74 72 61 69 6e 65 64 41 | 63 74 6f 72 20 24 20 22 |trainedA|ctor $ "|
|00004350| 3a 3a 43 6f 6e 73 74 72 | 61 69 6e 41 63 74 6f 72 |::Constr|ainActor|
|00004360| 52 6f 74 61 74 69 6f 6e | 20 50 72 65 66 65 72 72 |Rotation| Preferr|
|00004370| 65 64 52 6f 74 61 74 69 | 6f 6e 3a 20 22 20 24 20 |edRotati|on: " $ |
|00004380| 50 72 65 66 65 72 72 65 | 64 52 6f 74 61 74 69 6f |Preferre|dRotatio|
|00004390| 6e 20 29 3b 0d 0a 09 2f | 2f 4c 6f 67 28 20 43 6f |n );.../|/Log( Co|
|000043a0| 6e 73 74 72 61 69 6e 65 | 64 41 63 74 6f 72 20 24 |nstraine|dActor $|
|000043b0| 20 22 3a 3a 43 6f 6e 73 | 74 72 61 69 6e 41 63 74 | "::Cons|trainAct|
|000043c0| 6f 72 52 6f 74 61 74 69 | 6f 6e 20 43 6f 6e 73 74 |orRotati|on Const|
|000043d0| 72 61 69 6e 65 64 52 6f | 74 61 74 69 6f 6e 3a 20 |rainedRo|tation: |
|000043e0| 22 20 24 20 43 6f 6e 73 | 74 72 61 69 6e 64 65 52 |" $ Cons|traindeR|
|000043f0| 6f 74 61 74 69 6f 6e 20 | 29 3b 0d 0a 0d 0a 09 72 |otation |);.....r|
|00004400| 65 74 75 72 6e 20 28 20 | 43 6f 6e 73 74 72 61 69 |eturn ( |Constrai|
|00004410| 6e 64 65 52 6f 74 61 74 | 69 6f 6e 20 21 3d 20 50 |ndeRotat|ion != P|
|00004420| 72 65 66 65 72 72 65 64 | 52 6f 74 61 74 69 6f 6e |referred|Rotation|
|00004430| 20 29 3b 0d 0a 7d 0d 0a | 0d 0a 00 | );..}..|... |
+--------+-------------------------+-------------------------+--------+--------+